mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates as per comments from murrant
This commit is contained in:
@@ -71,7 +71,7 @@ foreach (dbFetchRows($sql, $param) as $port) {
|
||||
<input type="hidden" name="oldign_'.$port['port_id'].'" value="'.($port['ignore'] ? 1 : 0).'"">',
|
||||
'port_tune' => '<input type="checkbox" id="override_config" name="override_config" data-attrib="ifName_tune:'.$port['ifName'].'" data-device_id="'.$port['device_id'].'" data-size="small" '.$checked.'>',
|
||||
'ifAlias' => '<div class="form-group"><input class="form-control input-sm" id="if-alias" name="if-alias" data-device_id="'.$port['device_id'].'" data-port_id="'.$port['port_id'].'" data-ifName="'.$port['ifName'].'" value="'.$port['ifAlias'].'"><span class="glyphicon form-control-feedback" aria-hidden="true"></span></div>',
|
||||
'ifSpeed' => '<div class="form-group"><input class="form-control input-sm" id="if-speed" name="if-speed" data-device_id="'.$port['device_id'].'" data-port_id="'.$port['port_id'].'" data-ifName="'.$port['ifName'].'" value="'.$port['ifSpeed'].'"><span class="glyphicon form-control-feedback" aria-hidden="true"></span></div>',
|
||||
'ifSpeed' => '<div class="form-group has-feedback"><input type="text" pattern="[0-9]*" inputmode="numeric" class="form-control input-sm" id="if-speed" name="if-speed" data-device_id="'.$port['device_id'].'" data-port_id="'.$port['port_id'].'" data-ifName="'.$port['ifName'].'" value="'.$port['ifSpeed'].'"><span class="glyphicon form-control-feedback" aria-hidden="true"></span></div>',
|
||||
);
|
||||
|
||||
}//end foreach
|
||||
|
@@ -16,7 +16,7 @@
|
||||
<th data-column-id='ifOperStatus'>Oper</th>
|
||||
<th data-column-id='disabled' data-sortable='false'>Disable</th>
|
||||
<th data-column-id='ignore' data-sortable='false'>Ignore</th>
|
||||
<th data-column-id='ifSpeed'>ifSpeed</th>
|
||||
<th data-column-id='ifSpeed'>ifSpeed (bits/s)</th>
|
||||
<th data-column-id='port_tune' data-sortable='false' data-searchable='false'>RRD Tune</th>
|
||||
<th data-column-id='ifAlias'>Description</th>
|
||||
</tr>
|
||||
@@ -67,7 +67,8 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).on('blur', "[name='if-speed']", function (){
|
||||
$(document).on('blur keyup', "[name='if-speed']", function (e){
|
||||
if (e.type === 'keyup' && e.keyCode !== 13) return;
|
||||
var $this = $(this);
|
||||
var speed = $this.val();
|
||||
var device_id = $this.data('device_id');
|
||||
@@ -82,6 +83,8 @@
|
||||
if (data.status == 'ok') {
|
||||
$this.closest('.form-group').addClass('has-success');
|
||||
$this.next().addClass('glyphicon-ok');
|
||||
var new_val = speed.text().replace(/[^0-9]/gi, '');
|
||||
$this.val(new_val);
|
||||
setTimeout(function(){
|
||||
$this.closest('.form-group').removeClass('has-success');
|
||||
$this.next().removeClass('glyphicon-ok');
|
||||
|
Reference in New Issue
Block a user