diff --git a/dashboard/src/views/apps.html b/dashboard/src/views/apps.html index 79a01530d..3f1770c4a 100644 --- a/dashboard/src/views/apps.html +++ b/dashboard/src/views/apps.html @@ -140,7 +140,7 @@ - +
diff --git a/dashboard/src/views/apps.js b/dashboard/src/views/apps.js index 17fe5301a..8805055cc 100644 --- a/dashboard/src/views/apps.js +++ b/dashboard/src/views/apps.js @@ -51,6 +51,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat return item.label || item.fqdn; }; + $scope.setView = function (view) { + if (view !== 'list' && view !== 'grid') return; + + $scope.view = view; + localStorage.appsView = view; + }; + + $scope.toggleView = function () { + $scope.view = $scope.view === 'grid' ? 'list' : 'grid'; + localStorage.appsView = $scope.view; + }; + $scope.$watch('selectedTags', function (newVal, oldVal) { if (newVal === oldVal) return; @@ -257,6 +269,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat }); }); + $scope.setView(localStorage.appsView); + if (!$scope.user.isAtLeastAdmin) return; // load local settings and apply tag filter