diff --git a/frontend/bindings/mesh-drop/internal/config/config.ts b/frontend/bindings/mesh-drop/internal/config/config.ts index 3c17c76..eaafb87 100644 --- a/frontend/bindings/mesh-drop/internal/config/config.ts +++ b/frontend/bindings/mesh-drop/internal/config/config.ts @@ -25,6 +25,10 @@ export function GetSavePath(): $CancellablePromise { return $Call.ByID(4081533263); } +export function GetVersion(): $CancellablePromise { + return $Call.ByID(3578438023); +} + /** * Save 保存配置到磁盘 */ diff --git a/frontend/package-lock.json b/frontend/package-lock.json index bb13155..b722c0c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,7 +8,7 @@ "name": "mesh-drop", "version": "0.0.0", "dependencies": { - "@fontsource/roboto": "5.2.7", + "@fontsource-variable/inter": "^5.2.8", "@mdi/font": "7.4.47", "@wailsio/runtime": "^3.0.0-alpha.79", "vue": "^3.5.21", @@ -498,10 +498,10 @@ "node": ">=18" } }, - "node_modules/@fontsource/roboto": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.2.7.tgz", - "integrity": "sha512-fca6Jtyxn6kPR51+TTTMCFm0FOhnKaLEYYiAQc8P/4iFCKoKGR0aX89QR4CfP+N64RPXJus64UxhJaVENnSM6Q==", + "node_modules/@fontsource-variable/inter": { + "version": "5.2.8", + "resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.2.8.tgz", + "integrity": "sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ==", "license": "OFL-1.1", "funding": { "url": "https://github.com/sponsors/ayuhito" diff --git a/frontend/package.json b/frontend/package.json index 4694071..0ffc3d8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,11 +12,11 @@ "type-check": "vue-tsc --build --force" }, "dependencies": { - "@fontsource/roboto": "5.2.7", + "@fontsource-variable/inter": "^5.2.8", "@mdi/font": "7.4.47", + "@wailsio/runtime": "^3.0.0-alpha.79", "vue": "^3.5.21", - "vuetify": "^3.10.1", - "@wailsio/runtime": "^3.0.0-alpha.79" + "vuetify": "^3.10.1" }, "devDependencies": { "@tsconfig/node22": "^22.0.0", @@ -32,4 +32,4 @@ "vite-plugin-vuetify": "^2.1.2", "vue-tsc": "^3.2.0" } -} \ No newline at end of file +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 97724aa..b83f08f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,4 +8,8 @@ import MainLayout from "./components/MainLayout.vue"; - + diff --git a/frontend/src/components/MainLayout.vue b/frontend/src/components/MainLayout.vue index 25cdea6..8db08a8 100644 --- a/frontend/src/components/MainLayout.vue +++ b/frontend/src/components/MainLayout.vue @@ -16,6 +16,7 @@ import { SetAutoAccept, GetSaveHistory, SetSaveHistory, + GetVersion, } from "../../bindings/mesh-drop/internal/config/config"; import { Dialogs } from "@wailsio/runtime"; @@ -43,6 +44,7 @@ onMounted(async () => { hostName.value = await GetHostName(); autoAccept.value = await GetAutoAccept(); saveHistory.value = await GetSaveHistory(); + version.value = await GetVersion(); }); const checkMobile = () => { @@ -56,12 +58,13 @@ const checkMobile = () => { // --- 后端集成 --- onMounted(async () => { peers.value = await GetPeers(); + peers.value = peers.value.sort((a, b) => a.name.localeCompare(b.name)); }); // --- 事件监听 --- - Events.On("peers:update", (event) => { peers.value = event.data; + peers.value = peers.value.sort((a, b) => a.name.localeCompare(b.name)); }); Events.On("transfer:refreshList", async () => { @@ -117,6 +120,7 @@ const changeSavePath = async () => { const hostName = ref(""); const autoAccept = ref(false); const saveHistory = ref(false); +const version = ref(""); // --- 操作 --- @@ -281,6 +285,14 @@ const handleMenuClick = (key: string) => { > + + + + diff --git a/frontend/src/components/PeerCard.vue b/frontend/src/components/PeerCard.vue index c82fe56..23df6c2 100644 --- a/frontend/src/components/PeerCard.vue +++ b/frontend/src/components/PeerCard.vue @@ -225,16 +225,30 @@ const handleSendFiles = () => { -
- -
+ + + + + {{ ip }} + + + No Route diff --git a/frontend/src/main.ts b/frontend/src/main.ts index b62acc8..8376d8d 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -5,19 +5,22 @@ */ // Plugins -import { registerPlugins } from '@/plugins' +import { registerPlugins } from "@/plugins"; // Components -import App from './App.vue' +import App from "./App.vue"; // Composables -import { createApp } from 'vue' +import { createApp } from "vue"; // Styles -import 'unfonts.css' +// import "unfonts.css"; -const app = createApp(App) +// Fonts +import "@fontsource-variable/inter"; -registerPlugins(app) +const app = createApp(App); -app.mount('#app') +registerPlugins(app); + +app.mount("#app"); diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index c1707db..42c3374 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -16,7 +16,13 @@ "DOM" ], "skipLibCheck": true, - "noEmit": true + "noEmit": true, + "baseUrl": ".", + "paths": { + "@/*": [ + "src/*" + ] + } }, "include": [ "src/**/*.ts", diff --git a/frontend/tsconfig.tsbuildinfo b/frontend/tsconfig.tsbuildinfo new file mode 100644 index 0000000..3c2061e --- /dev/null +++ b/frontend/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/main.ts","./src/vite-env.d.ts","./src/plugins/index.ts","./src/plugins/vuetify.ts","./src/App.vue","./src/components/MainLayout.vue","./src/components/PeerCard.vue","./src/components/TransferItem.vue","./bindings/github.com/wailsapp/wails/v3/internal/eventcreate.ts","./bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts","./bindings/mesh-drop/index.ts","./bindings/mesh-drop/models.ts","./bindings/mesh-drop/internal/config/config.ts","./bindings/mesh-drop/internal/config/index.ts","./bindings/mesh-drop/internal/discovery/index.ts","./bindings/mesh-drop/internal/discovery/models.ts","./bindings/mesh-drop/internal/discovery/service.ts","./bindings/mesh-drop/internal/transfer/index.ts","./bindings/mesh-drop/internal/transfer/models.ts","./bindings/mesh-drop/internal/transfer/service.ts","./bindings/time/index.ts","./bindings/time/models.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/frontend/vite.config.mts b/frontend/vite.config.mts index fb10265..5008e7f 100644 --- a/frontend/vite.config.mts +++ b/frontend/vite.config.mts @@ -1,13 +1,13 @@ // Plugins -import Components from 'unplugin-vue-components/vite' -import Vue from '@vitejs/plugin-vue' -import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' -import Fonts from 'unplugin-fonts/vite' +import Components from "unplugin-vue-components/vite"; +import Vue from "@vitejs/plugin-vue"; +import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify"; +import Fonts from "unplugin-fonts/vite"; import wails from "@wailsio/runtime/plugins/vite"; // Utilities -import { defineConfig } from 'vite' -import { fileURLToPath, URL } from 'node:url' +import { defineConfig } from "vite"; +import { fileURLToPath, URL } from "node:url"; // https://vitejs.dev/config/ export default defineConfig({ @@ -19,37 +19,18 @@ export default defineConfig({ // https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme Vuetify(), Components(), - Fonts({ - fontsource: { - families: [ - { - name: 'Roboto', - weights: [100, 300, 400, 500, 700, 900], - styles: ['normal', 'italic'], - }, - ], - }, - }), ], optimizeDeps: { - exclude: ['vuetify'], + exclude: ["vuetify"], }, - define: { 'process.env': {} }, + define: { "process.env": {} }, resolve: { alias: { - '@': fileURLToPath(new URL('src', import.meta.url)), + "@": fileURLToPath(new URL("src", import.meta.url)), }, - extensions: [ - '.js', - '.json', - '.jsx', - '.mjs', - '.ts', - '.tsx', - '.vue', - ], + extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"], }, server: { port: 3000, }, -}) +}); diff --git a/internal/config/config.go b/internal/config/config.go index db9d7d4..8793378 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,6 +19,8 @@ type WindowState struct { Maximised bool `mapstructure:"maximised"` } +const Version = "0.0.1" + type Config struct { v *viper.Viper mu sync.RWMutex @@ -176,3 +178,7 @@ func (c *Config) GetSaveHistory() bool { defer c.mu.RUnlock() return c.SaveHistory } + +func (c *Config) GetVersion() string { + return Version +}