if ("undefined" == typeof (XMLHttpRequest.responseJSON)) {
alert("System error, please try again later.");
return;
}
if(40100 == XMLHttpRequest.responseJSON.code){
function load_page(pageUrl) {
location.href="/";
$(".layui-body").load(pageUrl);
}else{
}
layer.alert(XMLHttpRequest.responseJSON.message);
api_invoke("/config/detail", {}, function(data) {
clientList = data.data;
});
}
}
});
}
function load_page(pageUrl) {
function check_lan(ip) {
$(".layui-body").load(pageUrl);
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);
}
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])$/
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});