Refactor: quickInstallAddr

This commit is contained in:
Unitwk 2024-04-30 15:10:13 +08:00
parent 6e2f6cfb17
commit d8c2405bcc
6 changed files with 6 additions and 7 deletions

View File

@ -68,7 +68,7 @@ export interface Settings {
loginInfo: string;
canFileManager: boolean;
language: string;
quickInstallAddr: string;
presetPackAddr: string;
redisUrl: string;
allowUsePreset: boolean;
}

View File

@ -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>

View File

@ -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 = "";
}

View File

@ -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",

View File

@ -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>({

View File

@ -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);