From 502c7f87e73e980afdea4c95967cd91985ffd816 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 17 Mar 2022 19:07:05 +0800 Subject: [PATCH] [Status Page] Listing: Better loading effect --- src/assets/app.scss | 4 ++++ src/icon.js | 2 ++ src/mixins/socket.js | 2 ++ src/pages/ManageStatusPage.vue | 28 +++++++++++++++++++--------- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/assets/app.scss b/src/assets/app.scss index c70efa179..7378f52c8 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -448,6 +448,10 @@ textarea.form-control { border-radius: 10px !important; } +.spinner { + color: $primary; +} + // Localization @import "localization.scss"; diff --git a/src/icon.js b/src/icon.js index 865897608..bbd816ea0 100644 --- a/src/icon.js +++ b/src/icon.js @@ -36,6 +36,7 @@ import { faChevronDown, faPen, faExternalLinkSquareAlt, + faSpinner, } from "@fortawesome/free-solid-svg-icons"; library.add( @@ -71,6 +72,7 @@ library.add( faChevronDown, faPen, faExternalLinkSquareAlt, + faSpinner, ); export { FontAwesomeIcon }; diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 7842fb8ca..e092923ed 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -38,6 +38,7 @@ export default { uptimeList: { }, tlsInfoList: {}, notificationList: [], + statusPageListLoaded: false, statusPageList: [], connectionErrorMsg: "Cannot connect to the socket server. Reconnecting...", }; @@ -114,6 +115,7 @@ export default { }); socket.on("statusPageList", (data) => { + this.statusPageListLoaded = true; this.statusPageList = data; }); diff --git a/src/pages/ManageStatusPage.vue b/src/pages/ManageStatusPage.vue index 2e5d11545..0eafb3e35 100644 --- a/src/pages/ManageStatusPage.vue +++ b/src/pages/ManageStatusPage.vue @@ -6,17 +6,24 @@
- {{ $t("Add New Status Page") }} + {{ $t("New Status Page") }}
-
- - -
-
{{ statusPage.title }}
-
/status/{{ statusPage.slug }}
-
-
+
+ +
+ +
@@ -76,6 +83,9 @@ export default { .logo { width: $logo-width; + + // Better when the image is loading + min-height: 1px; } .info {