Tidied device setting pages

This commit is contained in:
laf
2014-06-16 23:06:04 +01:00
parent 299da45549
commit 3e570a118e
6 changed files with 223 additions and 244 deletions

View File

@@ -35,33 +35,26 @@ $disable_notify = get_dev_attrib($device,'disable_notify');
<h3>Alert settings</h3> <h3>Alert settings</h3>
<table cellpadding="0" cellspacing="0"> <form id="edit" name="edit" method="post" action="" role="form" class="form-horizontal">
<tr> <input type="hidden" name="editing" value="yes">
<td> <div class="form-group">
<form id="edit" name="edit" method="post" action=""> <label for="override_sysContact" class="col-sm-3 control-label">Override sysContact:</label>
<input type="hidden" name="editing" value="yes"> <div class="col-sm-6">
<table width="500" border="0"> <input onclick="edit.sysContact.disabled=!edit.override_sysContact.checked" type="checkbox" id="override_sysContact" name="override_sysContact"<?php if ($override_sysContact_bool) { echo(' checked="1"'); } ?> />
<tr> </div>
<td width="50"><div style="padding-right: 5px; text-align: right"><input onclick="edit.sysContact.disabled=!edit.override_sysContact.checked" type="checkbox" name="override_sysContact"<?php if ($override_sysContact_bool) { echo(' checked="1"'); } ?> /></div></td> </div>
<td width="150">Override sysContact:</td> <div class="form-group">
<td><input name="sysContact" size="32"<?php if (!$override_sysContact_bool) { echo(' disabled="1"'); } ?> value="<?php echo($override_sysContact_string); ?>" /></td> <div class="col-sm-3">
</tr> </div>
<tr> <div class="col-sm-6">
<td width="50"><div style="padding-right: 5px; text-align: right"><input type="checkbox" name="disable_notify"<?php if ($disable_notify) { echo(' checked="1"'); } ?> /></div></td> <input id="sysContact" class="form-control" name="sysContact" size="32"<?php if (!$override_sysContact_bool) { echo(' disabled="1"'); } ?> value="<?php echo($override_sysContact_string); ?>" />
<td colspan="2">Disable all alerting for this host</td> </div>
</tr> </div>
<tr> <div class="form-group">
<td></td> <label for="disable_notify" class="col-sm-3 control-label">Disable all alerting for this host: </label>
<td> <div class="col-sm-6">
<br /> <input id="disable_notify" type="checkbox" name="disable_notify"<?php if ($disable_notify) { echo(' checked="1"'); } ?> />
<input type="submit" name="Submit" value="Save" /> </div>
</td> </div>
</tr> <button class="btn btn-default btn-sm" type="submit" name="Submit">Save</button>
</table> </form>
<br />
</form>
</td>
<td width="50"></td>
<td></td>
</tr>
</table>

View File

@@ -69,13 +69,14 @@ if (count($apps_enabled))
} }
} }
echo("<div style='float: left; width: 100%'> echo("<div class='row'>
<form id='appedit' name='appedit' method='post' action=''> <div class='col-md-4'>
<form id='appedit' name='appedit' method='post' action='' role='form' class='form-horizontal'>
<input type=hidden name=device value='".$device['device_id']."'> <input type=hidden name=device value='".$device['device_id']."'>
<table cellpadding=3 cellspacing=0 width=100%> <table class='table table-condensed table-striped table-responsive'>
<tr align=center> <tr align=center>
<th width=100>Enable</th> <th>Enable</th>
<th align=left>Application</th> <th>Application</th>
</tr> </tr>
"); ");
@@ -86,19 +87,20 @@ foreach ($applications as $app)
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo(" <tr bgcolor=$row_colour>"); echo(" <tr bgcolor=$row_colour>");
echo(" <td align=center>"); echo(" <td>");
echo(" <input type=checkbox" . (in_array($app,$app_enabled) ? ' checked="1"' : '') . " name='app_". $app ."'>"); echo(" <input type=checkbox" . (in_array($app,$app_enabled) ? ' checked="1"' : '') . " name='app_". $app ."'>");
echo(" </td>"); echo(" </td>");
echo(" <td align=left>". ucfirst($app) . "</td>"); echo(" <td>". ucfirst($app) . "</td>");
echo(" </tr> echo(" </tr>
"); ");
$row++; $row++;
} }
echo('<tr><td></td><td><input type="submit" value="Save"></td></tr>'); echo('<tr><td></td><td><button type="submit" class="btn btn-default" value="Save">Save</button></td></tr>');
echo('</table>'); echo('</table>');
echo('</form>'); echo('</form>');
echo('</div>'); echo('</div>');
echo('</div>');
?> ?>

