Commit e9071598 authored by Jos Schellevis's avatar Jos Schellevis

Update traffic graphs dashboard

parent 8f7e3e45
*.DS_Store *.DS_Store
*.codekit *.codekit
*.sass-cache
...@@ -182,6 +182,7 @@ if(file_exists('/conf/needs_package_sync')) { ...@@ -182,6 +182,7 @@ if(file_exists('/conf/needs_package_sync')) {
if ($config['widgets'] && $config['widgets']['sequence'] != "") { if ($config['widgets'] && $config['widgets']['sequence'] != "") {
$pconfig['sequence'] = $config['widgets']['sequence']; $pconfig['sequence'] = $config['widgets']['sequence'];
$widgetlist = $pconfig['sequence']; $widgetlist = $pconfig['sequence'];
$colpos = array(); $colpos = array();
$savedwidgetfiles = array(); $savedwidgetfiles = array();
...@@ -332,7 +333,7 @@ function showSave(){ ...@@ -332,7 +333,7 @@ function showSave(){
$('#updatepref').show(); $('#updatepref').show();
} }
function updatePref(){ /*function updatePref(){
var widgets = $('.widgetdiv'); var widgets = $('.widgetdiv');
var widgetSequence = ''; var widgetSequence = '';
var firstprint = false; var firstprint = false;
...@@ -356,7 +357,7 @@ function updatePref(){ ...@@ -356,7 +357,7 @@ function updatePref(){
$("#iform").submit(); $("#iform").submit();
return false; return false;
} }*/
//]]> //]]>
...@@ -374,11 +375,11 @@ include("head.inc"); ...@@ -374,11 +375,11 @@ include("head.inc");
<script type="text/javascript"> <!--script type="text/javascript">
//<![CDATA[ //<![CDATA[
columns = ['col1','col2','col3','col4', 'col5','col6','col7','col8','col9','col10']; columns = ['col1','col2','col3','col4', 'col5','col6','col7','col8','col9','col10'];
//]]> //]]>
</script> </script-->
<?php <?php
include("fbegin.inc"); include("fbegin.inc");
...@@ -571,7 +572,7 @@ echo $jscriptstr; ...@@ -571,7 +572,7 @@ echo $jscriptstr;
<button type="button" class="btn btn-default btn-xs" title="remove widget" onclick='return closeWidget("<?php echo $widgetname;?>",true)'><span class="glyphicon glyphicon-remove"></span></button> <button type="button" class="btn btn-default btn-xs" title="remove widget" onclick='return closeWidget("<?php echo $widgetname;?>",true)'><span class="glyphicon glyphicon-remove"></span></button>
<button class="btn btn-default btn-xs" id="<?php echo $widgetname;?>-configure" onclick='return configureWidget("<?php echo $widgetname;?>")' style="display:none; cursor:pointer" ><span class="glyphicon glyphicon-pencil"></span></button> <button type="button" class="btn btn-default btn-xs" id="<?php echo $widgetname;?>-configure" onclick='return configureWidget("<?php echo $widgetname;?>")' style="display:none; cursor:pointer" ><span class="glyphicon glyphicon-pencil"></span></button>
</div> </div>
</li> </li>
......
...@@ -100,10 +100,17 @@ if (isset($a_config["scale_type"])) { ...@@ -100,10 +100,17 @@ if (isset($a_config["scale_type"])) {
<div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;"> <div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;">
<form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform"> <form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform">
<table class="table table-striped">
<tbody>
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?> <?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" /> <input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
<?php } ?> <?php } ?>
<tr>
<td>
Default AutoScale: Default AutoScale:
</td>
</tr>
<?php <?php
$scale_type_up="checked=\"checked\""; $scale_type_up="checked=\"checked\"";
$scale_type_follow=""; $scale_type_follow="";
...@@ -119,15 +126,29 @@ if (isset($a_config["scale_type"])) { ...@@ -119,15 +126,29 @@ if (isset($a_config["scale_type"])) {
} }
} }
?> ?>
<input name="scale_type" class="radio" type="radio" id="scale_type_up" value="up" <?php echo $scale_type_up; ?> onchange="updateGraphDisplays();" /> <span>up</span> <tr>
<input name="scale_type" class="radio" type="radio" id="scale_type_follow" value="follow" <?php echo $scale_type_follow; ?> onchange="updateGraphDisplays();" /> <span>follow</span><br /><br /> <td>
<input name="scale_type" type="radio" id="scale_type_up" value="up" <?php echo $scale_type_up; ?> /> <?php echo gettext('Scale up')?>
</td>
</tr>
<tr>
<td>
<input name="scale_type" type="radio" id="scale_type_follow" value="follow" <?php echo $scale_type_follow; ?> /> <?php echo gettext('Scale follow')?><br /><br />
Refresh Interval: Refresh Interval:
<select name="refreshinterval" class="formfld" id="refreshinterval" onchange="updateGraphDisplays();"> <select name="refreshinterval" class="formfld" id="refreshinterval" >
<?php for ($i = 1; $i <= 10; $i += 1) { ?> <?php for ($i = 1; $i <= 10; $i += 1) { ?>
<option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected=\"selected\"";?>><?= $i ?></option> <option value="<?= $i ?>" <?php if ($refreshinterval == $i) echo "selected=\"selected\"";?>><?= $i ?></option>
<?php } ?> <?php } ?>
</select>&nbsp; Seconds<br />&nbsp; &nbsp; &nbsp; <b>Note:</b> changing this setting will increase CPU utilization<br /><br /> </select>&nbsp; Seconds<br />&nbsp; &nbsp; &nbsp; <b>Note:</b> changing this setting will increase CPU utilization<br /><br />
<input id="submit_settings" name="submit_settings" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" /> </td>
</tr>
<tr>
<td>
<input id="submit_settings" name="submit_settings" type="submit" class="formbtn btn btn-primary" value="Save Settings" />
</td>
</tr>
</tbody>
</table>
</form> </form>
</div> </div>
...@@ -162,9 +183,9 @@ foreach ($ifdescrs as $ifname => $ifdescr) { ...@@ -162,9 +183,9 @@ foreach ($ifdescrs as $ifname => $ifdescr) {
</div> </div>
<div align="right" style="float:right;width:49%"> <div align="right" style="float:right;width:49%">
<div id="<?=$ifname;?>graphdiv-min" onclick='return trafficminimizeDiv("<?= $ifname ?>", true);' <div id="<?=$ifname;?>graphdiv-min" onclick='return trafficminimizeDiv("<?= $ifname ?>", true);'
style="display:<?php echo $mingraphbutton;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_minus.gif" alt="Minimize <?=$ifname;?> traffic graph" /></div> style="display:<?php echo $mingraphbutton;?>; cursor:pointer" ><span class="glyphicon glyphicon-minus" alt="Minimize <?=$ifname;?> traffic graph" /></span></div>
<div id="<?=$ifname;?>graphdiv-open" onclick='return trafficshowDiv("<?= $ifname ?>", true);' <div id="<?=$ifname;?>graphdiv-open" onclick='return trafficshowDiv("<?= $ifname ?>", true);'
style="display:<?php echo $showgraphbutton;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_open.gif" alt="Show <?=$ifname;?> traffic graph" /></div> style="display:<?php echo $showgraphbutton;?>; cursor:pointer" ><span class="glyphicon glyphicon-plus" alt="Show <?=$ifname;?> traffic graph" /></span></div>
</div> </div>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment