From 6e8ec3f8b8acbb85ff82bfa24837c07f47653696 Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 16 Apr 2024 00:11:02 +0800 Subject: [PATCH] bug fix for render stats html --- public/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/index.html b/public/index.html index 770969e..6220497 100644 --- a/public/index.html +++ b/public/index.html @@ -128,9 +128,9 @@ return str; }; - var renderStats = function(data) { + var renderStats = function(parentCls, data) { for (var key in data) { - $('.'+key).text(data[key]); + $('.' + parentCls + ' .'+key).text(data[key]); } }; @@ -152,9 +152,9 @@ + txtStatus[item['status']] + ''; html += '
' + htmlspecialchars(item['description']) - + ',支持:' + JSON.stringify(item['platforms']) - + ',合约:' + JSON.stringify(item['contracts']) - + ',联系:' + htmlspecialchars(item['contact']) + + '
支持平台:' + JSON.stringify(item['platforms']) + + ',支持合约:' + JSON.stringify(item['contracts']) + + ',联系方式:' + htmlspecialchars(item['contact']) + '
'; } @@ -169,8 +169,8 @@ }).done(function(data) { $('#herounion_stats').text(JSON.stringify(data, null, 4)); $('.run_time').text( formatSeconds(data.run_seconds) ); - renderStats(data.taskStatus); - renderStats(data.heroStatus); + renderStats('taskStatus', data.taskStatus); + renderStats('heroStatus', data.heroStatus); }); api = '/api/heros/';