Add app state filter

This commit is contained in:
Johannes Zellner
2020-09-26 17:50:23 +02:00
parent 68573ceb18
commit 72118a0b66
3 changed files with 22 additions and 3 deletions

View File

@@ -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) {