mirror of https://github.com/portainer/portainer
fix(containers): fix the ability to stop/pause a healthy container (#1507)
parent
35f7ce5f3d
commit
9c9e16b2b2
|
@ -70,16 +70,22 @@ function (PaginationService, DatatableService) {
|
||||||
|
|
||||||
for (var i = 0; i < this.dataset.length; i++) {
|
for (var i = 0; i < this.dataset.length; i++) {
|
||||||
var item = this.dataset[i];
|
var item = this.dataset[i];
|
||||||
if (item.Checked && item.Status === 'paused') {
|
if (item.Checked) {
|
||||||
this.state.noPausedItemsSelected = false;
|
this.updateSelectionStateBasedOnItemStatus(item);
|
||||||
} else if (item.Checked && (item.Status === 'stopped' || item.Status === 'created')) {
|
|
||||||
this.state.noStoppedItemsSelected = false;
|
|
||||||
} else if (item.Checked && item.Status === 'running') {
|
|
||||||
this.state.noRunningItemsSelected = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.updateSelectionStateBasedOnItemStatus = function(item) {
|
||||||
|
if (item.Status === 'paused') {
|
||||||
|
this.state.noPausedItemsSelected = false;
|
||||||
|
} else if (['stopped', 'created'].indexOf(item.Status) !== -1) {
|
||||||
|
this.state.noStoppedItemsSelected = false;
|
||||||
|
} else if (['running', 'healthy', 'unhealthy', 'starting'].indexOf(item.Status) !== -1) {
|
||||||
|
this.state.noRunningItemsSelected = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.changePaginationLimit = function() {
|
this.changePaginationLimit = function() {
|
||||||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue