Compare commits

...

1 Commits

Author SHA1 Message Date
Cheney
09b170a3f0 V0.1 发布 2025-02-01 18:18:13 +08:00
75 changed files with 7951 additions and 0 deletions

1343
sidecar/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

21
sidecar/package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "src/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev" : "bun src/main.js",
"build": "pkg src/main.js --targets node18-win-x64 --output PFakeUKey-x86_64-pc-windows-msvc.exe"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.19.2",
"kill-port-process": "^3.2.1",
"rimraf": "^5.0.10",
"sm-crypto": "^0.3.13"
}
}

96
sidecar/src/Config.js Normal file
View File

@ -0,0 +1,96 @@
/**
* 配置项
* windows 默认存储在用户 home 目录的 AppData\Local 下的 PFakeUKey 目录
* linux 默认存贮在用户 home 目录的 .PFakeUKey 目录
*/
const os = require("os")
const path = require("path")
const fs = require("fs")
const { rimraf, rimrafSync, native, nativeSync } = require('rimraf')
const defPIN = "12345678"
// 默认配置
let configMap = {
}
// 获取操作系统的名称
const platform = os.platform();
let baseDir = undefined
const userHomeDir = os.homedir();
// 检查操作系统类型
if (platform === 'win32') {
console.log('操作系统是 Windows');
baseDir = path.resolve(userHomeDir, "AppData/Local/PFakeUKey")
} else if (platform === 'linux') {
console.log('操作系统是 Linux');
baseDir = path.resolve(userHomeDir, ".PFakeUKey")
} else {
console.log('暂不支持操作系统 ' + platform );
process.exit(-1)
}
// 检查目录是否存在
// 如果目录不存在创建目录
if (!fs.existsSync(baseDir)) {
// 使用递归创建目录
fs.mkdirSync(baseDir, { recursive: true });
console.log(`目录 ${baseDir} 创建成功`);
} else {
console.log(`目录 ${baseDir} 已存在,无需创建`);
}
const configFile = path.resolve(baseDir, "config.json");
// 判断文件是否存在
// 如果存在读取
try {
if ( fs.existsSync( configFile ) ) {
let json = fs.readFileSync(configFile, "UTF-8")
configMap = JSON.parse(json);
} else {
throw "unexists"
}
} catch ( e ) {
// 如果 不存在/读取异常 用默认值填充
fs.writeFileSync(configFile, JSON.stringify( configMap, null, 4 ))
}
module.exports = {
getFakeUKeyDir(){
let ukeyDir = path.resolve(baseDir, "ukeys")
if ( !fs.existsSync(ukeyDir) ) {
fs.mkdirSync(ukeyDir, { recursive: true });
// 初始化 7 个 key
for ( let i = 0 ; i < 7 ; i++ ) {
let ukey = path.resolve(ukeyDir, "FKey-" + (i + 1));
fs.mkdirSync(ukey);
fs.mkdirSync(path.resolve(ukey, "root"));
fs.writeFileSync(path.resolve(ukey, "pin.txt"), defPIN)
}
}
return ukeyDir;
},
newFakeUKey(name){
let ukeyDir = this.getFakeUKeyDir();
let ukey = path.resolve(ukeyDir, name ? name : "FKey-" + (new Date().getTime()));
fs.mkdirSync(ukey);
fs.mkdirSync(path.resolve(ukey, "root"));
fs.writeFileSync(path.resolve(ukey, "pin.txt"), defPIN)
return ukey;
},
delFakeUKey(name){
let ukeyDir = this.getFakeUKeyDir();
let ukey = path.resolve(ukeyDir, name);
rimrafSync(ukey);
},
getConfig(key) {
return configMap[key]
},
setConfig(key, value) {
configMap[key] = value
fs.writeFileSync(configFile, JSON.stringify( configMap, null, 4 ))
}
}

24
view/.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

7
view/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"Vue.volar",
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer"
]
}

7
view/README.md Normal file
View File

@ -0,0 +1,7 @@
# Tauri + Vue 3
This template should help get you started developing with Tauri + Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)

