From 9a87b24a142e1051b795347beb0c3108de21645c Mon Sep 17 00:00:00 2001 From: Purp1e <438518244@qq.com> Date: Thu, 13 Mar 2025 17:53:02 +0800 Subject: [PATCH] [chore] update styles and remove path select tests at launch page --- src-tauri/gen/schemas/macOS-schema.json | 337 +++++++++++++++++++++++- src/app/globals.css | 1 + src/app/layout.tsx | 2 +- src/app/page.tsx | 36 +-- src/components/cstb/CommonDir.tsx | 20 +- 5 files changed, 364 insertions(+), 32 deletions(-) diff --git a/src-tauri/gen/schemas/macOS-schema.json b/src-tauri/gen/schemas/macOS-schema.json index 5ee568d..bf054d0 100644 --- a/src-tauri/gen/schemas/macOS-schema.json +++ b/src-tauri/gen/schemas/macOS-schema.json @@ -140,7 +140,7 @@ "identifier": { "anyOf": [ { - "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", + "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n", "type": "string", "const": "fs:default" }, @@ -984,6 +984,11 @@ "type": "string", "const": "fs:allow-seek" }, + { + "description": "Enables the size command without any pre-configured scope.", + "type": "string", + "const": "fs:allow-size" + }, { "description": "Enables the stat command without any pre-configured scope.", "type": "string", @@ -1109,6 +1114,11 @@ "type": "string", "const": "fs:deny-seek" }, + { + "description": "Denies the size command without any pre-configured scope.", + "type": "string", + "const": "fs:deny-size" + }, { "description": "Denies the stat command without any pre-configured scope.", "type": "string", @@ -1581,7 +1591,7 @@ "description": "FS scope entry.", "anyOf": [ { - "description": "FS scope path.", + "description": "A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" }, { @@ -1591,7 +1601,7 @@ ], "properties": { "path": { - "description": "FS scope path.", + "description": "A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" } } @@ -1605,7 +1615,7 @@ "description": "FS scope entry.", "anyOf": [ { - "description": "FS scope path.", + "description": "A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" }, { @@ -1615,7 +1625,7 @@ ], "properties": { "path": { - "description": "FS scope path.", + "description": "A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" } } @@ -2719,6 +2729,11 @@ "type": "string", "const": "core:webview:allow-reparent" }, + { + "description": "Enables the set_webview_background_color command without any pre-configured scope.", + "type": "string", + "const": "core:webview:allow-set-webview-background-color" + }, { "description": "Enables the set_webview_focus command without any pre-configured scope.", "type": "string", @@ -2799,6 +2814,11 @@ "type": "string", "const": "core:webview:deny-reparent" }, + { + "description": "Denies the set_webview_background_color command without any pre-configured scope.", + "type": "string", + "const": "core:webview:deny-set-webview-background-color" + }, { "description": "Denies the set_webview_focus command without any pre-configured scope.", "type": "string", @@ -3014,6 +3034,21 @@ "type": "string", "const": "core:window:allow-set-always-on-top" }, + { + "description": "Enables the set_background_color command without any pre-configured scope.", + "type": "string", + "const": "core:window:allow-set-background-color" + }, + { + "description": "Enables the set_badge_count command without any pre-configured scope.", + "type": "string", + "const": "core:window:allow-set-badge-count" + }, + { + "description": "Enables the set_badge_label command without any pre-configured scope.", + "type": "string", + "const": "core:window:allow-set-badge-label" + }, { "description": "Enables the set_closable command without any pre-configured scope.", "type": "string", @@ -3099,6 +3134,11 @@ "type": "string", "const": "core:window:allow-set-minimizable" }, + { + "description": "Enables the set_overlay_icon command without any pre-configured scope.", + "type": "string", + "const": "core:window:allow-set-overlay-icon" + }, { "description": "Enables the set_position command without any pre-configured scope.", "type": "string", @@ -3359,6 +3399,21 @@ "type": "string", "const": "core:window:deny-set-always-on-top" }, + { + "description": "Denies the set_background_color command without any pre-configured scope.", + "type": "string", + "const": "core:window:deny-set-background-color" + }, + { + "description": "Denies the set_badge_count command without any pre-configured scope.", + "type": "string", + "const": "core:window:deny-set-badge-count" + }, + { + "description": "Denies the set_badge_label command without any pre-configured scope.", + "type": "string", + "const": "core:window:deny-set-badge-label" + }, { "description": "Denies the set_closable command without any pre-configured scope.", "type": "string", @@ -3444,6 +3499,11 @@ "type": "string", "const": "core:window:deny-set-minimizable" }, + { + "description": "Denies the set_overlay_icon command without any pre-configured scope.", + "type": "string", + "const": "core:window:deny-set-overlay-icon" + }, { "description": "Denies the set_position command without any pre-configured scope.", "type": "string", @@ -3595,7 +3655,7 @@ "const": "dialog:deny-save" }, { - "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", + "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n", "type": "string", "const": "fs:default" }, @@ -4439,6 +4499,11 @@ "type": "string", "const": "fs:allow-seek" }, + { + "description": "Enables the size command without any pre-configured scope.", + "type": "string", + "const": "fs:allow-size" + }, { "description": "Enables the stat command without any pre-configured scope.", "type": "string", @@ -4564,6 +4629,11 @@ "type": "string", "const": "fs:deny-seek" }, + { + "description": "Denies the size command without any pre-configured scope.", + "type": "string", + "const": "fs:deny-size" + }, { "description": "Denies the stat command without any pre-configured scope.", "type": "string", @@ -5599,6 +5669,261 @@ "type": "string", "const": "store:deny-values" }, + { + "description": "This enables all permissions for system info plugin", + "type": "string", + "const": "system-info:allow-all" + }, + { + "description": "Enables the all_sys_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-all-sys-info" + }, + { + "description": "Enables the batteries command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-batteries" + }, + { + "description": "Enables the components command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-components" + }, + { + "description": "Enables the cpu_count command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-cpu-count" + }, + { + "description": "Enables the cpu_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-cpu-info" + }, + { + "description": "Enables the cpus command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-cpus" + }, + { + "description": "Enables the disks command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-disks" + }, + { + "description": "Enables the execute command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-execute" + }, + { + "description": "Enables the hostname command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-hostname" + }, + { + "description": "Enables the kernel_version command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-kernel-version" + }, + { + "description": "Enables the memory_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-memory-info" + }, + { + "description": "Enables the name command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-name" + }, + { + "description": "Enables the networks command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-networks" + }, + { + "description": "Enables the os_version command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-os-version" + }, + { + "description": "Enables the ping command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-ping" + }, + { + "description": "Enables the processes command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-processes" + }, + { + "description": "Enables the refresh_all command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-refresh-all" + }, + { + "description": "Enables the refresh_cpu command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-refresh-cpu" + }, + { + "description": "Enables the refresh_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-refresh-memory" + }, + { + "description": "Enables the refresh_processes command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-refresh-processes" + }, + { + "description": "Enables the static_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-static-info" + }, + { + "description": "Enables the total_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-total-memory" + }, + { + "description": "Enables the total_swap command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-total-swap" + }, + { + "description": "Enables the used_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-used-memory" + }, + { + "description": "Enables the used_swap command without any pre-configured scope.", + "type": "string", + "const": "system-info:allow-used-swap" + }, + { + "description": "Denies the all_sys_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-all-sys-info" + }, + { + "description": "Denies the batteries command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-batteries" + }, + { + "description": "Denies the components command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-components" + }, + { + "description": "Denies the cpu_count command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-cpu-count" + }, + { + "description": "Denies the cpu_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-cpu-info" + }, + { + "description": "Denies the cpus command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-cpus" + }, + { + "description": "Denies the disks command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-disks" + }, + { + "description": "Denies the execute command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-execute" + }, + { + "description": "Denies the hostname command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-hostname" + }, + { + "description": "Denies the kernel_version command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-kernel-version" + }, + { + "description": "Denies the memory_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-memory-info" + }, + { + "description": "Denies the name command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-name" + }, + { + "description": "Denies the networks command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-networks" + }, + { + "description": "Denies the os_version command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-os-version" + }, + { + "description": "Denies the ping command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-ping" + }, + { + "description": "Denies the processes command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-processes" + }, + { + "description": "Denies the refresh_all command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-refresh-all" + }, + { + "description": "Denies the refresh_cpu command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-refresh-cpu" + }, + { + "description": "Denies the refresh_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-refresh-memory" + }, + { + "description": "Denies the refresh_processes command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-refresh-processes" + }, + { + "description": "Denies the static_info command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-static-info" + }, + { + "description": "Denies the total_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-total-memory" + }, + { + "description": "Denies the total_swap command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-total-swap" + }, + { + "description": "Denies the used_memory command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-used-memory" + }, + { + "description": "Denies the used_swap command without any pre-configured scope.", + "type": "string", + "const": "system-info:deny-used-swap" + }, { "description": "Default permissions for tauri-plugin-valtio.", "type": "string", diff --git a/src/app/globals.css b/src/app/globals.css index 8c70949..9a1b6da 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -11,6 +11,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; border-radius: 10px; + background: transparent; } a { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4a25a88..7170785 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -15,7 +15,7 @@ export default function RootLayout({ }) { return ( - + {children} diff --git a/src/app/page.tsx b/src/app/page.tsx index 7771e75..76c1c91 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,44 +1,46 @@ "use client" -import { open } from "@tauri-apps/plugin-dialog" +import { Button } from "@heroui/react" +// import { open } from "@tauri-apps/plugin-dialog" import { useRouter } from "next/navigation" import React from "react" const Home = () => { const router = useRouter() - const [file, setFile] = React.useState("") + // const [file, setFile] = React.useState("") - const openFile = async () => { - const filePath = await open({ - multiple: true, - directory: false, - }) + // const openFile = async () => { + // const filePath = await open({ + // multiple: true, + // directory: false, + // }) - setFile(filePath?.join("\n") || " ") - } + // setFile(filePath?.join("\n") || " ") + // } return (
-

+

CS 工具箱

- - -

{file}

+

{file}

*/}
) } diff --git a/src/components/cstb/CommonDir.tsx b/src/components/cstb/CommonDir.tsx index 000372a..9c78a09 100644 --- a/src/components/cstb/CommonDir.tsx +++ b/src/components/cstb/CommonDir.tsx @@ -5,11 +5,15 @@ interface RoundedButtonProps { children?: React.ReactNode } -const RoundedButton = ({ children }: RoundedButtonProps) => { +const RoundedButton = ({ + children, + ...props +}: RoundedButtonProps & React.ButtonHTMLAttributes) => { return ( @@ -26,13 +30,13 @@ const CommonDir = () => {
- Steam安装位置 - CS2游戏目录 - 地图文件 - 游戏CFG目录 - 个人CFG目录 - 完美平台录像 - 5E平台录像 + {alert("hello")}}>Steam安装位置 + {}}>CS2游戏目录 + {}}>地图文件 + {}}>游戏CFG目录 + {}}>个人CFG目录 + {}}>完美平台录像 + {}}>5E平台录像