Added support for per device unix-agent port

This commit is contained in:
laf
2015-11-17 00:20:06 +00:00
parent d59e268d51
commit af8df3469c
6 changed files with 64 additions and 4 deletions

View File

@@ -25,6 +25,32 @@ $(document).ready(function() {
});
});
// Device override for text inputs
$(document).on('blur', 'input[name="override_config_text"]', function(event) {
event.preventDefault();
var $this = $(this);
var attrib = $this.data('attrib');
var device_id = $this.data('device_id');
var value = $this.val();
$.ajax({
type: 'POST',
url: 'ajax_form.php',
data: { type: 'override-config', device_id: device_id, attrib: attrib, state: value },
dataType: 'json',
success: function(data) {
if (data.status == 'ok') {
toastr.success(data.message);
}
else {
toastr.error(data.message);
}
},
error: function() {
toastr.error('Could not set this override');
}
});
});
// Checkbox config ajax calls
$("[name='global-config-check']").bootstrapSwitch('offColor','danger');
$('input[name="global-config-check"]').on('switchChange.bootstrapSwitch', function(event, state) {