Révision 286996b4
Ajouté par Colin Fleming il y a presque 10 ans
usr/local/www/widgets/widgets/traffic_graphs.widget.php | ||
---|---|---|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
?> |
99 |
<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value=""> |
|
99 |
<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value="" />
|
|
100 | 100 |
|
101 | 101 |
<?php |
102 | 102 |
//set variables for traffic graph |
... | ... | |
104 | 104 |
$height = "150"; |
105 | 105 |
?> |
106 | 106 |
|
107 |
<div id="traffic_graphs-settings" name="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;">
|
|
107 |
<div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;"> |
|
108 | 108 |
<form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform"> |
109 | 109 |
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?> |
110 | 110 |
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" /> |
... | ... | |
112 | 112 |
Default AutoScale: |
113 | 113 |
<?php |
114 | 114 |
$scale_type_up="checked"; |
115 |
$scale_type_follow="unchecked";
|
|
115 |
$scale_type_follow=""; |
|
116 | 116 |
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) { |
117 | 117 |
$selected_radio = $config["widgets"]["trafficgraphs"]["scale_type"]; |
118 | 118 |
if ($selected_radio == "up") { |
119 |
$scale_type_up = "checked"; |
|
119 |
$scale_type_up = "checked=\"checked\"";
|
|
120 | 120 |
} |
121 | 121 |
else if ($selected_radio == "follow") { |
122 |
$scale_type_follow = "checked"; |
|
122 |
$scale_type_follow = "checked=\"checked\"";
|
|
123 | 123 |
} |
124 | 124 |
} |
125 | 125 |
?> |
... | ... | |
128 | 128 |
Refresh Interval: |
129 | 129 |
<select name="refreshinterval" class="formfld" id="refreshinterval" onchange="updateGraphDisplays();"> |
130 | 130 |
<?php for ($i = 1; $i <= 10; $i += 1) { ?> |
131 |
<option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected='selected'";?>><?= $i ?></option>
|
|
131 |
<option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected=\"selected\"";?>><?= $i ?></option>
|
|
132 | 132 |
<?php } ?> |
133 | 133 |
</select> Seconds<br /> <b>Note:</b> changing this setting will increase CPU utilization<br /><br /> |
134 | 134 |
<input id="submit" name="submit" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" /> |
... | ... | |
136 | 136 |
</div> |
137 | 137 |
|
138 | 138 |
<script type="text/javascript"> |
139 |
//<![CDATA[ |
|
139 | 140 |
d = document; |
140 | 141 |
selectIntLink = "traffic_graphs-configure"; |
141 | 142 |
textlink = d.getElementById(selectIntLink); |
142 | 143 |
textlink.style.display = "inline"; |
144 |
//]]> |
|
143 | 145 |
</script> |
144 | 146 |
|
145 | 147 |
<?php |
... | ... | |
160 | 162 |
<div id="<?=$ifname;?>trafficdiv" style="padding: 5px"> |
161 | 163 |
<div id="<?=$ifname;?>topic" class="widgetsubheader"> |
162 | 164 |
<div style="float:left;width:49%"> |
163 |
<span onClick="location.href='/status_graph.php?if=<?=$ifname;?>'" style="cursor:pointer">Current <?=$ifdescr;?> Traffic</span>
|
|
165 |
<span onclick="location.href='/status_graph.php?if=<?=$ifname;?>'" style="cursor:pointer">Current <?=$ifdescr;?> Traffic</span>
|
|
164 | 166 |
</div> |
165 | 167 |
<div align="right" style="float:right;width:49%"> |
166 | 168 |
<div id="<?=$ifname;?>graphdiv-min" onclick='return trafficminimizeDiv("<?= $ifname ?>", true);' |
... | ... | |
171 | 173 |
<div style="clear:both;"></div> |
172 | 174 |
</div> |
173 | 175 |
<div id="<?=$ifname;?>graphdiv" style="display:<?php echo $graphdisplay;?>"> |
174 |
<embed id="graph" src="graph.php?ifnum=<?=$ifname;?>&ifname=<?=rawurlencode($ifdescr);?>&timeint=<?=$refreshinterval;?>&initdelay=<?=($graphcounter+1) * 2;?>" type="image/svg+xml" width="100%" height="100%" pluginspage="http://www.adobe.com/svg/viewer/install/auto" /> |
|
176 |
<object data="graph.php?ifnum=<?=$ifname;?>&ifname=<?=rawurlencode($ifdescr);?>&timeint=<?=$refreshinterval;?>&initdelay=<?=($graphcounter+1) * 2;?>"> |
|
177 |
<param name="id" value="graph" /> |
|
178 |
<param name="type" value="image/svg+xml" /> |
|
179 |
<param name="width" value="<? echo $width; ?>" /> |
|
180 |
<param name="height" value="<? echo $height; ?>" /> |
|
181 |
<param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" /> |
|
182 |
</object> |
|
175 | 183 |
</div> |
176 | 184 |
</div> |
177 | 185 |
<?php } |
Formats disponibles : Unified diff
Tidy up "status_graph" XHTML
Move "fbegin.inc" between BODY and SCRIPT
Add CDATA sections to SCRTIPS
Update HTML Boolean operators
Remove EMBED, propriietary tag, replace with OBJECT
Add SUMMARY to TABLES
Add missing closing P tag
Close INPUT tags