Projet

Général

Profil

« Précédent | Suivant » 

Révision 286996b4

Ajouté par Colin Fleming il y a presque 10 ans

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

Voir les différences:

usr/local/www/status_graph.php
115 115
?>
116 116

  
117 117
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
118
<?php include("fbegin.inc"); ?>
118 119

  
119 120
<script type="text/javascript">
120

  
121
//<![CDATA[
121 122
function updateBandwidth(){
122 123
    var hostinterface = jQuery("#if").val();
123 124
	var sorting = jQuery("#sort").val();
......
190 191
    
191 192
    setTimeout('updateBandwidth()', 1000);
192 193
}
193

  
194

  
194
//]]>
195 195
</script>
196 196

  
197
<?php include("fbegin.inc"); ?>
198 197
<?php
199 198

  
200 199
/* link the ipsec interface magically */
......
208 207
<?php
209 208
foreach ($ifdescrs as $ifn => $ifd) {
210 209
	echo "<option value=\"$ifn\"";
211
	if ($ifn == $curif) echo " selected";
210
	if ($ifn == $curif) echo " selected=\"selected\"";
212 211
	echo ">" . htmlspecialchars($ifd) . "</option>\n";
213 212
}
214 213
?>
......
216 215
, Sort by: 
217 216
<select id="sort" name="sort" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
218 217
	<option value="">Bw In</option>
219
	<option value="out"<?php if ($cursort == "out") echo " selected";?>>Bw Out</option>
218
	<option value="out"<?php if ($cursort == "out") echo " selected=\"selected\"";?>>Bw Out</option>
220 219
</select>
221 220
, Filter: 
222 221
<select id="filter" name="filter" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
223
	<option value="local"<?php if ($curfilter == "local") echo " selected";?>>Local</option>
224
	<option value="remote"<?php if ($curfilter == "remote") echo " selected";?>>Remote</option>
225
	<option value="all"<?php if ($curfilter == "all") echo " selected";?>>All</option>
222
	<option value="local"<?php if ($curfilter == "local") echo " selected=\"selected\"";?>>Local</option>
223
	<option value="remote"<?php if ($curfilter == "remote") echo " selected=\"selected\"";?>>Remote</option>
224
	<option value="all"<?php if ($curfilter == "all") echo " selected=\"selected\"";?>>All</option>
226 225
</select>
227 226
, Display: 
228 227
<select id="hostipformat" name="hostipformat" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
229 228
	<option value="">IP Address</option>
230 229
	<option value="hostname"<?php if ($curhostipformat == "hostname") echo " selected";?>>Host Name</option>
231
	<option value="fqdn"<?php if ($curhostipformat == "fqdn") echo " selected";?>>FQDN</option>
230
	<option value="fqdn"<?php if ($curhostipformat == "fqdn") echo " selected=\"selected\"";?>>FQDN</option>
232 231
</select>
233 232
</form>
234
<p>
233
<p>&nbsp;</p>
235 234
<div id="niftyOutter">
236 235
    <div id="col1" style="float: left; width: 46%; padding: 5px; position: relative;">
237
        <embed src="graph.php?ifnum=<?=htmlspecialchars($curif);?>&ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>" type="image/svg+xml" width="<?=$width;?>" height="<?=$height;?>" pluginspage="http://www.adobe.com/svg/viewer/install/auto" />
236
        <object	data="graph.php?ifnum=<?=htmlspecialchars($curif);?>&amp;ifname=<?=rawurlencode($ifdescrs[htmlspecialchars($curif)]);?>">
237
          <param name="id" value="graph" />
238
          <param name="type" value="image/svg+xml" />
239
          <param name="width" value="<? echo $width; ?>" />
240
          <param name="height" value="<? echo $height; ?>" />
241
          <param name="pluginspage" value="http://www.adobe.com/svg/viewer/install/auto" />
242
        </object>
238 243
    </div>
239 244
    <div id="col2" style="float: right; width: 48%; padding: 5px; position: relative;">
240
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
245
        <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="status">
241 246
            <tr>
242 247
                <td class="listtopic" valign="top"><?=(($curhostipformat=="") ? gettext("Host IP") : gettext("Host Name or IP")); ?></td>
243 248
                <td class="listtopic" valign="top"><?=gettext("Bandwidth In"); ?></td>
......
327 332
	</div>
328 333
	<div style="clear: both;"></div>
329 334
</div>
330
<p><span class="red"><strong><?=gettext("Note"); ?>:</strong></span> <?=gettext("the"); ?> <a href="http://www.adobe.com/svg/viewer/install/" target="_blank"><?=gettext("Adobe SVG Viewer"); ?></a>, <?=gettext("Firefox 1.5 or later or other browser supporting SVG is required to view the graph"); ?>.
335
<p><span class="red"><strong><?=gettext("Note"); ?>:</strong></span> <?=gettext("the"); ?> <a href="http://www.adobe.com/svg/viewer/install/" target="_blank"><?=gettext("Adobe SVG Viewer"); ?></a>, <?=gettext("Firefox 1.5 or later or other browser supporting SVG is required to view the graph"); ?>.</p>
331 336

  
332 337
<?php include("fend.inc"); ?>
333 338

  
334 339
<script type="text/javascript">
340
//<![CDATA[
335 341
jQuery(document).ready(updateBandwidth);
342
//]]>
336 343
</script>
337 344
</body>
338 345
</html>
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>&nbsp; Seconds<br />&nbsp; &nbsp; &nbsp; <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;?>&amp;ifname=<?=rawurlencode($ifdescr);?>&amp;timeint=<?=$refreshinterval;?>&amp;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