feat: add npmRegistry support to installation configuration (#77)

Co-authored-by: samanhappy@qq.com <my6051199>
This commit is contained in:
samanhappy
2025-05-13 09:21:07 +08:00
committed by GitHub
parent 040782da8d
commit 63efa0038c
7 changed files with 65 additions and 23 deletions

View File

@@ -11,6 +11,7 @@ interface RoutingConfig {
interface InstallConfig {
pythonIndexUrl: string;
npmRegistry: string;
}
interface SystemSettings {
@@ -28,9 +29,9 @@ export const useSettingsData = () => {
enableGlobalRoute: true,
enableGroupNameRoute: true,
});
const [installConfig, setInstallConfig] = useState<InstallConfig>({
pythonIndexUrl: '',
npmRegistry: '',
});
const [loading, setLoading] = useState(false);
@@ -67,10 +68,10 @@ export const useSettingsData = () => {
enableGroupNameRoute: data.data.systemConfig.routing.enableGroupNameRoute ?? true,
});
}
if (data.success && data.data?.systemConfig?.install) {
setInstallConfig({
pythonIndexUrl: data.data.systemConfig.install.pythonIndexUrl || '',
npmRegistry: data.data.systemConfig.install.npmRegistry || '',
});
}
} catch (error) {