diff --git a/src-tauri/lang/en.json b/src-tauri/lang/en.json index 842ba42..ace27bf 100644 --- a/src-tauri/lang/en.json +++ b/src-tauri/lang/en.json @@ -18,6 +18,7 @@ "recover_metadata": "Emergency Metadata Recovery", "grasscutter_jar": "Set Grasscutter JAR", "toggle_encryption": "Toggle Encryption", + "install_certificate": "Install Proxy Certificate", "java_path": "Set Custom Java Path", "grasscutter_with_game": "Automatically launch Grasscutter with game", "language": "Select Language", @@ -46,7 +47,8 @@ "components": { "select_file": "Select file or folder...", "select_folder": "Select folder...", - "download": "Download" + "download": "Download", + "install": "Install" }, "news": { "latest_commits": "Recent Commits", diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 495c0bd..42e3318 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -198,6 +198,12 @@ export default class Options extends React.Component { console.log(this.props) await meta.restoreMetadata(this.props.downloadManager) } + + async installCert() { + await invoke('generate_ca_files', { + path: await dataDir() + 'cultivation' + }) + } render() { return ( @@ -220,18 +226,6 @@ export default class Options extends React.Component { - { - this.state.swag && ( - - ) - } + + { + this.state.swag && ( + <> + + + + ) + } diff --git a/src/utils/server.ts b/src/utils/server.ts index f2fc6d5..f60f3e6 100644 --- a/src/utils/server.ts +++ b/src/utils/server.ts @@ -1,4 +1,4 @@ -import { fs, invoke } from '@tauri-apps/api' +import { invoke } from '@tauri-apps/api' export async function toggleEncryption(path: string) { let serverConf