diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 3adc92f..62b97ac 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -140,5 +140,6 @@ "Failed to switch model, please try starting the program with administrator privileges.": "切换模型失败, 请尝试以管理员权限启动程序", "Current Strategy": "当前Strategy", "MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行", - "Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行" + "Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行", + "On Linux system, you must manually install python dependencies.": "在Linux系统下, 你必须手动安装python依赖" } \ No newline at end of file diff --git a/frontend/src/components/RunButton.tsx b/frontend/src/components/RunButton.tsx index 35a312e..e187f94 100644 --- a/frontend/src/components/RunButton.tsx +++ b/frontend/src/components/RunButton.tsx @@ -75,10 +75,16 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean BrowserOpenURL('https://aka.ms/vs/16/release/vc_redist.x64.exe'); }); } else { - toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => { - InstallPyDep(commonStore.settings.customPythonPath, commonStore.settings.cnMirror); - setTimeout(WindowShow, 1000); - }); + toast(depErrorMsg, { type: 'info', position: 'bottom-left' }); + if (commonStore.platform != 'linux') + toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => { + InstallPyDep(commonStore.settings.customPythonPath, commonStore.settings.cnMirror); + setTimeout(WindowShow, 1000); + }); + else + toastWithButton(t('On Linux system, you must manually install python dependencies.'), t('Check'), () => { + BrowserOpenURL('https://github.com/josStorer/RWKV-Runner/blob/master/build/linux/Readme_Install.txt'); + }); } } else { toast(depErrorMsg, { type: 'error' }); diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index db3ea75..aa9e795 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -95,7 +95,7 @@ export const Settings: FC = observer(() => { } /> } { - commonStore.settings.language === 'zh' && + commonStore.settings.language === 'zh' && commonStore.platform != 'linux' && { diff --git a/frontend/src/utils/index.tsx b/frontend/src/utils/index.tsx index 0a18ef3..c2498b1 100644 --- a/frontend/src/utils/index.tsx +++ b/frontend/src/utils/index.tsx @@ -16,6 +16,7 @@ import { Button } from '@fluentui/react-components'; import { Language, Languages, SettingsType } from '../pages/Settings'; import { ModelSourceItem } from '../pages/Models'; import { ModelConfig, ModelParameters } from '../pages/Configs'; +import { BrowserOpenURL } from '../../wailsjs/runtime'; export type Cache = { models: ModelSourceItem[] @@ -245,20 +246,24 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) { `https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/${asset.name}`; toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => { DeleteFile('cache.json'); - toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), { - type: 'info', - position: 'bottom-left', - autoClose: 20000 - }); - setTimeout(() => { - UpdateApp(updateUrl).catch((e) => { - toast(t('Update Error') + ' - ' + e.message || e, { - type: 'error', - position: 'bottom-left', - autoClose: false - }); + if (commonStore.platform != 'darwin') { + toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), { + type: 'info', + position: 'bottom-left', + autoClose: 20000 }); - }, 500); + setTimeout(() => { + UpdateApp(updateUrl).catch((e) => { + toast(t('Update Error') + ' - ' + e.message || e, { + type: 'error', + position: 'bottom-left', + autoClose: false + }); + }); + }, 500); + } else { + BrowserOpenURL(updateUrl); + } }, { autoClose: false, position: 'bottom-left'