diff --git a/dashboard/src/theme.scss b/dashboard/src/theme.scss index 0a7cb5dfb..9b91ca632 100644 --- a/dashboard/src/theme.scss +++ b/dashboard/src/theme.scss @@ -368,6 +368,10 @@ textarea { width: 100%; margin-top: 20px !important; + th { + white-space: nowrap; + } + .app-list-item { .app-list-item-icon { height: 32px; diff --git a/dashboard/src/views/apps.html b/dashboard/src/views/apps.html index 8c22060c7..39c2ef9c2 100644 --- a/dashboard/src/views/apps.html +++ b/dashboard/src/views/apps.html @@ -156,7 +156,7 @@
-
+
@@ -205,15 +205,15 @@   - Location - App -   - Status + Location + App + + Status {{ 'main.actions' | tr }} - + @@ -228,7 +228,7 @@
- {{ app.manifest.title || 'App Link'}} + {{ app.manifest.title || 'App Link' }}
diff --git a/dashboard/src/views/apps.js b/dashboard/src/views/apps.js index 8805055cc..5f06d2d89 100644 --- a/dashboard/src/views/apps.js +++ b/dashboard/src/views/apps.js @@ -32,6 +32,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat $scope.showFilter = false; $scope.filterActive = false; $scope.view = 'list'; + $scope.orderBy = 'location'; // or app, status, sso + $scope.orderByReverse = false; $scope.allUsers = []; $scope.allGroups = []; @@ -46,8 +48,23 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat if (tr['app.states.updateAvailable']) $scope.states[3].label = tr['app.states.updateAvailable']; }); - // for sorting of the app grid items - $scope.labelOrFQDN = function (item) { + $scope.setOrderBy = function (by) { + if (by === $scope.orderBy) { + $scope.orderByReverse = !$scope.orderByReverse; + } else { + $scope.orderBy = by; + $scope.orderByReverse = false; + } + + localStorage.appsOrderBy = by; + localStorage.appsOrderByReverse = $scope.orderByReverse ? 'true' : ''; + }; + + // for sorting/grouping + $scope.orderByFilter = function (item) { + if ($scope.orderBy === 'app') return item.manifest.title || 'App Link'; + if ($scope.orderBy === 'status') return item.installationState + '-' + item.runState; + if ($scope.orderBy === 'sso') return item.sso; return item.label || item.fqdn; }; @@ -271,6 +288,9 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat $scope.setView(localStorage.appsView); + $scope.orderBy = localStorage.appsOrderBy; + $scope.orderByReverse = !!localStorage.appsOrderByReverse; + if (!$scope.user.isAtLeastAdmin) return; // load local settings and apply tag filter