diff --git a/src/js/index.js b/src/js/index.js index 59c80c9d2..3c03fd77d 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,7 +1,6 @@ 'use strict'; /* global angular:false */ -/* global showdown:false */ /* global moment:false */ /* global $:false */ /* global ERROR,ISTATES,HSTATES,RSTATES */ @@ -177,6 +176,19 @@ app.filter('appProgressMessage', function () { }; }); +// see apps.js $scope.states +app.filter('selectedStateFilter', function () { + return function selectedStateFilter(apps, selectedState) { + return apps.filter(function (app) { + if (!selectedState || !selectedState.state) return true; + + if (selectedState.state === 'running') return app.runState === 'running' && app.health === 'healthy' && app.installationState === 'installed'; + + return app.runState !== 'running' || app.health !== 'healthy' || app.installationState !== 'installed'; + }); + }; +}); + app.filter('selectedTagFilter', function () { return function selectedTagFilter(apps, selectedTags) { return apps.filter(function (app) { diff --git a/src/views/apps.html b/src/views/apps.html index 132c4b009..c4f17525e 100644 --- a/src/views/apps.html +++ b/src/views/apps.html @@ -117,7 +117,8 @@ My Apps
- + +
@@ -127,7 +128,7 @@