Authored by qinchao

伸缩组扩容:显示样式

... ... @@ -180,7 +180,7 @@
</div>
<script src="<%=basePath%>script/common/genarate_left_panel.js"></script>
<script src="<%=basePath%>script/autoscaling/autoscaling_new.js"></script>
<script src="<%=basePath%>script/autoscaling/autoscaling_new.js?v=1"></script>
<script>
$("#li_manager").addClass("active open");
$("#li_autoscaling").addClass("active");
... ...
... ... @@ -43,7 +43,7 @@ function getColumns(){
{
title : "组名",
field : "name",
width : "25%",
width : "20%",
styler : function(value, rowData, rowIndex){
return {
"vertical-align" : "middle"
... ... @@ -53,32 +53,53 @@ function getColumns(){
{
title : "主机",
field : "ip",
width : "25%",
width : "30%",
align : "center",
formatter : function(value, rowData, rowIndex) {
var instances = rowData.autoScalingHosts;
if(instances == null || instances.length == 0){
return;
}
var ips = "";
var hostipCss='';
for(var index = 0;index < instances.length;index++){
var runningStatusMessage = '&nbsp;&nbsp;<span class="badge" style="background-color: #0e90d2;font-weight:normal;">健康</span>';
if("Healthy"!=instances[index].runningStatus){
//hostipCss=' style="color:#dd514c;" ';
runningStatusMessage='&nbsp;&nbsp;<span class="badge" style="background-color: #dd514c;font-weight:normal;">异常</span>';
}
var protectedB = instances[index].protected;
var message = "";
var canScaleMessage='' ;
if(protectedB != null && protectedB != undefined){
if(protectedB){
message = "免于缩减";
canScaleMessage = '&nbsp;&nbsp;<span class="badge" style="background-color: #f37b1d;font-weight:normal;">免于缩减</span>';
}else{
canScaleMessage = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
}
}
if(message != ""){
ips += "<font color='#FF0000'>" + instances[index].ip + ":" + message + "</font>";
var hostip='<span class="label label-success" style="font-weight:normal;">';
if(hostipCss){
hostip+= ('<span '+hostipCss+'>'+instances[index].ip+'</span>');
}else{
ips += instances[index].ip ;
hostip+= instances[index].ip;
}
var runningStatusMessage = '-<span class="label label-success">健康</span>';
if("Healthy"!=instances[index].runningStatus){
runningStatusMessage='-<span class="label label-danger">不健康</span>';
for(var i=0;i<(15-instances[index].ip.length);i++){
hostip+="&nbsp;&nbsp;"
}
hostip += runningStatusMessage;
hostip += canScaleMessage;
hostip += '</span>';
//<button class="btn_java_api btn btn-lg btn-default btn-success">'+value.hostIp+'&nbsp;<span class="badge">好</span></button>
var onehost='<h4>'+hostip+'</h4>';
if(protectedB){
ips=onehost+ips;
}else{
ips += onehost;
}
ips += runningStatusMessage;
ips += "<br>";
}
return ips;
},
... ...