View File

@@ -55,29 +55,24 @@ if ($updated && $update_message)
} }
?> ?>
<table cellpadding="0" cellspacing="0">
<tr> <form id="delete_host" name="delete_host" method="post" action="delhost/" role="form">
<td> <input type="hidden" name="id" value="<?php echo($device['device_id']); ?>">
<h5> <button type="submit" class="btn btn-danger" name="Submit">Delete device</button>
<form id="delete_host" name="delete_host" method="post" action="delhost/"> </form>
<img src="images/16/server_delete.png" align="absmiddle"> <br />
<input type="hidden" name="id" value="<?php echo($device['device_id']); ?>"> <form id="edit" name="edit" method="post" action="" role="form" class="form-horizontal">
<input type="submit" class="submit" name="Submit" value="Delete device"> <input type=hidden name="editing" value="yes">
</form> <div class="form-group">
</h5> <label for="descr" class="col-sm-2 control-label">Description:</label>
<form id="edit" name="edit" method="post" action=""> <div class="col-sm-6">
<input type=hidden name="editing" value="yes"> <input id="descr" name="descr" value="<?php echo($device['purpose']); ?>" class="form-control">
<table width="500" border="0"> </div>
<tr> </div>
<td colspan="2" align="right">Description:</td> <div class="form-group">
<td colspan="3"><input name="descr" size="32" value="<?php echo($device['purpose']); ?>"></input></td> <label for="type" class="col-sm-2 control-label">Type:</label>
</tr> <div class="col-sm-6">
<tr> <select id="type" name="type" class="form-control">
<td colspan="2" align="right">
Type:
</td>
<td>
<select name="type">
<?php <?php
$unknown = 1; $unknown = 1;
@@ -96,30 +91,39 @@ foreach ($config['device_types'] as $type)
echo(' <option value="other">Other</option>'); echo(' <option value="other">Other</option>');
} }
?> ?>
</select> </select>
</td> </div>
</tr> </div>
<tr> <div class="form-group">
<td width="40"><div style="padding-right: 5px; text-align: right"><input onclick="edit.sysLocation.disabled=!edit.override_sysLocation.checked" type="checkbox" name="override_sysLocation"<?php if ($override_sysLocation_bool) { echo(' checked="1"'); } ?> /></div></td> <label for="sysLocation" class="col-sm-2 control-label">Override sysLocation:</label>
<td align="right">Override sysLocation:</td> <div class="col-sm-6">
<td colspan="3"><input name="sysLocation" size="32"<?php if (!$override_sysLocation_bool) { echo(' disabled="1"'); } ?> value="<?php echo($override_sysLocation_string); ?>" /></td> <div class="checkbox">
</tr> <input onclick="edit.sysLocation.disabled=!edit.override_sysLocation.checked" type="checkbox" name="override_sysLocation"<?php if ($override_sysLocation_bool) { echo(' checked="1"'); } ?> />
<tr> </div>
<td colspan="2"><div align="right">Disable</div></td> </div>
<td><input name="disabled" type="checkbox" id="disabled" value="1" <?php if ($device["disabled"]) { echo("checked=checked"); } ?> /></td> </div>
<td><div align="right">Ignore</div></td> <div class="form-group">
<td><input name="ignore" type="checkbox" id="disable" value="1" <?php if ($device['ignore']) { echo("checked=checked"); } ?> />&nbsp;</td> <div class="col-sm-2">
</tr> </div>
</table> <div class="col-sm-6">
<input type="submit" name="Submit" value="Save" /> <input id="sysLocation" name="sysLocation" class="form-control" <?php if (!$override_sysLocation_bool) { echo(' disabled="1"'); } ?> value="<?php echo($override_sysLocation_string); ?>" />
<label><br /> </div>
</label> </div>
</form> <div class="form-group">
</td> <label for="disabled" class="col-sm-2 control-label">Disable:</label>
</tr> <div class="col-sm-6">
</table> <input name="disabled" type="checkbox" id="disabled" value="1" <?php if ($device["disabled"]) { echo("checked=checked"); } ?> />
</div>
</div>
<div class="form-group">
<label for="ignore" class="col-sm-2 control-label">Ignore</label>
<div class="col-sm-6">
<input name="ignore" type="checkbox" id="ignore" value="1" <?php if ($device['ignore']) { echo("checked=checked"); } ?> />
</div>
</div>
<button type="submit" name="Submit" class="btn btn-default">Save</button>
</form>
<br /> <br />
<?php <?php
print_optionbar_start(); print_optionbar_start();

