|
@@ -96,7 +96,7 @@ function fadeIn(el, display){
|
|
|
|
|
|
function formValidation(){
|
|
function formValidation(){
|
|
$('validation-box').innerHTML = '';
|
|
$('validation-box').innerHTML = '';
|
|
- var read_community,write_community,managerIP,managerIP2,managerIP3,managerIP4,managerIP5,
|
|
|
|
|
|
+ var read_community,write_community,managerIP,managerIP2,managerIP3,managerIP4,managerIP5, rs_server, rs_port, rs_key,
|
|
ipaddr, gw, mask, tn_port, syslog_port, syslog_server, wtl_ip1, wtl_ip2, wtl_ip3, wtl_ip4, wtl_ip5, ups_cell_min, ups_cell_max/*, ntpservip*/;
|
|
ipaddr, gw, mask, tn_port, syslog_port, syslog_server, wtl_ip1, wtl_ip2, wtl_ip3, wtl_ip4, wtl_ip5, ups_cell_min, ups_cell_max/*, ntpservip*/;
|
|
|
|
|
|
read_community = $('read_community');
|
|
read_community = $('read_community');
|
|
@@ -113,6 +113,9 @@ function formValidation(){
|
|
syslog_port = $('syslog_port');
|
|
syslog_port = $('syslog_port');
|
|
syslog_server = $('syslog_server');
|
|
syslog_server = $('syslog_server');
|
|
// ssh_port = $('ssh_port');
|
|
// ssh_port = $('ssh_port');
|
|
|
|
+ rs_server = $('rs_server');
|
|
|
|
+ rs_port = $('rs_port');
|
|
|
|
+ rs_key = $('rs_key');
|
|
wtl_ip1 = $('wtl_ip1');
|
|
wtl_ip1 = $('wtl_ip1');
|
|
wtl_ip2 = $('wtl_ip2');
|
|
wtl_ip2 = $('wtl_ip2');
|
|
wtl_ip3 = $('wtl_ip3');
|
|
wtl_ip3 = $('wtl_ip3');
|
|
@@ -148,6 +151,11 @@ function formValidation(){
|
|
// flag = false;
|
|
// flag = false;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
+ if ($('rs_enabled').checked) {
|
|
|
|
+ if(!ValidateIPaddress(rs_server, ' IP-адрес RADIUS сервера')) flag = false;
|
|
|
|
+ if(!ValidateNumber(rs_port, ' Порт RADIUS сервера')) flag = false;
|
|
|
|
+ if(!ValidateAlphanumeric(rs_key, ' Код атрибута access RADIUS сервера')) flag = false;
|
|
|
|
+ }
|
|
if(ups_cell_min > ups_cell_max) {
|
|
if(ups_cell_min > ups_cell_max) {
|
|
var warn = document.createElement('li');
|
|
var warn = document.createElement('li');
|
|
warn.innerHTML = 'Минимальное напряжение на ячейке не может быть больше максимального!';
|
|
warn.innerHTML = 'Минимальное напряжение на ячейке не может быть больше максимального!';
|
|
@@ -414,6 +422,31 @@ function syslogState() {
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+function radiusState() {
|
|
|
|
+ if (!$('rs_enabled').checked) {
|
|
|
|
+ $('rs_server').setAttribute('disabled', 'disabled');
|
|
|
|
+ $('rs_port').setAttribute('disabled', 'disabled');
|
|
|
|
+ $('rs_pwd').setAttribute('disabled', 'disabled');
|
|
|
|
+ $('rs_key').setAttribute('disabled', 'disabled');
|
|
|
|
+ } else {
|
|
|
|
+ $('rs_server').removeAttribute('disabled');
|
|
|
|
+ $('rs_port').removeAttribute('disabled');
|
|
|
|
+ $('rs_pwd').removeAttribute('disabled');
|
|
|
|
+ $('rs_key').removeAttribute('disabled');
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function authState() {
|
|
|
|
+ if (!$('swauth').checked) {
|
|
|
|
+ $('rs_enabled').setAttribute('disabled', 'disabled');
|
|
|
|
+ $('rs_enabled').checked = false;
|
|
|
|
+ } else {
|
|
|
|
+ $('rs_enabled').removeAttribute('disabled');
|
|
|
|
+ // $('rs_enabled').checked = true;
|
|
|
|
+ }
|
|
|
|
+ radiusState();
|
|
|
|
+}
|
|
|
|
+
|
|
//########## Info Form Validation ############
|
|
//########## Info Form Validation ############
|
|
|
|
|
|
function infoValidation(){
|
|
function infoValidation(){
|
|
@@ -946,6 +979,13 @@ function settingsGET(){
|
|
mainvolt_in_hist = new SpinBox('mainvolt_in_hist', {
|
|
mainvolt_in_hist = new SpinBox('mainvolt_in_hist', {
|
|
'name':'mainvolt_in_hist','minimum':10,'maximum':30,'step':1, 'value': data.mainvolt_in_hist
|
|
'name':'mainvolt_in_hist','minimum':10,'maximum':30,'step':1, 'value': data.mainvolt_in_hist
|
|
});
|
|
});
|
|
|
|
+ // RADIUS params
|
|
|
|
+ $('rs_server').value = data.rs_server;
|
|
|
|
+ $('rs_port').value = data.rs_port;
|
|
|
|
+ $('rs_pwd').value = data.rs_pwd;
|
|
|
|
+ $('rs_key').value = data.rs_key;
|
|
|
|
+ $('rs_enabled').checked = data.rs_enabled;
|
|
|
|
+ $('swauth').checked = data.swauth;
|
|
// Whitelist
|
|
// Whitelist
|
|
$('wtl_ip1').value = data.wtl_ip1;
|
|
$('wtl_ip1').value = data.wtl_ip1;
|
|
$('wtl_ip2').value = data.wtl_ip2;
|
|
$('wtl_ip2').value = data.wtl_ip2;
|
|
@@ -1031,6 +1071,8 @@ function settingsGET(){
|
|
dhcpState();
|
|
dhcpState();
|
|
telnetState();
|
|
telnetState();
|
|
syslogState();
|
|
syslogState();
|
|
|
|
+ radiusState();
|
|
|
|
+ authState();
|
|
timesetType($('ntp'));
|
|
timesetType($('ntp'));
|
|
ftpSettings();
|
|
ftpSettings();
|
|
|
|
|