How to use the node.profile 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
buildNodeCtrlPanel:function(nodeObj) {
			
			if(UserFilterCache.nomapping){
				return;//权限设置
			}
		
			var sb=new StringBuffer();
			
			var nodeCtrlUrl=this.getNodeCtrlUrl(nodeObj);
			
			var nodeObjStr=StringHelper.obj2str({id:nodeObj["id"],name:nodeObj["name"],url:nodeCtrlUrl,ip:nodeObj["ip"],pid:nodeObj["node.pid"],pname:nodeObj["name"],profile:nodeObj["node.profile"],
                                                version:nodeObj["node.version"] == undefined ? "UNKNOW" : nodeObj["node.version"],nodeRoot:nodeObj["node.root"],
                                                dockerContainer:nodeObj["node.docker.container"] == undefined ? "{}" : nodeObj["node.docker.container"]});
			//权限设置
			var groupName = nodeObj.group;
			var ctrlAuthor = false;
			if(UserFilterCache.ctrls[groupName]!=undefined && UserFilterCache.ctrls[groupName]["nodectrl"] !=undefined && UserFilterCache.ctrls[groupName]["nodectrl"]=="T"){
				ctrlAuthor=true;
			}
			
			if(UserFilterCache.all || ctrlAuthor){
				//设置系统属性
				sb.append("<button class="\&quot;btn">修改属性</button>");

				//重启Node
				sb.append("&nbsp;<button class="\&quot;btn">配置管理</button>");
				sb.append("&nbsp;<button class="\&quot;btn">重启节点</button>");
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildUContainerDetail:function(ip) {
			var dObj=app.mdata("macinfo")[ip];
			//node info		
			var nodes=app.mdata("nodeinfo");
			var maNodeInfo;
			var nodeObj;
			for (var nodeKey in nodes) {
				var aNodeObj=nodes[nodeKey];
				if (aNodeObj["ip"]==ip) {
					if (aNodeObj["node.profile"].indexOf("ma")==0||aNodeObj["name"]=="监控代理程序") {
						maNodeInfo=aNodeObj;
						continue;
					}
					
					if (aNodeObj["node.profile"].indexOf("ua")==0||aNodeObj["name"]=="Ultron代理程序") {
						nodeObj=aNodeObj;
					}
				}
			}
			
			//detail
			var divContent=this.buildUContainerDetailTopContent(nodeObj);
			
			var handler=function(containerObj) {
				//we should deliver the maNodeInfo to the process info panel as we need ctrl the process via MonitorAgent
				divContent+=app.controller.buildUContainerDetailInfo(containerObj,nodeObj,maNodeInfo);
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildUContainerDetail:function(ip) {
			var dObj=app.mdata("macinfo")[ip];
			//node info		
			var nodes=app.mdata("nodeinfo");
			var maNodeInfo;
			var nodeObj;
			for (var nodeKey in nodes) {
				var aNodeObj=nodes[nodeKey];
				if (aNodeObj["ip"]==ip) {
					if (aNodeObj["node.profile"].indexOf("ma")==0||aNodeObj["name"]=="监控代理程序") {
						maNodeInfo=aNodeObj;
						continue;
					}
					
					if (aNodeObj["node.profile"].indexOf("ua")==0||aNodeObj["name"]=="Ultron代理程序") {
						nodeObj=aNodeObj;
					}
				}
			}
			
			//detail
			var divContent=this.buildUContainerDetailTopContent(nodeObj);
			
			var handler=function(containerObj) {
				//we should deliver the maNodeInfo to the process info panel as we need ctrl the process via MonitorAgent
				divContent+=app.controller.buildUContainerDetailInfo(containerObj,nodeObj,maNodeInfo);
			};
			
			this.handleContainer(nodeObj,handler);

			divContent+=this.buildMacDetailEndContent();
github uavorg / uavstack / com.creditease.uav.console / src / main / webapp / uavapp_godeye / uavnetwork / js / uav.network.js View on Github external
buildMacDetail:function(ip) {
			var dObj=app.mdata("macinfo")[ip];
			//detail
			var divContent=this.buildMacDetailTopContent(dObj);
			//node info		
			var nodes=app.mdata("nodeinfo");
			//the monitoragent node info
			var maNodeInfo;
			for (var nodeKey in nodes) {
				var nodeObj=nodes[nodeKey];
				if (nodeObj["ip"]==ip) {
					divContent+=this.buildMacDetailNodeInfo(nodeObj);
					
					if (nodeObj["node.profile"].indexOf("ma")==0||nodeObj["name"]=="监控代理程序") {
						maNodeInfo=nodeObj;
					}
				}
			}
			//process info
			var procs=eval("("+dObj["node.procs"]+")");
			
			var handler=function(proc) {
				//we should deliver the maNodeInfo to the process info panel as we need ctrl the process via MonitorAgent
				divContent+=app.controller.buildMacProcessInfo(proc,maNodeInfo);
			};
			
			this.handleProcess(procs,handler);

			divContent+=this.buildMacDetailEndContent();
	        return divContent;
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 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>