From 659c7098b9fdc6a554c2e7ae81e268d59699317b Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sun, 14 Feb 2016 08:19:34 +1100 Subject: [PATCH] Improve dashboard performance Dashboard widgets should defer their data requesting using AJAX so they don't kill/lag the whole page request --- modules/backend/controllers/Index.php | 8 +++++++- modules/backend/controllers/index/index.htm | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/backend/controllers/Index.php b/modules/backend/controllers/Index.php index b79994fa7..cf7a5b57a 100644 --- a/modules/backend/controllers/Index.php +++ b/modules/backend/controllers/Index.php @@ -37,13 +37,19 @@ class Index extends Controller public function index() { - if ($redirect = $this->checkPermissionRedirect()) + if ($redirect = $this->checkPermissionRedirect()) { return $redirect; + } $this->pageTitle = 'backend::lang.dashboard.menu_label'; BackendMenu::setContextMainMenu('dashboard'); } + public function index_onInitReportContainer() + { + return ['#dashReportContainer' => $this->widget->reportContainer->render()]; + } + /** * Custom permissions check that will redirect to the next * available menu item, if permission to this page is denied. diff --git a/modules/backend/controllers/index/index.htm b/modules/backend/controllers/index/index.htm index c8ca59060..59fc4d19f 100644 --- a/modules/backend/controllers/index/index.htm +++ b/modules/backend/controllers/index/index.htm @@ -1,5 +1,21 @@ makePartial('warnings') ?> - widget->reportContainer->render() ?> +
+ + +
+
+ +
Loading dashboard...
+
+
+ +
+ + \ No newline at end of file