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
|
||||
|
||||
Reference in New Issue
Block a user