mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-08 02:52:49 +00:00
feat: version and issue url
This commit is contained in:
@@ -60,6 +60,8 @@ const config: IconsConfig = {
|
|||||||
"play_arrow",
|
"play_arrow",
|
||||||
"extension",
|
"extension",
|
||||||
"upload_file",
|
"upload_file",
|
||||||
|
"commit",
|
||||||
|
"bug_report",
|
||||||
],
|
],
|
||||||
codePoints: {
|
codePoints: {
|
||||||
speed: "e9e4",
|
speed: "e9e4",
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Theaninova/amacc1ng.git"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Theaninova/amacc1ng",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Theaninova/amacc1ng/issues"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm-run-all --parallel vite typesafe-i18n",
|
"dev": "npm-run-all --parallel vite typesafe-i18n",
|
||||||
"dev:tauri": "tauri dev",
|
"dev:tauri": "tauri dev",
|
||||||
|
|||||||
3
src/env.d.ts
vendored
3
src/env.d.ts
vendored
@@ -12,3 +12,6 @@ interface ImportMetaEnv {
|
|||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
readonly env: ImportMetaEnv
|
readonly env: ImportMetaEnv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare const HOMEPAGE_URL: string
|
||||||
|
declare const BUGS_URL: string
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
import {loadLocale} from "../i18n/i18n-util.sync"
|
import {loadLocale} from "../i18n/i18n-util.sync"
|
||||||
import {detectLocale} from "../i18n/i18n-util"
|
import {detectLocale} from "../i18n/i18n-util"
|
||||||
import type {Locales} from "../i18n/i18n-types"
|
import type {Locales} from "../i18n/i18n-types"
|
||||||
|
import Footer from "./Footer.svelte"
|
||||||
|
|
||||||
const locale = ((browser && localStorage.getItem("locale")) as Locales) || detectLocale()
|
const locale = ((browser && localStorage.getItem("locale")) as Locales) || detectLocale()
|
||||||
loadLocale(locale)
|
loadLocale(locale)
|
||||||
@@ -68,6 +69,8 @@
|
|||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
|
|
||||||
{#if import.meta.env.TAURI_FAMILY === undefined && browser && !("serial" in navigator)}
|
{#if import.meta.env.TAURI_FAMILY === undefined && browser && !("serial" in navigator)}
|
||||||
<BrowserWarning />
|
<BrowserWarning />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
43
src/routes/Footer.svelte
Normal file
43
src/routes/Footer.svelte
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<script>
|
||||||
|
import {version} from "$app/environment"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href={HOMEPAGE_URL} rel="noreferrer" target="_blank"><span class="icon">commit</span> v{version}</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={BUGS_URL} rel="noreferrer" target="_blank"
|
||||||
|
><span class="icon">bug_report</span> File an issue</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
font-size: 12px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,12 +1,19 @@
|
|||||||
import adapter from "@sveltejs/adapter-static"
|
import adapter from "@sveltejs/adapter-static"
|
||||||
import preprocess from "svelte-preprocess"
|
import preprocess from "svelte-preprocess"
|
||||||
import autoprefixer from "autoprefixer"
|
import autoprefixer from "autoprefixer"
|
||||||
|
import {readFile} from "fs/promises"
|
||||||
|
import {fileURLToPath} from "url"
|
||||||
|
|
||||||
|
const {version} = JSON.parse(await readFile(fileURLToPath(new URL("package.json", import.meta.url)), "utf8"))
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
preprocess: [preprocess({postcss: {plugins: autoprefixer()}})],
|
preprocess: [preprocess({postcss: {plugins: autoprefixer()}})],
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
|
version: {
|
||||||
|
name: version,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,14 @@ import {sveltekit} from "@sveltejs/kit/vite"
|
|||||||
import {defineConfig} from "vite"
|
import {defineConfig} from "vite"
|
||||||
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
||||||
import ViteYaml from "@modyfi/vite-plugin-yaml"
|
import ViteYaml from "@modyfi/vite-plugin-yaml"
|
||||||
|
import {readFile} from "fs/promises"
|
||||||
|
import {fileURLToPath} from "url"
|
||||||
|
|
||||||
const isTauri = "TAURI_FAMILY" in process.env
|
const isTauri = "TAURI_FAMILY" in process.env
|
||||||
console.info(isTauri ? "Building for Tauri" : "Building for PWA")
|
console.info(isTauri ? "Building for Tauri" : "Building for PWA")
|
||||||
|
const {homepage, bugs} = JSON.parse(
|
||||||
|
await readFile(fileURLToPath(new URL("package.json", import.meta.url)), "utf8"),
|
||||||
|
)
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
@@ -16,6 +21,10 @@ export default defineConfig({
|
|||||||
external: isTauri ? [/virtual:pwa.*/] : [],
|
external: isTauri ? [/virtual:pwa.*/] : [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
define: {
|
||||||
|
HOMEPAGE_URL: `"${homepage}"`,
|
||||||
|
BUGS_URL: `"${bugs.url}"`,
|
||||||
|
},
|
||||||
envPrefix: "TAURI_",
|
envPrefix: "TAURI_",
|
||||||
plugins: [
|
plugins: [
|
||||||
ViteYaml(),
|
ViteYaml(),
|
||||||
|
|||||||
Reference in New Issue
Block a user