mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-02-17 15:59:41 +08:00
Refactor: quickInstallAddr
This commit is contained in:
parent
6e2f6cfb17
commit
d8c2405bcc
@ -68,7 +68,7 @@ export interface Settings {
|
||||
loginInfo: string;
|
||||
canFileManager: boolean;
|
||||
language: string;
|
||||
quickInstallAddr: string;
|
||||
presetPackAddr: string;
|
||||
redisUrl: string;
|
||||
allowUsePreset: boolean;
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ onMounted(async () => {
|
||||
{{ t("TXT_CODE_b1f833f3") }}
|
||||
</a-typography-paragraph>
|
||||
<a-input
|
||||
v-model:value="formData.quickInstallAddr"
|
||||
v-model:value="formData.presetPackAddr"
|
||||
:placeholder="t('TXT_CODE_4ea93630')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
@ -37,6 +37,6 @@ export default class SystemConfig {
|
||||
language = "en_us";
|
||||
|
||||
// Quick installation address
|
||||
quickInstallAddr = "https://mcsmanager.com/mcsmanager-packages.json";
|
||||
presetPackAddr = "https://script.mcsmanager.com/templates.json";
|
||||
redisUrl = "";
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ router.get("/quick_install_list", permission({ level: ROLE.USER }), async (ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
const ADDR = systemConfig?.quickInstallAddr;
|
||||
const ADDR = systemConfig?.presetPackAddr;
|
||||
try {
|
||||
const response = await axios.request({
|
||||
method: "GET",
|
||||
|
@ -488,7 +488,7 @@ router.post(
|
||||
const description = String(ctx.request.body.description);
|
||||
const title = String(ctx.request.body.title);
|
||||
|
||||
const presetUrl = systemConfig?.quickInstallAddr;
|
||||
const presetUrl = systemConfig?.presetPackAddr;
|
||||
if (!presetUrl) throw new Error("Preset Addr is empty!");
|
||||
|
||||
const { data: presetConfig } = await axios<IQuickStartTemplate>({
|
||||
|
@ -47,8 +47,7 @@ router.put("/setting", validator({ body: {} }), permission({ level: ROLE.ADMIN }
|
||||
if (config.loginInfo != null) systemConfig.loginInfo = String(config.loginInfo);
|
||||
if (config.canFileManager != null) systemConfig.canFileManager = Boolean(config.canFileManager);
|
||||
if (config.allowUsePreset != null) systemConfig.allowUsePreset = Boolean(config.allowUsePreset);
|
||||
if (config.quickInstallAddr != null)
|
||||
systemConfig.quickInstallAddr = String(config.quickInstallAddr);
|
||||
if (config.presetPackAddr != null) systemConfig.presetPackAddr = String(config.presetPackAddr);
|
||||
if (config.language != null) {
|
||||
logger.warn("Language change:", config.language);
|
||||
systemConfig.language = String(config.language);
|
||||
|
Loading…
Reference in New Issue
Block a user