summaryrefslogtreecommitdiff
path: root/html/network.tmpl
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2009-12-19 13:50:17 +0000
committerAndreas Brachold <vdr07@deltab.de>2009-12-19 13:50:17 +0000
commit088518042587c633b662d054375c9801bed844f4 (patch)
tree1ac3ba2672d83314e40646e2857e7910d1788a85 /html/network.tmpl
parentfd94b0111202e094cc4b2b8272eb5d637aed719b (diff)
downloadxxv-088518042587c633b662d054375c9801bed844f4.tar.gz
xxv-088518042587c633b662d054375c9801bed844f4.tar.bz2
* CHANNELS: allow query a compact list ( by cmd=clist&compact=1 )
* STATUS: Refactoring output (network/filesys/memory/vitals) * STREAM: Fix SMB streaming (div by zero) * html/xstyle: footer updated * xstyle: css fix correct z-index on schema for timemarker * jason: use one loading mask for many tasks * jason: timer self updating if new timer created * jason: stream allow external video player * jason: use compact channel list (reduce memory footprint) * update translations
Diffstat (limited to 'html/network.tmpl')
-rw-r--r--html/network.tmpl63
1 files changed, 24 insertions, 39 deletions
diff --git a/html/network.tmpl b/html/network.tmpl
index 0f4538d..5e39706 100644
--- a/html/network.tmpl
+++ b/html/network.tmpl
@@ -3,10 +3,11 @@
statusfiles = {};
FILTER null;
- name = 'network_stat';
+ fields = data.shift;
+
timestamps = [];
- FOREACH entry = param.stack.first.network;
- iname = entry.first.split(':').first;
+ FOREACH row = data;
+ iname = row.0.split(':').first;
rxbytes.${iname} = [];
txbytes.${iname} = [];
@@ -16,27 +17,26 @@
oldentry.${iname} = [];
END;
- FOREACH item = param.stack;
- t = date.format(item.timestamp, '%H:%M:%S');
- timestamps.push(t);
+ FOREACH row = data;
+ IF ot != row.5;
+ t = date.format(row.5, '%H:%M');
+ timestamps.push(t);
+ ot = row.5;
+ END;
- FOREACH entry = item.network;
- iname = entry.first.split(':').first;
+ iname = row.0.split(':').first;
UNLESS oldentry.${iname}.size;
- oldentry.${iname} = entry;
+ oldentry.${iname} = row;
END;
- bytes = entry.1 - oldentry.${iname}.1;
- rxbytes.${iname}.push(bytes);
+ bytes = row.1 - oldentry.${iname}.1;
+ rxbytes.${iname}.push(bytes / (1024*1024));
- bytes = entry.5 - oldentry.${iname}.5;
- txbytes.${iname}.push(bytes);
+ bytes = row.3 - oldentry.${iname}.3;
+ txbytes.${iname}.push(bytes / (1024*1024));
- rxerror.${iname}.push(entry.3);
- txerror.${iname}.push(entry.7);
- oldentry.${iname} = entry;
- END;
+ oldentry.${iname} = row;
END;
FOREACH iname = rxbytes.keys.sort;
@@ -45,23 +45,21 @@
d = [
timestamps,
rxbytes.${iname},
- rxerror.${iname},
- txbytes.${iname},
- txerror.${iname},
+ txbytes.${iname}
];
USE my_graph = GD.Graph.lines(600,300);
# Xsteps
- steps = param.stack.size / 5 | format('%d');
+ steps = timestamps.size div 5;
label = gettext('Traffic on Interface');
- label = "${label} ${iname}";
+ y_label = gettext('MB')
+ label = "${label} ${iname} (${y_label})";
my_graph.set(
title => label,
x_label_skip => steps,
x_long_ticks => 1,
- y_label => gettext('Transfer in bytes'),
y_long_ticks => 1,
line_width => 2,
@@ -76,30 +74,17 @@
my_graph.set_x_label_font(param.font,10);
my_graph.set_x_axis_font(param.font,6);
my_graph.set_y_axis_font(param.font,6);
- my_graph.set_legend( 'RxBytes', 'RxErrors', 'TxBytes', 'TxErrors');
- statusfiles.$iname = writefile("status_network_${iname}.gif", my_graph.plot(d).gif );
+ my_graph.set_legend( fields.1, fields.3);
+ statusfiles.$iname = writefile("status_network_${iname}.png", my_graph.plot(d).gif );
END;
END;
%?>
-<!-- Vitals Template -->
+<!-- Network Template -->
<?% IF param.headingText %?>
<table width=100%><tr><td class='tableheader'><h3><?% param.headingText %?></h3>
<?% END %?>
<table border="0" width="95%">
- <?% fields = data.shift %?>
- <tr>
- <?% FOREACH field = fields %?>
- <th><?% field %?></th>
- <?% END %?>
- </tr>
- <?% FOREACH zeile = data %?>
- <tr>
- <?% FOREACH field = zeile %?>
- <td><?% field %?></td>
- <?% END %?>
- </tr>
- <?% END %?>
<?% FOREACH file = statusfiles.keys %?>
<tr>