How to use the node.pid function in node

To help you get started, we’ve selected a few node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildMacDetailNodeInfo :  function(jsonObj){
			var str= "            <div class="\&quot;contentDiv\&quot;"><div class="\&quot;shine2\&quot;"></div>" +
	            "                <span class="\&quot;title\&quot;">节点进程</span><span style="font-size:14px;color:#bbbbbb;">["+jsonObj["id"]+"]</span><span class="\&quot;timeTitle\&quot;">"+TimeHelper.getTime(jsonObj["clientTimestamp"])+"</span><br>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">名称</span><span>:</span>"+jsonObj["name"] +"&nbsp;<span style="font-size:14px;color:#bbbbbb;">["+jsonObj["node.pid"]+"]</span>"+
	            "                </div>" +	
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">组</span><span>:</span>"+jsonObj["group"] +
	            "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">配置</span><span>:</span>"+jsonObj["node.profile"] +
	            "                </div>" +
                    "               <div class="\&quot;kv\&quot;">" +
                    "                  <span class="\&quot;kvField\&quot;">能力</span><span>:</span>"+this.formatter.feature(jsonObj["node.feature"],jsonObj) +
	            "              </div>" +
	            "               <div class="\&quot;kv\&quot;">" +
	            "                  <span class="\&quot;kvField\&quot;">Http服务</span><span>:</span>"+this.formatter.services(jsonObj["node.services"]) +
	            "              </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
	            "                </div>" +</div>
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
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']]);
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
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>&nbsp;"+jsonObj.name +"</span>"+ procState;
	        var nodeDiv = HtmlHelper.id(jsonObj.id);
	        nodeDiv.className="nodeprocess "+stateCss;
	        nodeDiv.innerHTML = nodeContent;
	    },
	    //delete NODE BOX
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
"              " +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">所属心跳地址</span><span>:</span>"+jsonObj["node.hbserver"] +
	            "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">路径</span><span>:</span>"+jsonObj["node.root"] +
	            "                </div>" +
		    "                <div class="\&quot;kv\&quot;">" +
                    "                    <span class="\&quot;kvField\&quot;">版本</span><span>:</span>"+jsonObj["node.version"] +
                    "                </div>" +
	            "                <div class="\&quot;kv\&quot;">" +
	            "                    <span class="\&quot;kvField\&quot;">端口</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="\&quot;kv\&quot;">"+this.buildNodeCtrlPanel(jsonObj)+"</div>";
	            
	            return str;
	    },