|
@@ -87,26 +87,6 @@ function fadeIn(el, display){
|
|
}
|
|
}
|
|
})();
|
|
})();
|
|
}
|
|
}
|
|
-// Shows confirm box if Network settings were changed
|
|
|
|
-var netsettings_changed;
|
|
|
|
-var netsettings_executed = false;
|
|
|
|
-function netsettings_changedCheck() {
|
|
|
|
- if (netsettings_changed == 'true') {
|
|
|
|
- if (!netsettings_executed) {
|
|
|
|
- netsettings_executed = true;
|
|
|
|
- var ch_element = HTMLcreate(
|
|
|
|
- '<div id="apply-settings">'+
|
|
|
|
- '<p>Внимание, для применения сетевых настроек необходимо их подтвердить.'+
|
|
|
|
- ' Иначе они будут сброшены в течении 10 минут.</p>'+
|
|
|
|
- '<a href="confirm.cgi" class="btn btn-danger">Подтвердить</a>'+
|
|
|
|
- '</div>'
|
|
|
|
- );
|
|
|
|
- document.body.insertBefore(ch_element, document.body.childNodes[0]);
|
|
|
|
- fadeIn($('apply-settings'));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-setInterval(netsettings_changedCheck, 100);
|
|
|
|
|
|
|
|
//########## Settings Form ############
|
|
//########## Settings Form ############
|
|
|
|
|
|
@@ -382,6 +362,18 @@ function getJSON(url, successHandler, errorHandler) {
|
|
xhr.send();
|
|
xhr.send();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function updatepage(){
|
|
|
|
+ var loc = location.pathname.slice(1, -5);
|
|
|
|
+ switch(loc){
|
|
|
|
+ case 'settings':
|
|
|
|
+ setTimeout(settingsGET, 1000);
|
|
|
|
+ break;
|
|
|
|
+ case 'history':
|
|
|
|
+ getPage($('currentpage').value);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
function getCGI(url) {
|
|
function getCGI(url) {
|
|
var xmlhttp;
|
|
var xmlhttp;
|
|
var q;
|
|
var q;
|
|
@@ -469,6 +461,8 @@ function paramsRefresh() {
|
|
$('ro1').innerHTML = +data.ro1 ? 'Замкнут' : 'Разомкнут';
|
|
$('ro1').innerHTML = +data.ro1 ? 'Замкнут' : 'Разомкнут';
|
|
$('ro2').innerHTML = +data.ro2 ? 'Замкнут' : 'Разомкнут';
|
|
$('ro2').innerHTML = +data.ro2 ? 'Замкнут' : 'Разомкнут';
|
|
// checkState();
|
|
// checkState();
|
|
|
|
+ window.setCookie('netsettings_changed', data.netsettings_changed);
|
|
|
|
+ checkNotify();
|
|
setTimeout(paramsRefresh, 1000);
|
|
setTimeout(paramsRefresh, 1000);
|
|
}, function (status) {
|
|
}, function (status) {
|
|
if (status !== 0){
|
|
if (status !== 0){
|
|
@@ -513,9 +507,7 @@ function getPage(pn){
|
|
}
|
|
}
|
|
// utcParam = data.utc;
|
|
// utcParam = data.utc;
|
|
window.setCookie('netsettings_changed', data.netsettings_changed);
|
|
window.setCookie('netsettings_changed', data.netsettings_changed);
|
|
- window.setCookie('profilaction_changed', data.profilaction_changed);
|
|
|
|
- window.setCookie('need_confirm', data.need_confirm);
|
|
|
|
- // checkNotify();
|
|
|
|
|
|
+ checkNotify();
|
|
clearTimeout(mint);
|
|
clearTimeout(mint);
|
|
mint = setTimeout(history_dataref, 5000);
|
|
mint = setTimeout(history_dataref, 5000);
|
|
}, function(){
|
|
}, function(){
|
|
@@ -697,8 +689,9 @@ function settingsGET(){
|
|
radiusState();
|
|
radiusState();
|
|
authState();
|
|
authState();
|
|
timesetType($('ntp'));
|
|
timesetType($('ntp'));
|
|
- netsettings_changed = data.netsettings_changed;
|
|
|
|
- // profilaction_changed = data.NeedProfilaction;
|
|
|
|
|
|
+
|
|
|
|
+ window.setCookie('netsettings_changed', data.netsettings_changed);
|
|
|
|
+ checkNotify();
|
|
}, function() {
|
|
}, function() {
|
|
alert('Не удалось получить данные.');
|
|
alert('Не удалось получить данные.');
|
|
});
|
|
});
|
|
@@ -730,6 +723,15 @@ function UPSPowerOff(options) {
|
|
}, JSON.stringify(options));
|
|
}, JSON.stringify(options));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+var apply_settings = new NotificationBox('apply-settings',
|
|
|
|
+ {
|
|
|
|
+ 'message': 'Внимание, для применения сетевых настроек необходимо их подтвердить. Иначе они будут сброшены в течении 10 минут.',
|
|
|
|
+ 'bgcolor':'#ffcc00',
|
|
|
|
+ 'textcolor': '#333',
|
|
|
|
+ 'url': 'confirm.cgi',
|
|
|
|
+ 'show': window.getCookie('role') < 2
|
|
|
|
+ });
|
|
|
|
+
|
|
// ################################################################################
|
|
// ################################################################################
|
|
|
|
|
|
function infoGet() {
|
|
function infoGet() {
|
|
@@ -747,7 +749,8 @@ function infoGet() {
|
|
$('ups_fwversion').innerHTML = data.ups_fwversion;
|
|
$('ups_fwversion').innerHTML = data.ups_fwversion;
|
|
$('ups_model').innerHTML = data.ups_model;
|
|
$('ups_model').innerHTML = data.ups_model;
|
|
// utcParam = data.utc;
|
|
// utcParam = data.utc;
|
|
- netsettings_changed = data.netsettings_changed;
|
|
|
|
|
|
+ window.setCookie('netsettings_changed', data.netsettings_changed);
|
|
|
|
+ checkNotify();
|
|
}, function() {
|
|
}, function() {
|
|
alert('Не удалось получить данные.');
|
|
alert('Не удалось получить данные.');
|
|
});
|
|
});
|