mod: ui
This commit is contained in:
@@ -25,6 +25,10 @@ export function GetSavePath(): $CancellablePromise<string> {
|
|||||||
return $Call.ByID(4081533263);
|
return $Call.ByID(4081533263);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function GetVersion(): $CancellablePromise<string> {
|
||||||
|
return $Call.ByID(3578438023);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save 保存配置到磁盘
|
* Save 保存配置到磁盘
|
||||||
*/
|
*/
|
||||||
|
|||||||
10
frontend/package-lock.json
generated
10
frontend/package-lock.json
generated
@@ -8,7 +8,7 @@
|
|||||||
"name": "mesh-drop",
|
"name": "mesh-drop",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "5.2.7",
|
"@fontsource-variable/inter": "^5.2.8",
|
||||||
"@mdi/font": "7.4.47",
|
"@mdi/font": "7.4.47",
|
||||||
"@wailsio/runtime": "^3.0.0-alpha.79",
|
"@wailsio/runtime": "^3.0.0-alpha.79",
|
||||||
"vue": "^3.5.21",
|
"vue": "^3.5.21",
|
||||||
@@ -498,10 +498,10 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fontsource/roboto": {
|
"node_modules/@fontsource-variable/inter": {
|
||||||
"version": "5.2.7",
|
"version": "5.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.2.8.tgz",
|
||||||
"integrity": "sha512-fca6Jtyxn6kPR51+TTTMCFm0FOhnKaLEYYiAQc8P/4iFCKoKGR0aX89QR4CfP+N64RPXJus64UxhJaVENnSM6Q==",
|
"integrity": "sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ==",
|
||||||
"license": "OFL-1.1",
|
"license": "OFL-1.1",
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/ayuhito"
|
"url": "https://github.com/sponsors/ayuhito"
|
||||||
|
|||||||
@@ -12,11 +12,11 @@
|
|||||||
"type-check": "vue-tsc --build --force"
|
"type-check": "vue-tsc --build --force"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "5.2.7",
|
"@fontsource-variable/inter": "^5.2.8",
|
||||||
"@mdi/font": "7.4.47",
|
"@mdi/font": "7.4.47",
|
||||||
|
"@wailsio/runtime": "^3.0.0-alpha.79",
|
||||||
"vue": "^3.5.21",
|
"vue": "^3.5.21",
|
||||||
"vuetify": "^3.10.1",
|
"vuetify": "^3.10.1"
|
||||||
"@wailsio/runtime": "^3.0.0-alpha.79"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node22": "^22.0.0",
|
"@tsconfig/node22": "^22.0.0",
|
||||||
|
|||||||
@@ -8,4 +8,8 @@ import MainLayout from "./components/MainLayout.vue";
|
|||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style></style>
|
<style>
|
||||||
|
:root {
|
||||||
|
font-family: "Inter Variable", sans-serif;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
SetAutoAccept,
|
SetAutoAccept,
|
||||||
GetSaveHistory,
|
GetSaveHistory,
|
||||||
SetSaveHistory,
|
SetSaveHistory,
|
||||||
|
GetVersion,
|
||||||
} from "../../bindings/mesh-drop/internal/config/config";
|
} from "../../bindings/mesh-drop/internal/config/config";
|
||||||
import { Dialogs } from "@wailsio/runtime";
|
import { Dialogs } from "@wailsio/runtime";
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ onMounted(async () => {
|
|||||||
hostName.value = await GetHostName();
|
hostName.value = await GetHostName();
|
||||||
autoAccept.value = await GetAutoAccept();
|
autoAccept.value = await GetAutoAccept();
|
||||||
saveHistory.value = await GetSaveHistory();
|
saveHistory.value = await GetSaveHistory();
|
||||||
|
version.value = await GetVersion();
|
||||||
});
|
});
|
||||||
|
|
||||||
const checkMobile = () => {
|
const checkMobile = () => {
|
||||||
@@ -56,12 +58,13 @@ const checkMobile = () => {
|
|||||||
// --- 后端集成 ---
|
// --- 后端集成 ---
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
peers.value = await GetPeers();
|
peers.value = await GetPeers();
|
||||||
|
peers.value = peers.value.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
});
|
});
|
||||||
|
|
||||||
// --- 事件监听 ---
|
// --- 事件监听 ---
|
||||||
|
|
||||||
Events.On("peers:update", (event) => {
|
Events.On("peers:update", (event) => {
|
||||||
peers.value = event.data;
|
peers.value = event.data;
|
||||||
|
peers.value = peers.value.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.On("transfer:refreshList", async () => {
|
Events.On("transfer:refreshList", async () => {
|
||||||
@@ -117,6 +120,7 @@ const changeSavePath = async () => {
|
|||||||
const hostName = ref("");
|
const hostName = ref("");
|
||||||
const autoAccept = ref(false);
|
const autoAccept = ref(false);
|
||||||
const saveHistory = ref(false);
|
const saveHistory = ref(false);
|
||||||
|
const version = ref("");
|
||||||
|
|
||||||
// --- 操作 ---
|
// --- 操作 ---
|
||||||
|
|
||||||
@@ -281,6 +285,14 @@ const handleMenuClick = (key: string) => {
|
|||||||
></v-switch
|
></v-switch
|
||||||
></template>
|
></template>
|
||||||
</v-list-item>
|
</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>
|
</v-list>
|
||||||
</div>
|
</div>
|
||||||
</v-container>
|
</v-container>
|
||||||
|
|||||||
@@ -225,16 +225,30 @@ const handleSendFiles = () => {
|
|||||||
</v-chip>
|
</v-chip>
|
||||||
|
|
||||||
<!-- Multiple IP Selector -->
|
<!-- Multiple IP Selector -->
|
||||||
<div v-else-if="ips.length > 1" style="width: 150px">
|
<v-menu v-else-if="ips.length > 1">
|
||||||
<v-select
|
<template #activator="{ props }">
|
||||||
v-model="selectedIp"
|
<v-chip
|
||||||
:items="ips"
|
v-bind="props"
|
||||||
density="compact"
|
size="small"
|
||||||
hide-details
|
color="info"
|
||||||
variant="outlined"
|
label
|
||||||
single-line
|
link
|
||||||
></v-select>
|
append-icon="mdi-menu-down"
|
||||||
</div>
|
>
|
||||||
|
{{ 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 -->
|
<!-- No Route -->
|
||||||
<v-chip v-else color="warning" size="small" label> No Route </v-chip>
|
<v-chip v-else color="warning" size="small" label> No Route </v-chip>
|
||||||
|
|||||||
@@ -5,19 +5,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
import { registerPlugins } from '@/plugins'
|
import { registerPlugins } from "@/plugins";
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import App from './App.vue'
|
import App from "./App.vue";
|
||||||
|
|
||||||
// Composables
|
// Composables
|
||||||
import { createApp } from 'vue'
|
import { createApp } from "vue";
|
||||||
|
|
||||||
// Styles
|
// 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");
|
||||||
|
|||||||
@@ -16,7 +16,13 @@
|
|||||||
"DOM"
|
"DOM"
|
||||||
],
|
],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noEmit": true
|
"noEmit": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
|
|||||||
1
frontend/tsconfig.tsbuildinfo
Normal file
1
frontend/tsconfig.tsbuildinfo
Normal 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"}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
// Plugins
|
// Plugins
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from "unplugin-vue-components/vite";
|
||||||
import Vue from '@vitejs/plugin-vue'
|
import Vue from "@vitejs/plugin-vue";
|
||||||
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
|
||||||
import Fonts from 'unplugin-fonts/vite'
|
import Fonts from "unplugin-fonts/vite";
|
||||||
import wails from "@wailsio/runtime/plugins/vite";
|
import wails from "@wailsio/runtime/plugins/vite";
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from "node:url";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -19,37 +19,18 @@ export default defineConfig({
|
|||||||
// https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
|
// https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
|
||||||
Vuetify(),
|
Vuetify(),
|
||||||
Components(),
|
Components(),
|
||||||
Fonts({
|
|
||||||
fontsource: {
|
|
||||||
families: [
|
|
||||||
{
|
|
||||||
name: 'Roboto',
|
|
||||||
weights: [100, 300, 400, 500, 700, 900],
|
|
||||||
styles: ['normal', 'italic'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: ['vuetify'],
|
exclude: ["vuetify"],
|
||||||
},
|
},
|
||||||
define: { 'process.env': {} },
|
define: { "process.env": {} },
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('src', import.meta.url)),
|
"@": fileURLToPath(new URL("src", import.meta.url)),
|
||||||
},
|
},
|
||||||
extensions: [
|
extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"],
|
||||||
'.js',
|
|
||||||
'.json',
|
|
||||||
'.jsx',
|
|
||||||
'.mjs',
|
|
||||||
'.ts',
|
|
||||||
'.tsx',
|
|
||||||
'.vue',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ type WindowState struct {
|
|||||||
Maximised bool `mapstructure:"maximised"`
|
Maximised bool `mapstructure:"maximised"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Version = "0.0.1"
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
v *viper.Viper
|
v *viper.Viper
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
@@ -176,3 +178,7 @@ func (c *Config) GetSaveHistory() bool {
|
|||||||
defer c.mu.RUnlock()
|
defer c.mu.RUnlock()
|
||||||
return c.SaveHistory
|
return c.SaveHistory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Config) GetVersion() string {
|
||||||
|
return Version
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user