add cnMirror
This commit is contained in:
@@ -94,5 +94,6 @@
|
||||
"Python target not found, would you like to download it?": "没有找到目标Python, 是否下载?",
|
||||
"Python dependencies are incomplete, would you like to install them?": "Python依赖缺失, 是否安装?",
|
||||
"Install": "安装",
|
||||
"This is the latest version": "已是最新版"
|
||||
"This is the latest version": "已是最新版",
|
||||
"Use Tsinghua Pip Mirrors": "使用清华大学Pip镜像源"
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
});
|
||||
} else if (depErrorMsg.includes('DepCheck Error')) {
|
||||
toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => {
|
||||
InstallPyDep();
|
||||
InstallPyDep(commonStore.settings.cnMirror);
|
||||
});
|
||||
} else {
|
||||
toast(depErrorMsg, {type: 'error'});
|
||||
|
||||
@@ -18,6 +18,7 @@ export type SettingsType = {
|
||||
language: Language,
|
||||
darkMode: boolean
|
||||
autoUpdatesCheck: boolean
|
||||
cnMirror: boolean
|
||||
}
|
||||
|
||||
export const Settings: FC = observer(() => {
|
||||
@@ -63,6 +64,17 @@ export const Settings: FC = observer(() => {
|
||||
checkUpdate(true);
|
||||
}}/>
|
||||
}/>
|
||||
{
|
||||
commonStore.settings.language === 'zh' &&
|
||||
<Labeled label={t('Use Tsinghua Pip Mirrors')} flex spaceBetween content={
|
||||
<Switch checked={commonStore.settings.cnMirror}
|
||||
onChange={(e, data) => {
|
||||
commonStore.setSettings({
|
||||
cnMirror: data.checked
|
||||
});
|
||||
}}/>
|
||||
}/>
|
||||
}
|
||||
</div>
|
||||
}/>
|
||||
);
|
||||
|
||||
@@ -48,7 +48,8 @@ class CommonStore {
|
||||
settings: SettingsType = {
|
||||
language: getUserLanguage(),
|
||||
darkMode: !isSystemLightMode(),
|
||||
autoUpdatesCheck: true
|
||||
autoUpdatesCheck: true,
|
||||
cnMirror: getUserLanguage() === 'zh'
|
||||
};
|
||||
|
||||
// about
|
||||
|
||||
2
frontend/wailsjs/go/backend_golang/App.d.ts
vendored
2
frontend/wailsjs/go/backend_golang/App.d.ts
vendored
@@ -18,7 +18,7 @@ export function FileExists(arg1:string):Promise<boolean>;
|
||||
|
||||
export function GetPlatform():Promise<string>;
|
||||
|
||||
export function InstallPyDep():Promise<string>;
|
||||
export function InstallPyDep(arg1:boolean):Promise<string>;
|
||||
|
||||
export function ListDirFiles(arg1:string):Promise<Array<backend_golang.FileInfo>>;
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ export function GetPlatform() {
|
||||
return window['go']['backend_golang']['App']['GetPlatform']();
|
||||
}
|
||||
|
||||
export function InstallPyDep() {
|
||||
return window['go']['backend_golang']['App']['InstallPyDep']();
|
||||
export function InstallPyDep(arg1) {
|
||||
return window['go']['backend_golang']['App']['InstallPyDep'](arg1);
|
||||
}
|
||||
|
||||
export function ListDirFiles(arg1) {
|
||||
|
||||
Reference in New Issue
Block a user