mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix port speed setting feedback (#14743)
This commit is contained in:
@@ -80,7 +80,7 @@ class EditPortsController extends TableController
|
||||
<input type="hidden" name="oldign_' . $port->port_id . '" value="' . ($port->ignore ? 1 : 0) . '"">',
|
||||
'port_tune' => '<input type="checkbox" name="override_config" data-attrib="ifName_tune:' . $port->ifName . '" data-device_id="' . $port->device_id . '" data-size="small" ' . $tune . '>',
|
||||
'ifAlias' => '<div class="form-group"><input class="form-control input-sm" name="if-alias" data-device_id="' . $port->device_id . '" data-port_id="' . $port->port_id . '" data-ifName="' . $port->ifName . '" value="' . $port->ifAlias . '"><span class="form-control-feedback"><i class="fa" aria-hidden="true"></i></span></div>',
|
||||
'ifSpeed' => '<div class="form-group has-feedback"><input type="text" pattern="[0-9]*" inputmode="numeric" class="form-control input-sm" name="if-speed" data-device_id="' . $port->device_id . '" data-port_id="' . $port->port_id . '" data-ifName="' . $port->ifName . '" value="' . $port->ifSpeed . '"><span class="form-control-feedback"><i class="fa" aria-hidden="true"></i></span></div>',
|
||||
'ifSpeed' => '<div class="form-group has-feedback"><input type="text" pattern="[0-9]*" inputmode="numeric" class="form-control input-sm" name="if-speed" data-device_id="' . $port->device_id . '" data-port_id="' . $port->port_id . '" data-ifName="' . $port->ifName . '" value="' . $port->ifSpeed . '"><span class="form-control-feedback"><i class="fas" aria-hidden="true"></i></span></div>',
|
||||
'portGroup' => '<div class="form-group has-feedback"><select class="input-sm port_group_select" name="port_group_' . $port->port_id . '[]" data-port_id="' . $port->port_id . '" multiple>' . $port_group_options . '</select></div>',
|
||||
];
|
||||
}
|
||||
|
@@ -81,29 +81,29 @@
|
||||
success: function (data) {
|
||||
if (data.status == 'ok') {
|
||||
$this.closest('.form-group').addClass('has-success');
|
||||
$this.next().addClass('fa-check');
|
||||
$this.next().children().first().addClass('fa-check');
|
||||
$this.val(speed);
|
||||
setTimeout(function(){
|
||||
$this.closest('.form-group').removeClass('has-success');
|
||||
$this.next().removeClass('fa-check');
|
||||
$this.next().children().first().removeClass('fa-check');
|
||||
}, 2000);
|
||||
} else if (data.status == 'na') {
|
||||
|
||||
} else {
|
||||
$(this).closest('.form-group').addClass('has-error');
|
||||
$this.next().addClass('fa-times');
|
||||
$this.next().children().first().addClass('fa-times');
|
||||
setTimeout(function(){
|
||||
$this.closest('.form-group').removeClass('has-error');
|
||||
$this.next().removeClass('fa-times');
|
||||
$this.next().children().first().removeClass('fa-times');
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
$(this).closest('.form-group').addClass('has-error');
|
||||
$this.next().addClass('fa-times');
|
||||
$this.next().children().first().addClass('fa-times');
|
||||
setTimeout(function(){
|
||||
$this.closest('.form-group').removeClass('has-error');
|
||||
$this.next().removeClass('fa-times');
|
||||
$this.next().children().first().removeClass('fa-times');
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user