fixing bugs

This commit is contained in:
mantaohuang 2020-07-28 12:28:29 -04:00
parent 522dbb6e6f
commit f61fd1a6a7
2 changed files with 13 additions and 11 deletions

View File

@ -102,7 +102,7 @@ class OManager:
for line in io_stat: for line in io_stat:
time, value_down, value_up = line.split(",") time, value_down, value_up = line.split(",")
time = datetime.utcfromtimestamp(float(time)) time = datetime.utcfromtimestamp(float(time))
value = float(value_down+value_up) value = float(value_down)+float(value_up)
if first_line: if first_line:
first_line = False first_line = False
else: else:

View File

@ -466,7 +466,7 @@
<th>Alive</th> <th>Alive</th>
</tr> </tr>
</thead>`)) </thead>`))
data.instances.forEach((instace, index) => { data.instances.forEach((instance, index) => {
var tr = `<tr> var tr = `<tr>
<td> <td>
${instance.name} ${instance.name}
@ -477,17 +477,19 @@
<div class="chart-sparkline" id="sparkline-${index}"></div> <div class="chart-sparkline" id="sparkline-${index}"></div>
</td> </td>
</tr>` </tr>`
});
ovpn_table.append(tr);
$().peity && $(`#sparkline-${index}`).text(instance.ping_rate.join(", ")).peity("line", { ovpn_table.append(tr);
width: 64, $().peity && $(`#sparkline-${index}`).text(instance.ping_rate.join(", ")).peity("line", {
height: 40, width: 64,
stroke: "#206bc4", height: 40,
strokeWidth: 2, stroke: "#206bc4",
fill: ["#d2e1f3"], strokeWidth: 2,
padding: .2, fill: ["#d2e1f3"],
padding: .2,
});
}); });
}); });
} }
update_stat(); update_stat();