if ("undefined" == typeof (XMLHttpRequest.responseJSON)) {
alert("System error, please try again later.");
layer.alert("System error, please try again later.");
return;
}
if(40100 == XMLHttpRequest.responseJSON.code){
location.href="/";
}else{
if (40100 == XMLHttpRequest.responseJSON.code) {
location.href = "/";
} else {
layer.alert(XMLHttpRequest.responseJSON.message);
api_invoke("/config/detail", {}, function(data) {
clientList = data.data;
@ -81,15 +82,13 @@
$(".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])$/
return re.test(ip);
}
function check_port(port)
{
if (port>65535) {
function check_port(port) {
if (port > 65535) {
return false;
}
var re = /^[1-9]+[0-9]*]*$/
@ -114,20 +113,20 @@
History.pushState('forward', null, '?state=1');
}
load_page("html/client/list.html");
$(".logout").click(function(){
api_invoke("/logout", {}, function(data){
$(".logout").click(function() {
api_invoke("/logout", {}, function(data) {
location.href = "/";
})
});
window.clientList = [];
});
function update_menu(){
function update_menu(){
api_invoke("/config/detail", {}, function(data) {
if (data.code == 20000) {
clientList = data.data;
var html = template($("#menu-tpl").html(), {list: clientList});