View File

@@ -32,43 +32,26 @@ if ($updated && $update_message)
<h3>IPMI settings</h3> <h3>IPMI settings</h3>
<table cellpadding="0" cellspacing="0"> <form id="edit" name="edit" method="post" action="" role="form" class="form-horizontal">
<tr> <input type="hidden" name="editing" value="yes">
<td> <div class="form-group">
<form id="edit" name="edit" method="post" action=""> <label for="ipmi_hostname" class="col-sm-2 control-label">IPMI/BMC Hostname</label>
<input type="hidden" name="editing" value="yes"> <div class="col-sm-6">
<table width="500" border="0"> <input id="ipmi_hostname" name="ipmi_hostname" class="form-control" value="<?php echo(get_dev_attrib($device,'ipmi_hostname')); ?>" />
<tr> </div>
<td width="150"><div align="right">IPMI/BMC Hostname</div></td> </div>
<td colspan="3"><input name="ipmi_hostname" size="32" value="<?php echo(get_dev_attrib($device,'ipmi_hostname')); ?>" /></td> <div class="form-group">
</tr> <label for="ipmi_username" class="col-sm-2 control-label">IPMI/BMC Username</label>
<tr> <div class="col-sm-6">
<td><div align="right">IPMI/BMC Username</div></td> <input id="ipmi_username" name="ipmi_username" class="form-control" value="<?php echo(get_dev_attrib($device,'ipmi_username')); ?>" />
<td colspan="3"><input name="ipmi_username" size="32" value="<?php echo(get_dev_attrib($device,'ipmi_username')); ?>" /></td> </div>
</td> </div>
</tr> <div class="form-group">
<tr> <label for="impi_password" class="col-sm-2 control-label">IPMI/BMC Password</label>
<td><div align="right">IPMI/BMC Password</div></td> <div class="col-sm-6">
<td colspan="3"><input name="ipmi_password" type="password" size="32" value="<?php echo(get_dev_attrib($device,'ipmi_password')); ?>" /></td> <input id="ipmi_password" name="ipmi_password" type="password" class="form-control" value="<?php echo(get_dev_attrib($device,'ipmi_password')); ?>" />
</td> </div>
</tr> </div>
<tr> <button class="btn btn-default btn-sm" type="submit" name="Submit">Save</button>
<td></td> </form>
<td colspan="3"> <p>To disable IPMI polling, please clear the setting fields and click <b>Save</b>.</p>
<br />
<input type="submit" name="Submit" value="Save" />
</td>
</tr>
<tr>
<td colspan="4">
To disable IPMI polling, please clear the setting fields and click <b>Save</b>.
</td>
</tr>
</table>
<br />
</form>
</td>
<td width="50"></td>
<td></td>
</tr>
</table>

View File

