...
|
...
|
@@ -83,32 +83,6 @@ |
|
|
border-radius: 3px;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
.node-container .node-container-title{
|
|
|
// color: white;
|
|
|
font-size: 2em;
|
|
|
float:left;
|
|
|
height:40px;
|
|
|
}
|
|
|
|
|
|
.node-container .node-container-content{
|
|
|
margin-top:40px;
|
|
|
height: 100%;
|
|
|
background-color: red;
|
|
|
}
|
|
|
|
|
|
.node-container .node-container-title-button-div{
|
|
|
float:right;
|
|
|
}
|
|
|
|
|
|
.node-container .node-container-title-button-div span{
|
|
|
margin-top:3px;
|
|
|
margin-left:3px;
|
|
|
margin-right:3px;
|
|
|
//width:20px;
|
|
|
}
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<title>YOHO!运维</title>
|
...
|
...
|
@@ -186,17 +160,24 @@ |
|
|
var title = Util.createDOM('<div class="widget-title" style="height: 36px;"></div>');
|
|
|
|
|
|
var colorBadge="#4169E1";
|
|
|
if(model.disabledFlag){
|
|
|
if(model.badge=="crash"){
|
|
|
colorBadge="#F90426";
|
|
|
}else if(model.no_master==1){
|
|
|
}/*else if(model.badge=="standby"){
|
|
|
colorBadge="#5bc0de";
|
|
|
}
|
|
|
title.appendChild(Util.createDOM('<h5><span class="badge" style="margin-right:5px;background-color:'+colorBadge+';font-weight:normal;">'+model.badge+'</span>'+model.label+'</h5>'));
|
|
|
}else if(model.badge=="slave"){
|
|
|
colorBadge="#5bc0fe";
|
|
|
}*/
|
|
|
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>');
|
|
|
title.appendChild(a);
|
|
|
|
|
|
|
|
|
var content = Util.createDOM('<div class="widget-content" style="height: 70px;">'+model.hostname+' '+model.port+'</div>');
|
|
|
var content = Util.createDOM(
|
|
|
'<div class="widget-content" style="height: 70px;">'
|
|
|
+'<span class="badge" style="margin-right:5px;background-color:'+colorBadge+';font-weight:normal;">'+model.badge+'</span>'
|
|
|
//+'<br/>'
|
|
|
+model.hostname+' '+model.port
|
|
|
+'</div>');
|
|
|
container.appendChild(title);
|
|
|
container.appendChild(content);
|
|
|
return container;
|
...
|
...
|
@@ -240,9 +221,7 @@ |
|
|
stroke: null, // 去除默认边框
|
|
|
fillOpacity: 1
|
|
|
})/*.color( function(obj){
|
|
|
if(obj.disabledFlag){
|
|
|
return '#aaa';
|
|
|
}
|
|
|
})*/.label('serverName').shape('customNode');
|
|
|
tree.edge().style({
|
|
|
//stroke: 'black',
|
...
|
...
|
@@ -254,7 +233,7 @@ |
|
|
return tree;
|
|
|
}
|
|
|
|
|
|
function reloadCanvas(model,tree,newChildData){
|
|
|
//function reloadCanvas(model,tree,newChildData){
|
|
|
/*var oldSize=model.children.length;
|
|
|
var newSize=newChildData==null?0:newChildData.length;
|
|
|
model.children = newChildData;
|
...
|
...
|
@@ -274,11 +253,11 @@ |
|
|
tree.autoSize();
|
|
|
tree.refresh();*!/
|
|
|
}*/
|
|
|
}
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
function drawHtml(cfg) {
|
|
|
/*function drawHtml(cfg) {
|
|
|
var model = cfg.model;
|
|
|
var container = Util.createDOM('<div class="node-container"></div>');
|
|
|
var title = Util.createDOM('<div class="node-container-title">'+model.label+'</div>');
|
...
|
...
|
@@ -308,9 +287,9 @@ |
|
|
var content = Util.createDOM('<div class="node-container-content">'+model.ip+'</div>');
|
|
|
container.appendChild(content);
|
|
|
return container;
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
function drawCard(cfg, group){
|
|
|
/* function drawCard(cfg, group){
|
|
|
var model = cfg.model;
|
|
|
var width = 300;
|
|
|
var height = 80;
|
...
|
...
|
@@ -355,7 +334,7 @@ |
|
|
}
|
|
|
});
|
|
|
// Master or No-master
|
|
|
/* group.addShape('text', {
|
|
|
/!* group.addShape('text', {
|
|
|
attrs: {
|
|
|
x: x + padding,
|
|
|
y: y + upRectHeight + padding,
|
...
|
...
|
@@ -365,7 +344,7 @@ |
|
|
fontSize: 14,
|
|
|
fill: 'black'
|
|
|
}
|
|
|
});*/
|
|
|
});*!/
|
|
|
|
|
|
// ip
|
|
|
group.addShape('text', {
|
...
|
...
|
@@ -380,7 +359,7 @@ |
|
|
}
|
|
|
});
|
|
|
return keyShape;
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|