diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ConnectivityChecker.vue | 4 | ||||
-rw-r--r-- | src/components/DarkMode.vue | 2 | ||||
-rw-r--r-- | src/components/Message.vue | 1 | ||||
-rw-r--r-- | src/components/SearchInput.vue | 2 | ||||
-rw-r--r-- | src/components/Service.vue | 5 | ||||
-rw-r--r-- | src/components/SettingToggle.vue | 5 | ||||
-rw-r--r-- | src/components/services/OpenWeather.vue | 28 | ||||
-rw-r--r-- | src/components/services/UptimeKuma.vue | 1 |
8 files changed, 27 insertions, 21 deletions
diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue index 2b3e47b..0e724fc 100644 --- a/src/components/ConnectivityChecker.vue +++ b/src/components/ConnectivityChecker.vue | |||
@@ -56,7 +56,9 @@ export default { | |||
56 | 56 | ||
57 | // extra check to make sure we're not offline | 57 | // extra check to make sure we're not offline |
58 | let that = this; | 58 | let that = this; |
59 | const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf(); | 59 | const aliveCheckUrl = `${window.location.origin}${ |
60 | window.location.pathname | ||
61 | }/index.html?t=${new Date().valueOf()}`; | ||
60 | return fetch(aliveCheckUrl, { | 62 | return fetch(aliveCheckUrl, { |
61 | method: "HEAD", | 63 | method: "HEAD", |
62 | cache: "no-store", | 64 | cache: "no-store", |
diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue index 677238a..4318c22 100644 --- a/src/components/DarkMode.vue +++ b/src/components/DarkMode.vue | |||
@@ -1,6 +1,6 @@ | |||
1 | <template> | 1 | <template> |
2 | <a | 2 | <a |
3 | v-on:click="toggleTheme()" | 3 | @click="toggleTheme()" |
4 | aria-label="Toggle dark mode" | 4 | aria-label="Toggle dark mode" |
5 | class="navbar-item is-inline-block-mobile" | 5 | class="navbar-item is-inline-block-mobile" |
6 | > | 6 | > |
diff --git a/src/components/Message.vue b/src/components/Message.vue index 00ce158..2b338ef 100644 --- a/src/components/Message.vue +++ b/src/components/Message.vue | |||
@@ -47,7 +47,6 @@ export default { | |||
47 | } | 47 | } |
48 | if (this.item.url) { | 48 | if (this.item.url) { |
49 | let fetchedMessage = await this.downloadMessage(this.item.url); | 49 | let fetchedMessage = await this.downloadMessage(this.item.url); |
50 | console.log("done"); | ||
51 | if (this.item.mapping) { | 50 | if (this.item.mapping) { |
52 | fetchedMessage = this.mapRemoteMessage(fetchedMessage); | 51 | fetchedMessage = this.mapRemoteMessage(fetchedMessage); |
53 | } | 52 | } |
diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index 165c992..53480e7 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue | |||
@@ -75,7 +75,7 @@ export default { | |||
75 | this.$emit("input", value.toLowerCase()); | 75 | this.$emit("input", value.toLowerCase()); |
76 | }, | 76 | }, |
77 | }, | 77 | }, |
78 | beforeDestroy() { | 78 | beforeUnmount() { |
79 | document.removeEventListener("keydown", this._keyListener); | 79 | document.removeEventListener("keydown", this._keyListener); |
80 | }, | 80 | }, |
81 | }; | 81 | }; |
diff --git a/src/components/Service.vue b/src/components/Service.vue index 25b86d5..ac378ec 100644 --- a/src/components/Service.vue +++ b/src/components/Service.vue | |||
@@ -1,8 +1,9 @@ | |||
1 | <template> | 1 | <template> |
2 | <component v-bind:is="component" :item="item" :proxy="proxy"></component> | 2 | <component :is="component" :item="item" :proxy="proxy"></component> |
3 | </template> | 3 | </template> |
4 | 4 | ||
5 | <script> | 5 | <script> |
6 | import { defineAsyncComponent } from "vue"; | ||
6 | import Generic from "./services/Generic.vue"; | 7 | import Generic from "./services/Generic.vue"; |
7 | 8 | ||
8 | export default { | 9 | export default { |
@@ -17,7 +18,7 @@ export default { | |||
17 | if (type === "Generic") { | 18 | if (type === "Generic") { |
18 | return Generic; | 19 | return Generic; |
19 | } | 20 | } |
20 | return () => import(`./services/${type}.vue`); | 21 | return defineAsyncComponent(() => import(`./services/${type}.vue`)); |
21 | }, | 22 | }, |
22 | }, | 23 | }, |
23 | }; | 24 | }; |
diff --git a/src/components/SettingToggle.vue b/src/components/SettingToggle.vue index 6c8a10f..efa7caa 100644 --- a/src/components/SettingToggle.vue +++ b/src/components/SettingToggle.vue | |||
@@ -1,5 +1,8 @@ | |||
1 | <template> | 1 | <template> |
2 | <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile"> | 2 | <a |
3 | @click.prevent="toggleSetting()" | ||
4 | class="navbar-item is-inline-block-mobile" | ||
5 | > | ||
3 | <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span> | 6 | <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span> |
4 | <slot></slot> | 7 | <slot></slot> |
5 | </a> | 8 | </a> |
diff --git a/src/components/services/OpenWeather.vue b/src/components/services/OpenWeather.vue index 79d5e37..ba0be96 100644 --- a/src/components/services/OpenWeather.vue +++ b/src/components/services/OpenWeather.vue | |||
@@ -22,7 +22,7 @@ | |||
22 | <div v-else> | 22 | <div v-else> |
23 | <p class="title is-4">{{ name }}</p> | 23 | <p class="title is-4">{{ name }}</p> |
24 | <p class="subtitle is-6"> | 24 | <p class="subtitle is-6"> |
25 | {{ temp | tempSuffix(this.item.units) }} | 25 | {{ temperature }} |
26 | </p> | 26 | </p> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
@@ -50,6 +50,19 @@ export default { | |||
50 | conditions: null, | 50 | conditions: null, |
51 | error: false, | 51 | error: false, |
52 | }), | 52 | }), |
53 | computed: { | ||
54 | temperature: function () { | ||
55 | if (!this.temp) return ""; | ||
56 | |||
57 | let unit = "K"; | ||
58 | if (this.item.units === "metric") { | ||
59 | unit = "°C"; | ||
60 | } else if (this.item.units === "imperial") { | ||
61 | unit = "°F"; | ||
62 | } | ||
63 | return `${this.temp} ${unit}`; | ||
64 | }, | ||
65 | }, | ||
53 | created() { | 66 | created() { |
54 | this.fetchWeather(); | 67 | this.fetchWeather(); |
55 | }, | 68 | }, |
@@ -86,19 +99,6 @@ export default { | |||
86 | }); | 99 | }); |
87 | }, | 100 | }, |
88 | }, | 101 | }, |
89 | filters: { | ||
90 | tempSuffix: function (value, type) { | ||
91 | if (!value) return ""; | ||
92 | |||
93 | let unit = "K"; | ||
94 | if (type === "metric") { | ||
95 | unit = "°C"; | ||
96 | } else if (type === "imperial") { | ||
97 | unit = "°F"; | ||
98 | } | ||
99 | return `${value} ${unit}`; | ||
100 | }, | ||
101 | }, | ||
102 | }; | 102 | }; |
103 | </script> | 103 | </script> |
104 | 104 | ||
diff --git a/src/components/services/UptimeKuma.vue b/src/components/services/UptimeKuma.vue index 3be53b8..5117a05 100644 --- a/src/components/services/UptimeKuma.vue +++ b/src/components/services/UptimeKuma.vue | |||
@@ -99,6 +99,7 @@ export default { | |||
99 | }, | 99 | }, |
100 | }, | 100 | }, |
101 | created() { | 101 | created() { |
102 | /* eslint-disable */ | ||
102 | this.item.url = `${this.item.url}/status/${this.dashboard}`; | 103 | this.item.url = `${this.item.url}/status/${this.dashboard}`; |
103 | this.fetchStatus(); | 104 | this.fetchStatus(); |
104 | }, | 105 | }, |