From: Vsevolod Stakhov Date: Tue, 10 Jan 2017 17:40:49 +0000 (+0000) Subject: [WebUI] Fix disabled state X-Git-Tag: 1.5.0~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaa6f90b5da7c899d3170b3c18d436fbd35961b2;p=thirdparty%2Frspamd.git [WebUI] Fix disabled state --- diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 2421e7cbe3..c414ccbf19 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -351,7 +351,12 @@ $("#clusterTable tbody").empty(); $.each(servers, function (key, val) { var glyph_status; - if (val.status) {glyph_status = "glyphicon glyphicon-ok-circle"} else {glyph_status = "glyphicon glyphicon-remove-circle"} + if (val.status) { + glyph_status = "glyphicon glyphicon-ok-circle"; + } + else { + glyph_status = "glyphicon glyphicon-remove-circle"; + } if (checked_server == key) { $('#clusterTable tbody').append('' + '' + @@ -360,12 +365,22 @@ '' + '' + val.data.config_id.substring(0, 8) + ''); } else { - $('#clusterTable tbody').append('' + - '' + - '' + key + '' + - '' + val.host + '' + - '' + - '' + val.data.config_id.substring(0, 8) + ''); + if (val.status) { + $('#clusterTable tbody').append('' + + '' + + '' + key + '' + + '' + val.host + '' + + '' + + '' + val.data.config_id.substring(0, 8) + ''); + } + else { + $('#clusterTable tbody').append('' + + '' + + '' + key + '' + + '' + val.host + '' + + '' + + '???'); + } } }); @@ -498,9 +513,11 @@ } $(document).on('click', 'input:radio[name="clusterName"]', function (e) { - checked_server = this.value; - statWidgets(); - getChart(); + if (!this.disabled) { + checked_server = this.value; + statWidgets(); + getChart(); + } }); // @opem modal with target form enabled