Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit a941b6c

Browse files
committed
fix
1 parent 2445056 commit a941b6c

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

‎app/hosts/hosts.html‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ <h3 class="modal-title">{{type}}主机</h3>
7979
<td class="table-td-padding">{{host.name}}</td>
8080
<td class="table-td-padding">{{host.ip}}</td>
8181
<td class="table-td-padding">{{host.appset.name}}</td>
82-
<td class="table-td-padding">{{getStatus(host.id)}}</td>
82+
<td class="table-td-padding">
83+
<span ng-class="getStatus(host.id)==1?'green':'red'">
84+
<i class="fa fa-fw" ng-class="getStatus(host.id)==1?'fa-check':'fa-times'"></i>
85+
{{getStatus(host.id)==1?'运行中':'未运行'}}
86+
</span>
87+
</td>
8388
<td class="table-td-padding">
8489
<ul class="list-unstyled list-no-margin">
8590
<li ng-repeat="p in host.path">{{p.path}}</li>

‎app/hosts/hosts.js‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,10 @@ angular.module('ModuleAB.hosts', ['ngRoute'])
7373
}
7474

7575
$scope.getStatus = function(id) {
76-
var s = '<i class="fa {0} fa-fw"></i> {1}'
7776
try {
78-
if (clientStatus[id] === 1) {
79-
return s.format('fa-check', '运行中');
80-
} else {
81-
return s.format('fa-times', '未运行');
82-
}
77+
return clientStatus[id];
8378
} catch (e) {
84-
return s.format('fa-question', '未知');
79+
return 0;
8580
}
8681
}
8782

‎app/index.html‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@
2525
<!-- Custom Fonts -->
2626
<link href="/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
2727

28+
<style>
29+
span.status{
30+
31+
}
32+
span.red{
33+
color:red;
34+
}
35+
span.green{
36+
color:green;
37+
}
38+
</style>
39+
2840
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
2941
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
3042
<!--[if lt IE 9]>

0 commit comments

Comments
 (0)