Authored by qinchao

mha 通过db加载

... ... @@ -161,7 +161,7 @@
if(model.id >0){
if(model.serverNode){
/* var title = Util.createDOM('<div class="widget-title" style="background-image:none!important;background-color:#ddd;height: 36px;"></div>');
title.appendChild(Util.createDOM('<h5>'+model.label+'</h5>'));
var a = Util.createDOM('<a href="#" onclick="alert(1)" style="float:right;margin-right: 10px;"><H5 style="padding-right:0px;padding-left:0px;"><span class="glyphicon glyphicon-info-sign"></span></H5></a>');
... ... @@ -173,27 +173,58 @@
var colorBadge="#4169E1";
if(model.badge=="crash"){
colorBadge="#F90426";
colorBadge= "#D1841C";//"#F90426";
}
var content = Util.createDOM(
'<div class="widget-content" style="height: 100%;padding-top: 5px;"></div>');
var badgeAndHost = Util.createDOM(
var body = Util.createDOM('<div class="widget-content" style="height: 100%;padding: 0px;border:0px"></div>');
var header=Util.createDOM('<div style="margin:0px;border:0px;"></div>');
var content = Util.createDOM('<div style="margin:0px;border:0px;padding: 5px;"></div>');
//header
var headBtnDiv=Util.createDOM('<div style="margin:0px;border:0px;padding: 3px;float:right;"></div>');
var btn_info = Util.createDOM('<a href="#" onclick="alert(1)" style="float:right;margin: 3px;"><span class="glyphicon glyphicon-info-sign"></span></a>');
headBtnDiv.appendChild(btn_info);
header.appendChild(headBtnDiv);
if(model.seqNO==1){
var t=Util.createDOM('<div style="background-color:#E5E5E5;padding: 5px 10px;border-bottom: 1px solid #999"><span style="font-size:12px;font-weight:bold;">'+model.label+'</span></div>');
header.appendChild(t);
}
//content
/* var hostInfo = Util.createDOM(
'<div>'
+'<span class="badge" style="margin-right:5px;background-color:'+colorBadge+';font-weight:normal;">'+model.badge+'</span>'
//+'<br/>'
+'<br/>'
+model.hostname+' '+model.port
+'</div>');*/
var tags=Util.createDOM(
'<div>'
+'<span class="badge" style="background-color:'+colorBadge+';font-weight:normal;">'+model.badge+'</span>'
+'</div>');
if(model.seqNO==0){
content.appendChild(Util.createDOM('<div style="margin:0px;">'+model.label+'</div>'));
if(model.badge!="crash"){
var healthyTag=Util.createDOM('<span class="badge" style="background-color:green;font-weight:normal;margin-left:3px;">healthy</span>');
tags.appendChild(healthyTag);
}
content.appendChild(badgeAndHost);
container.appendChild(content);
var hostInfo = Util.createDOM(
'<div>'
+model.hostname+' '+model.port
+'</div>');
content.appendChild(tags);
content.appendChild(hostInfo);
if(model.seqNO==1&&model.badge!="crash"){
var a = Util.createDOM('<button onclick="alert(1)" class="btn btn-danger btn-sm" style="float:right;">卸载</button>');
content.appendChild(a);
}
body.appendChild(header);
body.appendChild(content);
container.appendChild(body);
}else{
var index = Util.createDOM(
'<div style="height: 100%;padding:40px 0;">'
+'<strong>'+model.seqNO+'</strong>'
+'<strong>'+model.indexNO+'</strong>'
+'</div>');
container.appendChild(index);
}
... ... @@ -231,7 +262,7 @@
fillOpacity: 1
}).color( function(obj){
if(obj.badge=="crash"){
return '#ddd';
// return '#ddd';
}
}).label('srvName')/*.shape('customNode')*/;
tree.edge().style({
... ...