From 608456b14da2da4cb156b14609d711a5a4469426 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Wed, 13 Jul 2022 18:46:58 +0200 Subject: [PATCH] webapp: Added loading animation for ntp admin --- webapp/src/components/NtpAdminView.vue | 79 ++++++++++++++++---------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/webapp/src/components/NtpAdminView.vue b/webapp/src/components/NtpAdminView.vue index 3f25a7d1..eb28a44b 100644 --- a/webapp/src/components/NtpAdminView.vue +++ b/webapp/src/components/NtpAdminView.vue @@ -6,41 +6,50 @@ {{ alertMessage }} -
-
-
NTP Configuration
-
-
- -
- -
-
-
- -
- -
-
+
+
+ Loading... +
+
-
- -
- +
@@ -54,6 +63,8 @@ export default defineComponent({ }, data() { return { + dataLoading: true, + timezoneLoading: true, ntpConfigList: { ntp_server: "", ntp_timezone: "", @@ -78,11 +89,16 @@ export default defineComponent({ }, methods: { getTimezoneList() { + this.timezoneLoading = true; fetch("/zones.json") .then((response) => response.json()) - .then((data) => (this.timezoneList = data)); + .then((data) => { + this.timezoneList = data; + this.timezoneLoading = false; + }); }, getNtpConfig() { + this.dataLoading = true; fetch("/api/ntp/config") .then((response) => response.json()) .then( @@ -92,6 +108,7 @@ export default defineComponent({ this.ntpConfigList.ntp_timezone_descr + "---" + this.ntpConfigList.ntp_timezone; + this.dataLoading = false; } ); },