mirror of https://github.com/portainer/portainer
feat(storidge): update 8 - node availability on swarm overview
parent
b52dcaacc8
commit
d4772672bb
|
@ -63,6 +63,13 @@
|
|||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Status' && $ctrl.state.reverseOrder"></i>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a ng-click="$ctrl.changeOrderBy('Availability')">
|
||||
Availability
|
||||
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Availability' && !$ctrl.state.reverseOrder"></i>
|
||||
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'Availability' && $ctrl.state.reverseOrder"></i>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -77,6 +84,7 @@
|
|||
<td>{{ item.EngineVersion }}</td>
|
||||
<td ng-if="$ctrl.showIpAddressColumn">{{ item.Addr }}</td>
|
||||
<td><span class="label label-{{ item.Status | nodestatusbadge }}">{{ item.Status }}</span></td>
|
||||
<td><span class="label label-{{ item.Availability | dockerNodeAvailabilityBadge }}">{{ item.Availability }}</span></td>
|
||||
</tr>
|
||||
<tr ng-if="!$ctrl.dataset">
|
||||
<td colspan="7" class="text-center text-muted">Loading...</td>
|
||||
|
|
|
@ -97,6 +97,18 @@ angular.module('portainer.docker')
|
|||
return 'success';
|
||||
};
|
||||
})
|
||||
.filter('dockerNodeAvailabilityBadge', function () {
|
||||
'use strict';
|
||||
return function (text) {
|
||||
if (text === 'pause') {
|
||||
return 'warning';
|
||||
}
|
||||
else if (text === 'drain') {
|
||||
return 'danger';
|
||||
}
|
||||
return 'success';
|
||||
};
|
||||
})
|
||||
.filter('trimcontainername', function () {
|
||||
'use strict';
|
||||
return function (name) {
|
||||
|
|
|
@ -17,9 +17,9 @@ angular.module('extension.storidge')
|
|||
'use strict';
|
||||
return function (text) {
|
||||
var status = text ? _.toLower(text) : '';
|
||||
if (status === 'cordoned') {
|
||||
if (status === 'cordoned' || status === 'maintenance') {
|
||||
return 'orange-icon';
|
||||
} else if (status === 'leaving') {
|
||||
} else if (status === 'leaving' || status === 'failed') {
|
||||
return 'red-icon'
|
||||
}
|
||||
return 'green-icon';
|
||||
|
|
Loading…
Reference in New Issue