Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
buildMacDetailNodeInfo : function(jsonObj){
var str= " <div class="\"contentDiv\""><div class="\"shine2\""></div>" +
" <span class="\"title\"">节点进程</span><span style="font-size:14px;color:#bbbbbb;">["+jsonObj["id"]+"]</span><span class="\"timeTitle\"">"+TimeHelper.getTime(jsonObj["clientTimestamp"])+"</span><br>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">名称</span><span>:</span>"+jsonObj["name"] +" <span style="font-size:14px;color:#bbbbbb;">["+jsonObj["node.pid"]+"]</span>"+
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">组</span><span>:</span>"+jsonObj["group"] +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">配置</span><span>:</span>"+jsonObj["node.profile"] +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">能力</span><span>:</span>"+this.formatter.feature(jsonObj["node.feature"],jsonObj) +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">Http服务</span><span>:</span>"+this.formatter.services(jsonObj["node.services"]) +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
" </div>" +</div>
addNodeBox:function(jsonObj) {
var procState = '';
if(jsonObj['node.pid']){
var procs;
if(jsonObj['node.procs']){
procs = eval("("+jsonObj['node.procs']+")");
}else{
var macinfo=app.mdata("macinfo");
var node=macinfo[jsonObj["ip"]];
var procsStr='{}';
if(node){
procsStr=node["node.procs"];
}
if (procsStr) {
procs = eval("("+procsStr+")");
}
}
if (procs) {
procState = this.buildProcStateHtm(procs[jsonObj['node.pid']]);
var procs;
if(jsonObj['node.procs']){
procs = eval("("+jsonObj['node.procs']+")");
}else{
var macinfo=app.mdata("macinfo");
var node=macinfo[jsonObj["ip"]];
var procsStr='{}';
if(node){
procsStr=node["node.procs"];
}
if (procsStr) {
procs = eval("("+procsStr+")");
}
}
if (procs) {
procState = this.buildProcStateHtm(procs[jsonObj['node.pid']]);
}
}
var stateCss = this.getNodeStateCss(jsonObj["node.state"]);
var nodeContent ="<span class="processInfo"><span class="pid">["+jsonObj["node.pid"]+"]</span> "+jsonObj.name +"</span>"+ procState;
var nodeDiv = HtmlHelper.id(jsonObj.id);
nodeDiv.className="nodeprocess "+stateCss;
nodeDiv.innerHTML = nodeContent;
},
//delete NODE BOX
" " +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">路径</span><span>:</span>"+jsonObj["node.root"] +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">版本</span><span>:</span>"+jsonObj["node.version"] +
" </div>" +
" <div class="\"kv\"">" +
" <span class="\"kvField\"">端口</span><span>:</span>";
var macinfo=app.mdata("macinfo");
var procs=eval("("+macinfo[jsonObj["ip"]]["node.procs"]+")");
var pid=jsonObj["node.pid"];
for (var key in procs) {
if (pid==key) {
str+=procs[key]["ports"];
break;
}
}
str+="</div>";
/**
* build control panel
*/
str+="<div class="\"kv\"">"+this.buildNodeCtrlPanel(jsonObj)+"</div>";
return str;
},