diff --git a/apps/dashboard/appinfo/routes.php b/apps/dashboard/appinfo/routes.php index c4df1f732f8..e0d7979a48e 100644 --- a/apps/dashboard/appinfo/routes.php +++ b/apps/dashboard/appinfo/routes.php @@ -28,6 +28,7 @@ return [ 'routes' => [ ['name' => 'dashboard#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'dashboard#updateLayout', 'url' => '/layout', 'verb' => 'POST'], + ['name' => 'dashboard#updateStatuses', 'url' => '/statuses', 'verb' => 'POST'], ['name' => 'dashboard#getBackground', 'url' => '/background', 'verb' => 'GET'], ['name' => 'dashboard#setBackground', 'url' => '/background/{type}', 'verb' => 'POST'], ] diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index a272c9deb14..c9fd96fcb6f 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -103,7 +103,10 @@ class DashboardController extends Controller { 'url' => $widget->getUrl() ]; }, $this->dashboardManager->getWidgets()); + $configStatuses = $this->config->getUserValue($this->userId, 'dashboard', 'statuses', '{}'); + $statuses = json_decode($configStatuses, true); $this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets); + $this->inititalStateService->provideInitialState('dashboard', 'statuses', $statuses); $this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout); $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1'); $this->inititalStateService->provideInitialState('dashboard', 'shippedBackgrounds', BackgroundService::SHIPPED_BACKGROUNDS); @@ -131,6 +134,16 @@ class DashboardController extends Controller { return new JSONResponse(['layout' => $layout]); } + /** + * @NoAdminRequired + * @param string $statuses + * @return JSONResponse + */ + public function updateStatuses(string $statuses): JSONResponse { + $this->config->setUserValue($this->userId, 'dashboard', 'statuses', $statuses); + return new JSONResponse(['statuses' => $statuses]); + } + /** * @NoAdminRequired */ diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue index 7b374065088..b70401c0267 100644 --- a/apps/dashboard/src/App.vue +++ b/apps/dashboard/src/App.vue @@ -2,6 +2,8 @@

{{ greeting.text }}