From 26932ecb103b326069f3653e4420d770189c1460 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 22 Aug 2021 16:38:49 -0400 Subject: [PATCH] Add a 'welcome' panel to the control panel and make it the default page instead of the status checks which take too long to load Fixes #2014 --- management/templates/index.html | 6 ++++++ management/templates/login.html | 2 +- management/templates/welcome.html | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 management/templates/welcome.html diff --git a/management/templates/index.html b/management/templates/index.html index 267f5dd6..492a953b 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -118,6 +118,10 @@
+
+ {% include "welcome.html" %} +
+
{% include "system-status.html" %}
@@ -409,6 +413,8 @@ $(function() { // Recall what the user was last looking at. if (typeof localStorage != 'undefined' && localStorage.getItem("miab-cp-lastpanel")) { show_panel(localStorage.getItem("miab-cp-lastpanel")); + } else if (api_credentials[0] != "") { + show_panel('welcome'); } else { show_panel('login'); } diff --git a/management/templates/login.html b/management/templates/login.html index 3447d794..8ae79857 100644 --- a/management/templates/login.html +++ b/management/templates/login.html @@ -163,7 +163,7 @@ function do_login() { // Open the next panel the user wants to go to. Do this after the XHR response // is over so that we don't start a new XHR request while this one is finishing, // which confuses the loading indicator. - setTimeout(function() { show_panel(!switch_back_to_panel || switch_back_to_panel == "login" ? 'system_status' : switch_back_to_panel) }, 300); + setTimeout(function() { show_panel(!switch_back_to_panel || switch_back_to_panel == "login" ? 'welcome' : switch_back_to_panel) }, 300); } }, undefined, diff --git a/management/templates/welcome.html b/management/templates/welcome.html new file mode 100644 index 00000000..124d2d28 --- /dev/null +++ b/management/templates/welcome.html @@ -0,0 +1,16 @@ + + +

{{hostname}}

+ +

Welcome to your Mail-in-a-Box control panel.

+