Revision 3bae4ee4
Added by Charlie Marshall about 12 years ago
usr/local/www/graph.php | ||
---|---|---|
116 | 116 |
<text id="ifname" x="<?=$width?>" y="8" <?=$attribs['graphname']?> text-anchor="end"><?=htmlspecialchars($ifname)?></text> |
117 | 117 |
<text id="switch_unit" x="<?=$width*0.55?>" y="5" <?=$attribs['switch_unit']?>><?=gettext("Switch to bytes/s"); ?></text> |
118 | 118 |
<text id="switch_scale" x="<?=$width*0.55?>" y="11" <?=$attribs['switch_scale']?>><?=gettext("AutoScale"); ?> (<?=$scale_type?>)</text> |
119 |
<text id="datetime" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text> |
|
119 |
<text id="date" x="<?=$width*0.33?>" y="5" <?=$attribs['legend']?>> </text> |
|
120 |
<text id="time" x="<?=$width*0.33?>" y="11" <?=$attribs['legend']?>> </text> |
|
120 | 121 |
<text id="graphlast" x="<?=$width*0.55?>" y="17" <?=$attribs['legend']?>><?=gettext("Graph shows last"); ?> <?=$time_interval*$nb_plot?> <?=gettext("seconds"); ?></text> |
121 | 122 |
<polygon id="axis_arrow_x" <?=$attribs['axis']?> points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/> |
122 | 123 |
<text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" visibility="hidden" <?=$attribs['error']?> text-anchor="middle"><?=$error_text?></text> |
... | ... | |
209 | 210 |
function plot_data(obj) { |
210 | 211 |
// Show datetimelegend |
211 | 212 |
var now = new Date(); |
212 |
var datetime = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + ' ' + |
|
213 |
LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds()); |
|
214 |
SVGDoc.getElementById('datetime').firstChild.data = datetime; |
|
213 |
var time = LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds()); |
|
214 |
SVGDoc.getElementById('time').firstChild.data = time; |
|
215 |
var date = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear(); |
|
216 |
SVGDoc.getElementById('date').firstChild.data = date; |
|
215 | 217 |
|
216 | 218 |
if (!obj.success) |
217 | 219 |
return handle_error(); // getURL failed to get data |
Also available in: Unified diff
seperate date & time on traffic graphs