BIN
view/bun.lockb Normal file

Binary file not shown.

14
view/index.html Normal file
View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + Vue 3 App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

787
view/package-lock.json generated Normal file
View File

@ -0,0 +1,787 @@
{
"name": "fakeukey",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "fakeukey",
"version": "0.1.0",
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"vue": "^3.5.13",
"vue-draggable-next": "^2.2.1",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@tauri-apps/cli": "^2",
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.3"
}
},
"node_modules/@babel/helper-string-parser": {
"version": "7.25.9",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.25.9",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
"version": "7.26.3",
"license": "MIT",
"dependencies": {
"@babel/types": "^7.26.3"
},
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@babel/types": {
"version": "7.26.3",
"license": "MIT",
"dependencies": {
"@babel/helper-string-parser": "^7.25.9",
"@babel/helper-validator-identifier": "^7.25.9"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.24.0",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.5.0",
"license": "MIT"
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.28.1",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@tauri-apps/api": {
"version": "2.1.1",
"license": "Apache-2.0 OR MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/tauri"
}
},
"node_modules/@tauri-apps/cli": {
"version": "2.1.0",
"dev": true,
"license": "Apache-2.0 OR MIT",
"bin": {
"tauri": "tauri.js"
},
"engines": {
"node": ">= 10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/tauri"
},
"optionalDependencies": {
"@tauri-apps/cli-darwin-arm64": "2.1.0",
"@tauri-apps/cli-darwin-x64": "2.1.0",
"@tauri-apps/cli-linux-arm-gnueabihf": "2.1.0",
"@tauri-apps/cli-linux-arm64-gnu": "2.1.0",
"@tauri-apps/cli-linux-arm64-musl": "2.1.0",
"@tauri-apps/cli-linux-x64-gnu": "2.1.0",
"@tauri-apps/cli-linux-x64-musl": "2.1.0",
"@tauri-apps/cli-win32-arm64-msvc": "2.1.0",
"@tauri-apps/cli-win32-ia32-msvc": "2.1.0",
"@tauri-apps/cli-win32-x64-msvc": "2.1.0"
}
},
"node_modules/@tauri-apps/cli-win32-x64-msvc": {
"version": "2.1.0",
"cpu": [
"x64"
],
"dev": true,
"license": "Apache-2.0 OR MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tauri-apps/plugin-opener": {
"version": "2.2.2",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.0.0"
}
},
"node_modules/@types/estree": {
"version": "1.0.6",
"dev": true,
"license": "MIT"
},
"node_modules/@vitejs/plugin-vue": {
"version": "5.2.1",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0 || ^6.0.0",
"vue": "^3.2.25"
}
},
"node_modules/@vue/compiler-core": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.25.3",
"@vue/shared": "3.5.13",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.2.0"
}
},
"node_modules/@vue/compiler-dom": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/compiler-core": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.25.3",
"@vue/compiler-core": "3.5.13",
"@vue/compiler-dom": "3.5.13",
"@vue/compiler-ssr": "3.5.13",
"@vue/shared": "3.5.13",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.11",
"postcss": "^8.4.48",
"source-map-js": "^1.2.0"
}
},
"node_modules/@vue/compiler-ssr": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"node_modules/@vue/reactivity": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/shared": "3.5.13"
}
},
"node_modules/@vue/runtime-core": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/reactivity": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"node_modules/@vue/runtime-dom": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/reactivity": "3.5.13",
"@vue/runtime-core": "3.5.13",
"@vue/shared": "3.5.13",
"csstype": "^3.1.3"
}
},
"node_modules/@vue/server-renderer": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/compiler-ssr": "3.5.13",
"@vue/shared": "3.5.13"
},
"peerDependencies": {
"vue": "3.5.13"
}
},
"node_modules/@vue/shared": {
"version": "3.5.13",
"license": "MIT"
},
"node_modules/csstype": {
"version": "3.1.3",
"license": "MIT"
},
"node_modules/entities": {
"version": "4.5.0",
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.12"
},
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/esbuild": {
"version": "0.24.0",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.24.0",
"@esbuild/android-arm": "0.24.0",
"@esbuild/android-arm64": "0.24.0",
"@esbuild/android-x64": "0.24.0",
"@esbuild/darwin-arm64": "0.24.0",
"@esbuild/darwin-x64": "0.24.0",
"@esbuild/freebsd-arm64": "0.24.0",
"@esbuild/freebsd-x64": "0.24.0",
"@esbuild/linux-arm": "0.24.0",
"@esbuild/linux-arm64": "0.24.0",
"@esbuild/linux-ia32": "0.24.0",
"@esbuild/linux-loong64": "0.24.0",
"@esbuild/linux-mips64el": "0.24.0",
"@esbuild/linux-ppc64": "0.24.0",
"@esbuild/linux-riscv64": "0.24.0",
"@esbuild/linux-s390x": "0.24.0",
"@esbuild/linux-x64": "0.24.0",
"@esbuild/netbsd-x64": "0.24.0",
"@esbuild/openbsd-arm64": "0.24.0",
"@esbuild/openbsd-x64": "0.24.0",
"@esbuild/sunos-x64": "0.24.0",
"@esbuild/win32-arm64": "0.24.0",
"@esbuild/win32-ia32": "0.24.0",
"@esbuild/win32-x64": "0.24.0"
}
},
"node_modules/estree-walker": {
"version": "2.0.2",
"license": "MIT"
},
"node_modules/magic-string": {
"version": "0.30.17",
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
"node_modules/nanoid": {
"version": "3.3.8",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"license": "ISC"
},
"node_modules/postcss": {
"version": "8.4.49",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/rollup": {
"version": "4.28.1",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "1.0.6"
},
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.28.1",
"@rollup/rollup-android-arm64": "4.28.1",
"@rollup/rollup-darwin-arm64": "4.28.1",
"@rollup/rollup-darwin-x64": "4.28.1",
"@rollup/rollup-freebsd-arm64": "4.28.1",
"@rollup/rollup-freebsd-x64": "4.28.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.28.1",
"@rollup/rollup-linux-arm-musleabihf": "4.28.1",
"@rollup/rollup-linux-arm64-gnu": "4.28.1",
"@rollup/rollup-linux-arm64-musl": "4.28.1",
"@rollup/rollup-linux-loongarch64-gnu": "4.28.1",
"@rollup/rollup-linux-powerpc64le-gnu": "4.28.1",
"@rollup/rollup-linux-riscv64-gnu": "4.28.1",
"@rollup/rollup-linux-s390x-gnu": "4.28.1",
"@rollup/rollup-linux-x64-gnu": "4.28.1",
"@rollup/rollup-linux-x64-musl": "4.28.1",
"@rollup/rollup-win32-arm64-msvc": "4.28.1",
"@rollup/rollup-win32-ia32-msvc": "4.28.1",
"@rollup/rollup-win32-x64-msvc": "4.28.1",
"fsevents": "~2.3.2"
}
},
"node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"node_modules/source-map-js": {
"version": "1.2.1",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vite": {
"version": "6.0.3",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.24.0",
"postcss": "^8.4.49",
"rollup": "^4.23.0"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"jiti": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
}
},
"node_modules/vue": {
"version": "3.5.13",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.5.13",
"@vue/compiler-sfc": "3.5.13",
"@vue/runtime-dom": "3.5.13",
"@vue/server-renderer": "3.5.13",
"@vue/shared": "3.5.13"
},
"peerDependencies": {
"typescript": "*"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/vue-draggable-next": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/vue-draggable-next/-/vue-draggable-next-2.2.1.tgz",
"integrity": "sha512-EAMS1IRHF0kZO0o5PMOinsQsXIqsrKT1hKmbICxG3UEtn7zLFkLxlAtajcCcUTisNvQ6TtCB5COjD9a1raNADw==",
"peerDependencies": {
"sortablejs": "^1.14.0",
"vue": "^3.2.2"
}
},
"node_modules/vuedraggable": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-4.1.0.tgz",
"integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==",
"dependencies": {
"sortablejs": "1.14.0"
},
"peerDependencies": {
"vue": "^3.0.1"
}
}
},
"dependencies": {
"@babel/helper-string-parser": {
"version": "7.25.9"
},
"@babel/helper-validator-identifier": {
"version": "7.25.9"
},
"@babel/parser": {
"version": "7.26.3",
"requires": {
"@babel/types": "^7.26.3"
}
},
"@babel/types": {
"version": "7.26.3",
"requires": {
"@babel/helper-string-parser": "^7.25.9",
"@babel/helper-validator-identifier": "^7.25.9"
}
},
"@esbuild/win32-x64": {
"version": "0.24.0",
"dev": true,
"optional": true
},
"@jridgewell/sourcemap-codec": {
"version": "1.5.0"
},
"@rollup/rollup-win32-x64-msvc": {
"version": "4.28.1",
"dev": true,
"optional": true
},
"@tauri-apps/api": {
"version": "2.1.1"
},
"@tauri-apps/cli": {
"version": "2.1.0",
"dev": true,
"requires": {
"@tauri-apps/cli-darwin-arm64": "2.1.0",
"@tauri-apps/cli-darwin-x64": "2.1.0",
"@tauri-apps/cli-linux-arm-gnueabihf": "2.1.0",
"@tauri-apps/cli-linux-arm64-gnu": "2.1.0",
"@tauri-apps/cli-linux-arm64-musl": "2.1.0",
"@tauri-apps/cli-linux-x64-gnu": "2.1.0",
"@tauri-apps/cli-linux-x64-musl": "2.1.0",
"@tauri-apps/cli-win32-arm64-msvc": "2.1.0",
"@tauri-apps/cli-win32-ia32-msvc": "2.1.0",
"@tauri-apps/cli-win32-x64-msvc": "2.1.0"
}
},
"@tauri-apps/cli-win32-x64-msvc": {
"version": "2.1.0",
"dev": true,
"optional": true
},
"@tauri-apps/plugin-opener": {
"version": "2.2.2",
"requires": {
"@tauri-apps/api": "^2.0.0"
}
},
"@types/estree": {
"version": "1.0.6",
"dev": true
},
"@vitejs/plugin-vue": {
"version": "5.2.1",
"dev": true,
"requires": {}
},
"@vue/compiler-core": {
"version": "3.5.13",
"requires": {
"@babel/parser": "^7.25.3",
"@vue/shared": "3.5.13",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.2.0"
}
},
"@vue/compiler-dom": {
"version": "3.5.13",
"requires": {
"@vue/compiler-core": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"@vue/compiler-sfc": {
"version": "3.5.13",
"requires": {
"@babel/parser": "^7.25.3",
"@vue/compiler-core": "3.5.13",
"@vue/compiler-dom": "3.5.13",
"@vue/compiler-ssr": "3.5.13",
"@vue/shared": "3.5.13",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.11",
"postcss": "^8.4.48",
"source-map-js": "^1.2.0"
}
},
"@vue/compiler-ssr": {
"version": "3.5.13",
"requires": {
"@vue/compiler-dom": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"@vue/reactivity": {
"version": "3.5.13",
"requires": {
"@vue/shared": "3.5.13"
}
},
"@vue/runtime-core": {
"version": "3.5.13",
"requires": {
"@vue/reactivity": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"@vue/runtime-dom": {
"version": "3.5.13",
"requires": {
"@vue/reactivity": "3.5.13",
"@vue/runtime-core": "3.5.13",
"@vue/shared": "3.5.13",
"csstype": "^3.1.3"
}
},
"@vue/server-renderer": {
"version": "3.5.13",
"requires": {
"@vue/compiler-ssr": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"@vue/shared": {
"version": "3.5.13"
},
"csstype": {
"version": "3.1.3"
},
"entities": {
"version": "4.5.0"
},
"esbuild": {
"version": "0.24.0",
"dev": true,
"requires": {
"@esbuild/aix-ppc64": "0.24.0",
"@esbuild/android-arm": "0.24.0",
"@esbuild/android-arm64": "0.24.0",
"@esbuild/android-x64": "0.24.0",
"@esbuild/darwin-arm64": "0.24.0",
"@esbuild/darwin-x64": "0.24.0",
"@esbuild/freebsd-arm64": "0.24.0",
"@esbuild/freebsd-x64": "0.24.0",
"@esbuild/linux-arm": "0.24.0",
"@esbuild/linux-arm64": "0.24.0",
"@esbuild/linux-ia32": "0.24.0",
"@esbuild/linux-loong64": "0.24.0",
"@esbuild/linux-mips64el": "0.24.0",
"@esbuild/linux-ppc64": "0.24.0",
"@esbuild/linux-riscv64": "0.24.0",
"@esbuild/linux-s390x": "0.24.0",
"@esbuild/linux-x64": "0.24.0",
"@esbuild/netbsd-x64": "0.24.0",
"@esbuild/openbsd-arm64": "0.24.0",
"@esbuild/openbsd-x64": "0.24.0",
"@esbuild/sunos-x64": "0.24.0",
"@esbuild/win32-arm64": "0.24.0",
"@esbuild/win32-ia32": "0.24.0",
"@esbuild/win32-x64": "0.24.0"
}
},
"estree-walker": {
"version": "2.0.2"
},
"magic-string": {
"version": "0.30.17",
"requires": {
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
"nanoid": {
"version": "3.3.8"
},
"picocolors": {
"version": "1.1.1"
},
"postcss": {
"version": "8.4.49",
"requires": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
}
},
"rollup": {
"version": "4.28.1",
"dev": true,
"requires": {
"@rollup/rollup-android-arm-eabi": "4.28.1",
"@rollup/rollup-android-arm64": "4.28.1",
"@rollup/rollup-darwin-arm64": "4.28.1",
"@rollup/rollup-darwin-x64": "4.28.1",
"@rollup/rollup-freebsd-arm64": "4.28.1",
"@rollup/rollup-freebsd-x64": "4.28.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.28.1",
"@rollup/rollup-linux-arm-musleabihf": "4.28.1",
"@rollup/rollup-linux-arm64-gnu": "4.28.1",
"@rollup/rollup-linux-arm64-musl": "4.28.1",
"@rollup/rollup-linux-loongarch64-gnu": "4.28.1",
"@rollup/rollup-linux-powerpc64le-gnu": "4.28.1",
"@rollup/rollup-linux-riscv64-gnu": "4.28.1",
"@rollup/rollup-linux-s390x-gnu": "4.28.1",
"@rollup/rollup-linux-x64-gnu": "4.28.1",
"@rollup/rollup-linux-x64-musl": "4.28.1",
"@rollup/rollup-win32-arm64-msvc": "4.28.1",
"@rollup/rollup-win32-ia32-msvc": "4.28.1",
"@rollup/rollup-win32-x64-msvc": "4.28.1",
"@types/estree": "1.0.6",
"fsevents": "~2.3.2"
}
},
"sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
},
"source-map-js": {
"version": "1.2.1"
},
"vite": {
"version": "6.0.3",
"dev": true,
"requires": {
"esbuild": "^0.24.0",
"fsevents": "~2.3.3",
"postcss": "^8.4.49",
"rollup": "^4.23.0"
}
},
"vue": {
"version": "3.5.13",
"requires": {
"@vue/compiler-dom": "3.5.13",
"@vue/compiler-sfc": "3.5.13",
"@vue/runtime-dom": "3.5.13",
"@vue/server-renderer": "3.5.13",
"@vue/shared": "3.5.13"
}
},
"vue-draggable-next": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/vue-draggable-next/-/vue-draggable-next-2.2.1.tgz",
"integrity": "sha512-EAMS1IRHF0kZO0o5PMOinsQsXIqsrKT1hKmbICxG3UEtn7zLFkLxlAtajcCcUTisNvQ6TtCB5COjD9a1raNADw==",
"requires": {}
},
"vuedraggable": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-4.1.0.tgz",
"integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==",
"requires": {
"sortablejs": "1.14.0"
}
}
}
}

28
view/package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "fakeukey",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tauri-apps/plugin-process": "~2",
"@tauri-apps/plugin-shell": "~2",
"axios": "^1.7.9",
"qs": "^6.13.1",
"vue": "^3.5.13",
"vue-draggable-next": "^2.2.1",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@tauri-apps/cli": "^2",
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.3"
}
}

BIN
view/public/fakeukey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

6
view/public/tauri.svg Normal file
View File

@ -0,0 +1,6 @@
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

1
view/public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

7
view/src-tauri/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas

5109
view/src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

27
view/src-tauri/Cargo.toml Normal file
View File

@ -0,0 +1,27 @@
[package]
name = "fakeukey"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "fakeukey_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = ["tray-icon"] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-shell = "2"
tauri-plugin-process = "2"

3
view/src-tauri/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

View File

@ -0,0 +1,20 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"permissions": [
"core:default",
"opener:default",
"shell:allow-execute",
"core:app:allow-default-window-icon",
"core:window:allow-close",
"core:window:allow-show",
"core:window:allow-hide",
"process:default",
"shell:default",
"shell:default"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

15
view/src-tauri/src/lib.rs Normal file
View File

@ -0,0 +1,15 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@ -0,0 +1,13 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// use tauri_plugin_process::ProcessPlugin;
fn main() {
// fakeukey_lib::run()
// .plugin(tauri_plugin_process::init())
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_process::init()) // 初始化 Process 插件
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@ -0,0 +1,39 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "fakeukey",
"version": "0.1.0",
"identifier": "com.fakeukey.app",
"build": {
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "fakeukey",
"width": 1000,
"height": 500,
"resizable": false,
"maximizable": false,
"minimizable": false
}
],
"security": {
"csp": null
}
},
"bundle": {
"externalBin": ["sidecar/PFakeUKey"],
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

348
view/src/App.vue Normal file
View File

@ -0,0 +1,348 @@
<script setup>
import {ref} from "vue";
import {invoke} from "@tauri-apps/api/core";
import {VueDraggableNext as draggable, VueDraggableNext} from "vue-draggable-next";
import { onMounted } from "vue";
import * as Api from "./api";
import {getVersion} from "./api";
// tauri sidecar
import { Command } from '@tauri-apps/plugin-shell';
import { TrayIcon } from '@tauri-apps/api/tray';
import { defaultWindowIcon } from '@tauri-apps/api/app';
import { Menu } from '@tauri-apps/api/menu';
import { getCurrentWindow } from "@tauri-apps/api/window";
import { TauriEvent } from '@tauri-apps/api/event';
import { exit } from '@tauri-apps/plugin-process';
// import { appWindow } from '@tauri-apps/api/window';
const appWindow = getCurrentWindow();
const greetMsg = ref("");
const name = ref("");
const dragging = ref(false);
const items = ref([]);
const version = ref("");
onMounted(async () => {
console.log("Component has been mounted!");
init()
sidecar()
setTimeout(()=>{
init_ui()
refresh()
}, 1000)
});
async function sidecar(){
const command = Command.sidecar("sidecar/PFakeUKey")
console.log("command ", command)
const output = await command.execute()
console.log(output)
}
async function init_ui(){
version.value = "V" + (await getVersion()).version;
}
async function init(){
// const appWindow = getCurrentWindow();
appWindow.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async (event) => {
// event.preventDefault();
await appWindow.hide()
console.log("windows close")
});
appWindow.listen(TauriEvent.WINDOW_RESIZED, (event) => {
// event.preventDefault();
console.log("windows resize")
});
const menu = await Menu.new({
items: [
{
id: 'quit',
text: '退出',
action: async () => {
console.log('quit pressed');
await appWindow.close()
console.log("windows close")
await exit()
console.log("exit")
},
},
],
});
const options = {
action: (event) => {
switch (event.type) {
case 'DoubleClick':
console.log(`mouse ${event.button} button pressed`);
appWindow.show();
break;
}
},
icon: await defaultWindowIcon(),
menu,
};
const tray = await TrayIcon.new(options);
}
async function refresh() {
items.value = [];
let data = await Api.getList();
if ( data.fakeList ) {
for ( let fukey of data.fakeList ) {
items.value.push({
id: fukey,
icon: 'fakeukey.png',
type: 'fukey'
});
}
}
if ( data.ukeyList ) {
for ( let ukey of data.ukeyList ) {
items.value.push({
id: ukey,
icon: 'ukey.png',
type: 'ukey'
});
}
}
}
async function addItem() {
await Api.addFakeUkey();
refresh();
// items.value.push({id: Date.now(), icon: 'ukey.png'});
}
function enableItem(index) {
// Logic to enable the item
}
function disableItem(index) {
// Logic to disable the item
}
function deleteItem(index) {
let item = items.value[index];
items.value.splice(index, 1);
Api.delFakeUkey(item.id)
}
function debugItem(index) {
// Logic to debug the item
}
function checkMovefunction(e) {
window.console.log("Future index: " + e.draggedContext.futureIndex);
}
const players = ref([
{name: 'curry', id: 1},
{name: 'klay', id: 2},
{name: 'green', id: 3},
{name: 'kobe', id: 4},
{name: 'james', id: 5},
{name: 'jordan', id: 6},
{name: 'dear', id: 7},
{name: 'muse', id: 8}
])
</script>
<template>
<main class="container">
<p>
<span> {{ version }} </span>
<span style="color: coral"> 禁止用于测试环境和生产环境!!!</span>
</p>
<div class="grid-container">
<VueDraggableNext v-model="items" class="grid" draggable=".item">
<div v-for="(item, index) in items" :key="item.id" class="item grid-item">
<span>ID : {{ item.id }}</span>
<img :src="item.icon" alt="ukey icon" style="width: 70%; height: auto;"/>
<div class="item-actions">
<!-- <button @click="enableItem(index)">启用</button>-->
<!-- <button @click="disableItem(index)">禁用</button>-->
<button @click="deleteItem(index)">删除</button>
</div>
</div>
<div class="grid-item" style="cursor: pointer" @click="addItem">
<img src="/add.png" alt="add ukey icon" style="width: 70%; height: auto; padding-bottom: 2rem"/>
<span>新建 UKey</span>
</div>
</VueDraggableNext>
</div>
</main>
</template>
<style scoped>
.grid-container {
display: flex;
flex-direction: row;
align-items: left;
width: 100%;
}
.grid {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.grid-item {
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #fff;
cursor: move;
width: 200px;
height: 200px;
padding: 1rem;
}
.item-actions {
margin-top: 5px;
display: flex;
gap: 2px;
font-size: 10px;
}
</style>
<style scoped>
.logo.vite:hover {
filter: drop-shadow(0 0 2em #747bff);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #249b73);
}
</style>
<style>
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color: #0f0f0f;
background-color: #f6f6f6;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
.container {
margin: 0;
padding-top: 10vh;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: 0.75s;
}
.logo.tauri:hover {
filter: drop-shadow(0 0 2em #24c8db);
}
.row {
display: flex;
justify-content: center;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
h1 {
text-align: center;
}
input,
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
color: #0f0f0f;
background-color: #ffffff;
transition: border-color 0.25s;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
button {
cursor: pointer;
}
button:hover {
border-color: #396cd8;
}
button:active {
border-color: #396cd8;
background-color: #e8e8e8;
}
input,
button {
outline: none;
}
#greet-input {
margin-right: 5px;
}
@media (prefers-color-scheme: dark) {
:root {
color: #f6f6f6;
background-color: #2f2f2f;
}
a:hover {
color: #24c8db;
}
input,
button {
color: #ffffff;
background-color: #0f0f0f98;
}
button:active {
background-color: #0f0f0f69;
}
}
</style>

1
view/src/assets/vue.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

4
view/src/main.js Normal file
View File

@ -0,0 +1,4 @@
import { createApp } from "vue";
import App from "./App.vue";
createApp(App).mount("#app");

31
view/vite.config.js Normal file
View File

@ -0,0 +1,31 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
const host = process.env.TAURI_DEV_HOST;
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [vue()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));