show version
This commit is contained in:
@@ -4,6 +4,8 @@ import ConfigurationView from "./components/config/ConfigurationView.vue";
|
|||||||
import AppSidebar from "./components/sidebar/AppSidebar.vue";
|
import AppSidebar from "./components/sidebar/AppSidebar.vue";
|
||||||
import { useBrowserManager } from "./composables/useBrowserManager";
|
import { useBrowserManager } from "./composables/useBrowserManager";
|
||||||
|
|
||||||
|
const appVersion = __APP_VERSION__;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
activeSection,
|
activeSection,
|
||||||
associatedProfilesModal,
|
associatedProfilesModal,
|
||||||
@@ -106,6 +108,7 @@ const {
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:configs-loading="configsLoading"
|
:configs-loading="configsLoading"
|
||||||
:browser-monogram="browserMonogram"
|
:browser-monogram="browserMonogram"
|
||||||
|
:app-version="appVersion"
|
||||||
@select-browser="selectedBrowserId = $event; page = 'browserData'"
|
@select-browser="selectedBrowserId = $event; page = 'browserData'"
|
||||||
@select-configuration="page = 'configuration'"
|
@select-configuration="page = 'configuration'"
|
||||||
@refresh="refreshAll"
|
@refresh="refreshAll"
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
import { browserIconSrc, configurationIconSrc } from "../../utils/icons";
|
import { browserIconSrc, configurationIconSrc } from "../../utils/icons";
|
||||||
import type { AppPage, BrowserView } from "../../types/browser";
|
import type { AppPage, BrowserView } from "../../types/browser";
|
||||||
|
|
||||||
defineProps<{
|
const props = defineProps<{
|
||||||
browsers: BrowserView[];
|
browsers: BrowserView[];
|
||||||
currentBrowserId: string | null;
|
currentBrowserId: string | null;
|
||||||
page: AppPage;
|
page: AppPage;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
configsLoading: boolean;
|
configsLoading: boolean;
|
||||||
browserMonogram: (browserId: string) => string;
|
browserMonogram: (browserId: string) => string;
|
||||||
|
appVersion: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -78,6 +79,7 @@ const emit = defineEmits<{
|
|||||||
<div class="browser-nav-body">
|
<div class="browser-nav-body">
|
||||||
<strong>配置</strong>
|
<strong>配置</strong>
|
||||||
</div>
|
</div>
|
||||||
|
<span class="utility-version" :title="`版本 ${props.appVersion}`">v{{ props.appVersion }}</span>
|
||||||
</button>
|
</button>
|
||||||
</aside>
|
</aside>
|
||||||
</template>
|
</template>
|
||||||
@@ -255,6 +257,8 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
.sidebar-utility-nav {
|
.sidebar-utility-nav {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
|
position: relative;
|
||||||
|
padding-right: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser-nav-body {
|
.browser-nav-body {
|
||||||
@@ -268,6 +272,18 @@ const emit = defineEmits<{
|
|||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.utility-version {
|
||||||
|
position: absolute;
|
||||||
|
right: 12px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
color: rgba(82, 98, 119, 0.7);
|
||||||
|
font-size: 0.72rem;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.01em;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-empty {
|
.sidebar-empty {
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
|
|||||||
2
src/vite-env.d.ts
vendored
2
src/vite-env.d.ts
vendored
@@ -5,3 +5,5 @@ declare module "*.vue" {
|
|||||||
const component: DefineComponent<{}, {}, any>;
|
const component: DefineComponent<{}, {}, any>;
|
||||||
export default component;
|
export default component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare const __APP_VERSION__: string;
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import vue from "@vitejs/plugin-vue";
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
|
||||||
// @ts-expect-error process is a nodejs global
|
// @ts-expect-error process is a nodejs global
|
||||||
const host = process.env.TAURI_DEV_HOST;
|
const host = process.env.TAURI_DEV_HOST;
|
||||||
|
const packageJson = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf-8"));
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig(async () => ({
|
export default defineConfig(async () => ({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
|
define: {
|
||||||
|
__APP_VERSION__: JSON.stringify(packageJson.version),
|
||||||
|
},
|
||||||
|
|
||||||
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user