- Arthas.js 存储页面控制的 js
var registerApplications = null;
var applications = null;
$(document).ready(function () {
reloadRegisterApplications();
reloadApplications();
});
/**
-
获取注册的arthas客户端
/
function reloadRegisterApplications() {
var result = reqSync(“/api/arthas/clients”, “get”);
registerApplications = result;
initSelect(“#selectServer”, registerApplications, “”);
}
/* -
获取注册的应用
/
function reloadApplications() {
applications = reqSync(“/api/applications”, “get”);
console.log(applications)
}
/* -
初始化下拉选择框
/
function initSelect(uiSelect, list, key) {
$(uiSelect).html(‘’);
var server;
for (var i = 0; i < list.length; i++) {
server = list[i].toLowerCase().split(“@”);
if (“phantom-admin” === server[0]) continue;
$(uiSelect).append(“” + server[0] + “”);
}
}
/* -
重置配置文件
*/
function release() {
var currentServer = $(“#selectServer”).text();
for (var i = 0; i < applications.length; i+