if ("undefined" == typeof (XMLHttpRequest.responseJSON)) {
if ("undefined" == typeof (XMLHttpRequest.responseJSON)) {
alert("System error, please try again later.");
layer.alert("System error, please try again later.");
return;
return;
}
}
if(40100 == XMLHttpRequest.responseJSON.code){
if (40100 == XMLHttpRequest.responseJSON.code) {
location.href="/";
location.href = "/";
}else{
} else {
layer.alert(XMLHttpRequest.responseJSON.message);
layer.alert(XMLHttpRequest.responseJSON.message);
api_invoke("/config/detail", {}, function(data) {
api_invoke("/config/detail", {}, function(data) {
clientList = data.data;
clientList = data.data;
});
});
}
}
}
}
});
});
}
}
function load_page(pageUrl) {
function load_page(pageUrl) {
$(".layui-body").load(pageUrl);
$(".layui-body").load(pageUrl);
}
}
function check_lan(ip)
function check_lan(ip) {
{
var re = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5])$/
var re = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5])$/
return re.test(ip);
return re.test(ip);
}
}
function check_port(port)
function check_port(port) {
{
if (port > 65535) {
if (port>65535) {
return false;
return false;
}
}
var re = /^[1-9]+[0-9]*]*$/
var re = /^[1-9]+[0-9]*]*$/
return re.test(port);
return re.test(port);
}
}
$(function() {
$(function() {
if (window.history && window.history.pushState) {
if (window.history && window.history.pushState) {
$(window).on('popstate', function() {
$(window).on('popstate', function() {
window.history.pushState('forward', null, '#');
window.history.pushState('forward', null, '#');
window.history.forward(1);
window.history.forward(1);
});
});
}
}
if ('pushState' in history) {
if ('pushState' in history) {
window.history.pushState('forward', null, '#');
window.history.pushState('forward', null, '#');
window.history.forward(1);
window.history.forward(1);
} else {
} else {
History.pushState('forward', null, '?state=2');
History.pushState('forward', null, '?state=2');
window.history.forward(1);
window.history.forward(1);
}
}
window.onhashchange = function() {
window.onhashchange = function() {
History.pushState('forward', null, '?state=1');
History.pushState('forward', null, '?state=1');
}
}
load_page("html/client/list.html");
$(".logout").click(function() {
$(".logout").click(function(){
api_invoke("/logout", {}, function(data) {
api_invoke("/logout", {}, function(data){
location.href = "/";
location.href = "/";
})
})
});
});
window.clientList = [];
});
});
function update_menu() {
function update_menu(){
api_invoke("/config/detail", {}, function(data) {
api_invoke("/config/detail", {}, function(data) {
if (data.code == 20000) {
if (data.code == 20000) {
clientList = data.data;
clientList = data.data;
var html = template($("#menu-tpl").html(), {list: clientList});