frontend support for port poe enable/disable

This commit is contained in:
Oliver Gorwits
2012-12-10 21:07:39 +00:00
parent 4dd6080a84
commit 3b90e28843
8 changed files with 100 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
// user clicked or asked for port changes to be submitted via ajax
function port_control (e) {
var td = $(e).closest('.nd_editable_cell');
var td = $(e).closest('td');
$.ajax({
type: 'POST'
@@ -30,6 +30,17 @@ function port_control (e) {
$(e).data('tooltip').options.title = 'Click to Disable';
td.attr('data-action', 'down');
}
else if ($.trim(td.attr('data-action')) == 'false') {
$(e).next('span').text('');
$(e).toggleClass('nd_power_on');
$(e).data('tooltip').options.title = 'Click to Enable';
td.attr('data-action', 'true');
}
else if ($.trim(td.attr('data-action')) == 'true') {
$(e).toggleClass('nd_power_on');
$(e).data('tooltip').options.title = 'Click to Disable';
td.attr('data-action', 'false');
}
}
,error: function() {
toastr.error('Failed to submit change request');