This commit is contained in:
2026-02-05 00:47:48 +08:00
parent e862f8deec
commit 3588c49d7d
11 changed files with 90 additions and 59 deletions

View File

@@ -25,6 +25,10 @@ export function GetSavePath(): $CancellablePromise<string> {
return $Call.ByID(4081533263);
}
export function GetVersion(): $CancellablePromise<string> {
return $Call.ByID(3578438023);
}
/**
* Save 保存配置到磁盘
*/

View File

@@ -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"

View File

@@ -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",

View File

@@ -8,4 +8,8 @@ import MainLayout from "./components/MainLayout.vue";
</v-app>
</template>
<style></style>
<style>
:root {
font-family: "Inter Variable", sans-serif;
}
</style>

View File

@@ -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) => {
></v-switch
></template>
</v-list-item>
<v-list-item title="Version">
<template #prepend>
<v-icon icon="mdi-information"></v-icon>
</template>
<template #append
><div class="text-grey">{{ version }}</div></template
>
</v-list-item>
</v-list>
</div>
</v-container>

View File

@@ -225,16 +225,30 @@ const handleSendFiles = () => {
</v-chip>
<!-- Multiple IP Selector -->
<div v-else-if="ips.length > 1" style="width: 150px">
<v-select
v-model="selectedIp"
:items="ips"
density="compact"
hide-details
variant="outlined"
single-line
></v-select>
</div>
<v-menu v-else-if="ips.length > 1">
<template #activator="{ props }">
<v-chip
v-bind="props"
size="small"
color="info"
label
link
append-icon="mdi-menu-down"
>
{{ selectedIp }}
</v-chip>
</template>
<v-list density="compact">
<v-list-item
v-for="ip in ips"
:key="ip"
:value="ip"
@click="selectedIp = ip"
>
<v-list-item-title>{{ ip }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<!-- No Route -->
<v-chip v-else color="warning" size="small" label> No Route </v-chip>

View File

@@ -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");

View File

@@ -16,7 +16,13 @@
"DOM"
],
"skipLibCheck": true,
"noEmit": true
"noEmit": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": [
"src/**/*.ts",

View File

@@ -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"}

View File

@@ -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,
},
})
});

View File

@@ -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
}