// extra check to make sure we're not offline
let that = this;
- const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`;
+ const aliveCheckUrl = `${window.location.origin}${
+ window.location.pathname
+ }/index.html?t=${new Date().valueOf()}`;
return fetch(aliveCheckUrl, {
method: "HEAD",
cache: "no-store",
<div v-else>
<p class="title is-4">{{ name }}</p>
<p class="subtitle is-6">
- {{ temp | tempSuffix(this.item.units) }}
+ {{ temperature }}
</p>
</div>
</div>
conditions: null,
error: false,
}),
+ computed: {
+ temperature: function () {
+ if (!this.temp) return "";
+
+ let unit = "K";
+ if (this.item.type === "metric") {
+ unit = "°C";
+ } else if (this.item.type === "imperial") {
+ unit = "°F";
+ }
+ return `${this.temp} ${unit}`;
+ },
+ },
created() {
this.fetchWeather();
},
});
},
},
- filters: {
- tempSuffix: function (value, type) {
- if (!value) return "";
-
- let unit = "K";
- if (type === "metric") {
- unit = "°C";
- } else if (type === "imperial") {
- unit = "°F";
- }
- return `${value} ${unit}`;
- },
- },
};
</script>
-import { VitePWA } from 'vite-plugin-pwa'
+import { VitePWA } from "vite-plugin-pwa";
import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
assetsDir: "resources",
},
plugins: [
- vue(),
- VitePWA({
- registerType: 'autoUpdate',
+ vue(),
+ VitePWA({
+ registerType: "autoUpdate",
useCredentials: true,
manifestFilename: "assets/manifest.json",
manifest: {
- name: 'Homer dashboard',
- short_name: 'Homer',
- description: 'Home Server Dashboard',
- theme_color: '#3367D6',
+ name: "Homer dashboard",
+ short_name: "Homer",
+ description: "Home Server Dashboard",
+ theme_color: "#3367D6",
icons: [
{
- src: 'pwa-192x192.png',
- sizes: '192x192',
- type: 'image/png'
+ src: "pwa-192x192.png",
+ sizes: "192x192",
+ type: "image/png",
},
{
- src: 'pwa-512x512.png',
- sizes: '512x512',
- type: 'image/png'
- }
+ src: "pwa-512x512.png",
+ sizes: "512x512",
+ type: "image/png",
+ },
],
},
- })
+ }),
],
resolve: {
alias: {
},
},
});
-