From f3b5f803f58de2f95945f7d060e037fc0859858d Mon Sep 17 00:00:00 2001 From: "Miguel A. C" <30386061+doncicuto@users.noreply.github.com> Date: Mon, 4 Dec 2017 17:58:46 +0100 Subject: [PATCH] feat(tasks): add missing task states, set new default state color (#1459) --- app/filters/filters.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/filters/filters.js b/app/filters/filters.js index efc463d23..ee3b6435a 100644 --- a/app/filters/filters.js +++ b/app/filters/filters.js @@ -55,16 +55,19 @@ angular.module('portainer.filters', []) 'use strict'; return function (text) { var status = _.toLower(text); - if (includeString(status, ['new', 'allocated', 'assigned', 'accepted'])) { - return 'info'; + var labelStyle = 'default'; + if (includeString(status, ['new', 'allocated', 'assigned', 'accepted', 'preparing', 'ready', 'starting', 'remove'])) { + labelStyle = 'info'; } else if (includeString(status, ['pending'])) { - return 'warning'; - } else if (includeString(status, ['shutdown', 'failed', 'rejected'])) { - return 'danger'; + labelStyle = 'warning'; + } else if (includeString(status, ['shutdown', 'failed', 'rejected', 'orphaned'])) { + labelStyle = 'danger'; } else if (includeString(status, ['complete'])) { - return 'primary'; - } - return 'success'; + labelStyle = 'primary'; + } else if (includeString(status, ['running'])) { + labelStyle = 'success'; + } + return labelStyle; }; }) .filter('containerstatusbadge', function () {