@@ -18,53 +18,52 @@ if ($updated && $update_message)
} }
echo("<div style='float: left; width: 100%'> echo("<div style='float: left; width: 100%'>
<form id='ignoreport' name='ignoreport' method='post' action=''> <form id='ignoreport' name='ignoreport' method='post' action='' role='form' class='form-inline'>
<input type=hidden name='ignoreport' value='yes'> <input type=hidden name='ignoreport' value='yes'>
<input type=hidden name=device value='".$device['device_id']."'>"); <input type=hidden name=device value='".$device['device_id']."'>");
echo("<table cellpadding=3 cellspacing=0 width=100%> echo("<table cellpadding=3 cellspacing=0 class='table table-condensed table-responsive'>
<tr align=center> <tr align=center>
<th width=100>Index</th> <th>Index</th>
<th width=100>Name</th> <th>Name</th>
<th width=50>Admin</th> <th>Admin</th>
<th width=150>Oper</th> <th>Oper</th>
<th width=150>Disable</th> <th>Disable</th>
<th width=150>Ignore</th> <th>Ignore</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr align=center> <tr align=center>
<td><input type='submit' value='Save' title='Save current port disable/ignore settings'/><input type='submit' value='Reset' id='form-reset' title='Reset form to previously-saved settings'/></td> <td><button type='submit' value='Save' class='btn btn-success btn-sm' title='Save current port disable/ignore settings'/>Save</button><button type='submit' value='Reset' class='btn btn-danger btn-sm' id='form-reset' title='Reset form to previously-saved settings'/>Reset</button></td>
<td></td> <td></td>
<td></td> <td></td>
<td><input type='submit' value='Alerted' id='alerted-toggle' title='Toggle alerting on all currently-alerted ports'/><input type='submit' value='Down' id='down-select' title='Disable alerting on all currently-down ports'/></td> <td><button type='submit' value='Alerted' class='btn btn-default btn-sm' id='alerted-toggle' title='Toggle alerting on all currently-alerted ports'/>Alerted</button><button type='submit' value='Down' class='btn btn-default btn-sm' id='down-select' title='Disable alerting on all currently-down ports'/>Down</button></td>
<td><input type='submit' value='Toggle' id='disable-toggle' title='Toggle polling for all ports'/><input type='submit' value='Select' id='disable-select' title='Disable polling on all ports'/></td> <td><button type='submit' value='Toggle' class='btn btn-default btn-sm' id='disable-toggle' title='Toggle polling for all ports'/>Toggle</button><button type='submit' value='Select' class='btn btn-default btn-sm' id='disable-select' title='Disable polling on all ports'/>Select</button></td>
<td><input type='submit' value='Toggle' id='ignore-toggle' title='Toggle alerting for all ports'/><input type='submit' value='Select' id='ignore-select' title='Disable alerting on all ports'/></td> <td><button type='submit' value='Toggle' class='btn btn-default btn-sm' id='ignore-toggle' title='Toggle alerting for all ports'/>Toggle</button><button type='submit' value='Select' class='btn btn-default btn-sm' id='ignore-select' title='Disable alerting on all ports'/>Select</button></td>
<td></td> <td></td>
</tr> </tr>
"); ");
?> ?>
<script> <script>
$(document).ready(function() {
$('#disable-toggle').click(function(event) { $('#disable-toggle').click(function(event) {
// invert selection on all disable buttons // invert selection on all disable buttons
event.preventDefault(); event.preventDefault();
$('[name^="disabled_"]').check('toggle'); $('input[name^="disabled_"]').trigger('click');
}); });
$('#ignore-toggle').click(function(event) { $('#ignore-toggle').click(function(event) {
// invert selection on all ignore buttons // invert selection on all ignore buttons
event.preventDefault(); event.preventDefault();
$('[name^="ignore_"]').check('toggle'); $('input[name^="ignore_"]').trigger('click');
}); });
$('#disable-select').click(function(event) { $('#disable-select').click(function(event) {
// select all disable buttons // select all disable buttons
event.preventDefault(); event.preventDefault();
$('[name^="disabled_"]').check(); $('.disable-check').prop('checked',true);
}); });
$('#ignore-select').click(function(event) { $('#ignore-select').click(function(event) {
// select all ignore buttons // select all ignore buttons
event.preventDefault(); event.preventDefault();
$('[name^="ignore_"]').check(); $('.ignore-check').prop('checked',true);
}); });
$('#down-select').click(function(event) { $('#down-select').click(function(event) {
// select ignore buttons for all ports which are down // select ignore buttons for all ports which are down
@@ -76,7 +75,7 @@ $(document).ready(function() {
// get the interface number from the object name // get the interface number from the object name
var port_id = name.split('_')[1]; var port_id = name.split('_')[1];
// find its corresponding checkbox and toggle it // find its corresponding checkbox and toggle it
$('[name="ignore_' + port_id + '"]').check(); $('input[name="ignore_' + port_id + '"]').trigger('click');
} }
}); });
}); });
@@ -89,7 +88,7 @@ $(document).ready(function() {
// get the interface number from the object name // get the interface number from the object name
var port_id = name.split('_')[1]; var port_id = name.split('_')[1];
// find its corresponding checkbox and toggle it // find its corresponding checkbox and toggle it
$('[name="ignore_' + port_id + '"]').check('toggle'); $('input[name="ignore_' + port_id + '"]').trigger('click');
} }
}); });
}); });
@@ -98,7 +97,6 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
$('#ignoreport')[0].reset(); $('#ignoreport')[0].reset();
}); });
});
</script> </script>
<?php <?php
@@ -125,12 +123,12 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? ORDER BY `ifIn
echo("<td align=right><span name='operstatus_".$port['port_id']."'".$outofsync.">". $port['ifOperStatus']."</span></td>"); echo("<td align=right><span name='operstatus_".$port['port_id']."'".$outofsync.">". $port['ifOperStatus']."</span></td>");
echo("<td align=center>"); echo("<td align=center>");
echo("<input type=checkbox name='disabled_".$port['port_id']."'".($port['disabled'] ? 'checked' : '').">"); echo("<input type=checkbox class='disable-check' name='disabled_".$port['port_id']."'".($port['disabled'] ? 'checked' : '').">");
echo("<input type=hidden name='olddis_".$port['port_id']."' value=".($port['disabled'] ? 1 : 0).">"); echo("<input type=hidden name='olddis_".$port['port_id']."' value=".($port['disabled'] ? 1 : 0).">");
echo("</td>"); echo("</td>");
echo("<td align=center>"); echo("<td align=center>");
echo("<input type=checkbox name='ignore_".$port['port_id']."'".($port['ignore'] ? 'checked' : '').">"); echo("<input type=checkbox class='ignore-check' name='ignore_".$port['port_id']."'".($port['ignore'] ? 'checked' : '').">");
echo("<input type=hidden name='oldign_".$port['port_id']."' value=".($port['ignore'] ? 1 : 0).">"); echo("<input type=hidden name='oldign_".$port['port_id']."' value=".($port['ignore'] ? 1 : 0).">");
echo("</td>"); echo("</td>");
echo("<td align=left>".$port['ifAlias'] . "</td>"); echo("<td align=left>".$port['ifAlias'] . "</td>");

View File

@@ -6,6 +6,7 @@ if ($_POST['editing'])
{ {
$community = mres($_POST['community']); $community = mres($_POST['community']);
$snmpver = mres($_POST['snmpver']); $snmpver = mres($_POST['snmpver']);
$transport = mres($_POST['transport']);
$port = mres($_POST['port']); $port = mres($_POST['port']);
$timeout = mres($_POST['timeout']); $timeout = mres($_POST['timeout']);
$retries = mres($_POST['retries']); $retries = mres($_POST['retries']);
@@ -22,7 +23,8 @@ if ($_POST['editing'])
$update = array( $update = array(
'community' => $community, 'community' => $community,
'snmpver' => $snmpver, 'snmpver' => $snmpver,
'port' => $port 'port' => $port,
'transport' => $transport
); );
if ($_POST['timeout']) { $update['timeout'] = $timeout; } if ($_POST['timeout']) { $update['timeout'] = $timeout; }
@@ -58,85 +60,84 @@ if ($updated && $update_message)
print_error($update_message); print_error($update_message);
} }
echo("<br /><table cellpadding=0 cellspacing=0><tr><td> echo("
<form id='edit' name='edit' method='post' action='' role='form' class='form-horizontal'>
<form id='edit' name='edit' method='post' action=''>
<input type=hidden name='editing' value='yes'> <input type=hidden name='editing' value='yes'>
<table width='500' border='0'> <div class='form-group'>
<tr> <label for='snmpver' class='col-sm-2 control-label'>SNMP Version</label>
<td><div align=right>SNMP Version</div></td> <div class='col-sm-6'>
<td> <select id='snmpver' name='snmpver' class='form-control'>
<select name='snmpver'> <option value='v1'>v1</option>
<option value='v1'>v1</option> <option value='v2c' " . ($device['snmpver'] == 'v2c' ? 'selected' : '') . ">v2c</option>
<option value='v2c' " . ($device['snmpver'] == 'v2c' ? 'selected' : '') . ">v2c</option> <option value='v3' " . ($device['snmpver'] == 'v3' ? 'selected' : '') . ">v3</option>
<option value='v3' " . ($device['snmpver'] == 'v3' ? 'selected' : '') . ">v3</option> </select>
</select> </div>
</td>
</tr>
<div id='snmpv12'>
<!-- To be able to hide it -->
<tr>
<td colspan='2'><strong>SNMPv1/v2c Configuration</strong></td>
</tr>
<tr>
<td width='150'><div align='right'>SNMP Community</div></td>
<td><input name='community' size='32' value='" . $device['community'] . "' />
</td>
</tr>
</div> </div>
<div id='snmpv3'> <div class='form-group'>
<!-- To be able to hide it --> <label class='col-sm-3 control-label text-left'><h4><strong>SNMPv1/v2c Configuration</strong></h4></label>
<tr> </div>
<td colspan='2'><strong>SNMPv3 Configuration</strong></td> <div class='form-group'>
</tr> <label for='community' class='col-sm-2 control-label'>SNMP Community</label>
<tr> <div class='col-sm-6'>
<td width='150'><div align='right'>Auth Level</div></td> <input id='community' class='form-control' name='community' value='" . $device['community'] . "' />
<td> </div>
<select name='authlevel'> </div>
<div class='form-group'>
<label class='col-sm-3 control-label'><h4><strong>SNMPv3 Configuration</strong></h4></label>
</div>
<div class='form-group'>
<label for='authlevel' class='col-sm-2 control-label'>Auth Level</label>
<div class='col-sm-6'>
<select id='authlevel' name='authlevel' class='form-control'>
<option value='NoAuthNoPriv'>NoAuthNoPriv</option> <option value='NoAuthNoPriv'>NoAuthNoPriv</option>
<option value='AuthNoPriv' " . ($device['authlevel'] == "authNoPriv" ? 'selected' : '') . ">AuthNoPriv</option> <option value='AuthNoPriv' " . ($device['authlevel'] == "authNoPriv" ? 'selected' : '') . ">AuthNoPriv</option>
<option value='AuthPriv' " . ($device['authlevel'] == "authPriv" ? 'selected' : '') . ">AuthPriv</option> <option value='AuthPriv' " . ($device['authlevel'] == "authPriv" ? 'selected' : '') . ">AuthPriv</option>
</select> </select>
</td> </div>
</tr>
<tr>
<td width='150'><div align='right'>Auth User Name</div></td>
<td><input type='text' name='authname' size='32' value='" . $device['authname'] . "'></td>
</tr>
<tr>
<td width='150'><div align='right'>Auth Password</div></td>
<td><input type='text' name='authpass' size='32' value='" . $device['authpass'] . "'></td>
</tr>
<tr>
<td width='150'><div align='right'>Auth Algorithm</strong></td>
<td>
<select name='authalgo'>
<option value='MD5'>MD5</option>
<option value='SHA' " . ($device['authalgo'] === "SHA" ? 'selected' : '') . ">SHA</option>
</select>
</td>
</tr>
<tr>
<td width='150'><div align='right'>Crypto Password</div></td>
<td><input type='text' name='cryptopass' size='32' value='" . $device['cryptopass'] . "'></td>
</tr>
<tr>
<td width='150'><div align='right'>Crypto Algorithm</div></td>
<td>
<select name='cryptoalgo'>
<option value='AES'>AES</option>
<option value='DES' " . ($device['cryptoalgo'] === "DES" ? 'selected' : '') . ">DES</option>
</select>
</td>
</tr>
</div> </div>
<tr> <div class='form-group'>
<td colspan='2'><strong>SNMP Connectivity</strong></td> <label for='authname' class='col-sm-2 control-label'>Auth User Name</label>
</tr> <div class='col-sm-6'>
<tr> <input type='text' id='authname' name='authname' class='form-control' value='" . $device['authname'] . "'>
<td><div align='right'>SNMP Transport</div></td> </div>
<td> </div>
<select name='transport'>"); <div class='form-group'>
<label for='authpass' class='col-sm-2 control-label'>Auth Password</label>
<div class='col-sm-6'>
<input type='text' id='authpass' name='authpass' class='form-control' value='" . $device['authpass'] . "'>
</div>
</div>
<div class='form-group'>
<label for='authalgo' class='col-sm-2 control-label'>Auth Algorithm</label>
<div class='col-sm-6'>
<select id='authalgo' name='authalgo' class='form-control'>
<option value='MD5'>MD5</option>
<option value='SHA' " . ($device['authalgo'] === "SHA" ? 'selected' : '') . ">SHA</option>
</select>
</div>
</div>
<div class='form-group'>
<label for='cryptopass' class='col-sm-2 control-label'>Crypto Password</label>
<div class='col-sm-6'>
<input type='text' id='cryptopass' name='cryptopass' class='form-control' value='" . $device['cryptopass'] . "'>
</div>
</div>
<div class='form-group'>
<label for='cryptoalgo' class='col-sm-2 control-label'>Crypto Algorithm</label>
<div class='col-sm-6'>
<select id='cryptoalgo' name='cryptoalgo' class='form-control'>
<option value='AES'>AES</option>
<option value='DES' " . ($device['cryptoalgo'] === "DES" ? 'selected' : '') . ">DES</option>
</select>
</div>
</div>
<div class='form-group'>
<label class='col-sm-3 control-label'><h4><strong>SNMP Connectivity</strong></h4></label>
</div>
<div class='form-group'>
<label for='transport' class='col-sm-2 control-label'>SNMP Transport</label>
<div class='col-sm-6'>
<select id='transport' name='transport' class='form-control'>");
foreach ($config['snmp']['transports'] as $transport) foreach ($config['snmp']['transports'] as $transport)
{ {
@@ -146,33 +147,31 @@ foreach ($config['snmp']['transports'] as $transport)
} }
echo(" </select> echo(" </select>
</td> </div>
</tr> </div>
<tr> <div class='form-group'>
<td><div align='right'>SNMP Port</div></td> <label for='port' class='col-sm-2 control-label'>SNMP Port</label>
<td><input name='port' size='32' value='" . $device['port'] . "' /> <div class='col-sm-6'>
</td> <input id='port' name='port' class='form-control' value='" . $device['port'] . "' />
</tr> </div>
<tr> </div>
<td><div align='right'>SNMP Timeout</div></td> <div class='form-group'>
<td><input name='timeout' size='32' value='" . ($device['timeout'] ? $device['timeout'] : '') . "' />&nbsp; <label for='timeout' class='col-sm-2 control-label'>SNMP Timeout</label>
<em>(milli)seconds</em> <div class='col-sm-6'>
</td> <input id='timeout' name='timeout' class='form-control' value='" . ($device['timeout'] ? $device['timeout'] : '') . "' /> <em>(milli)seconds</em>
</tr> </div>
<tr> </div>
<td><div align='right'>SNMP Retries</div></td> <div class='form-group'>
<td colspan='3'><input name='retries' size='32' value='" . ($device['timeout'] ? $device['retries'] : '') . "' /> <label for='retries' class='col-sm-2 control-label'>SNMP Retries</label>
</td> <div class='col-sm-6'>
</tr>"); <input id='retries' name='retries' class='form-control' value='" . ($device['timeout'] ? $device['retries'] : '') . "' />
</div>
</div>");
echo(' echo('
</table> <button type="submit" name="Submit" class="btn btn-default">Save</button>
<input type="submit" name="Submit" value="Save" />
<label><br />
</label>
</form> </form>
</td> ');
<td width="50"></td><td></td></tr></table>');
?> ?>