去除多余日志, 图表最大数据量, 日志隐藏密码

This commit is contained in:
zogodo
2020-04-22 10:21:08 +08:00
parent aa4823116c
commit e1b7cbac47
6 changed files with 17 additions and 16 deletions

View File

@@ -125,7 +125,7 @@ static int HttpGetAssets(httpd_request_t *req)
http_log("HttpGetAssets url[%s] err", req->filename);
return err;
}
http_log("HttpGetAssets url[%s] file_name[%s]", req->filename, file_name);
//http_log("HttpGetAssets url[%s] file_name[%s]", req->filename, file_name);
int total_sz = 0;
const unsigned char* file_data = NULL;

View File

@@ -741,8 +741,8 @@ $("#wifi_submit").on("click", function() {
//Config-end
//图表-start
var data = { series: [ [] ] };
var t = new Chartist.Line('.ct-chart', data, {showArea: true, axisY: {position: 'end'}});
var ct_data = { series: [ [] ] };
var ct_chart = new Chartist.Line('.ct-chart', ct_data, {showArea: true, axisY: {position: 'end'}});
var power_idx = 0;
var chart_wth = 0;
function GetPowerRecord() {
@@ -754,11 +754,14 @@ function GetPowerRecord() {
var x = chart_par.scrollWidth - chart_par.offsetWidth - chart_par.scrollLeft;
power.powers.forEach(element => {
data.series[0].push(element/10);
var len = ct_data.series[0].push(element/10);
if (len > 1000) { //最多1000条数据
ct_data.series[0].shift();
}
});
chart_wth += power.powers.length;
$("#ct-chart").width(chart_wth * 10);
t.update(data);
ct_chart.update(ct_data);
if (power.powers.length != 0 && x < 100) {
chart_par.scrollTo(chart_par.scrollWidth, 0);
}