refactor: rename var

This commit is contained in:
Lazy 2025-02-14 16:10:48 +08:00
parent 57cc3ddd4f
commit e4abb18302
8 changed files with 9 additions and 10 deletions

View File

@ -23,7 +23,7 @@ export const useAppStateStore = createGlobalState(() => {
allowUsePreset: false,
businessMode: false,
businessId: "",
allowEditCmdOnDocker: false
allowChangeCmd: false
}
});

View File

@ -76,7 +76,7 @@ export interface Settings {
allowUsePreset: boolean;
businessMode: boolean;
businessId: string;
allowEditCmdOnDocker: boolean;
allowChangeCmd: boolean;
}
export interface ImageInfo {
@ -247,6 +247,6 @@ export interface PanelStatus {
allowUsePreset: boolean;
businessMode: boolean;
businessId: string;
allowEditCmdOnDocker: boolean;
allowChangeCmd: boolean;
};
}

View File

@ -397,7 +397,7 @@ onMounted(async () => {
</a-typography-text>
</a-typography-paragraph>
<a-select
v-model:value.prop="(formData as any).allowEditCmdOnDocker"
v-model:value.prop="(formData as any).allowChangeCmd"
style="max-width: 320px"
>
<a-select-option

View File

@ -170,7 +170,7 @@ const btns = computed(() => {
condition: () =>
!isAdmin.value &&
instanceInfo.value?.config.processType === "docker" &&
state.settings.allowEditCmdOnDocker,
state.settings.allowChangeCmd,
click: () => {
instanceFundamentalDetailDialog.value?.openDialog();
}

View File

@ -59,5 +59,5 @@ export default class SystemConfig {
businessId = "";
// Whether to allow users to edit the start & update command of Docker instances
allowEditCmdOnDocker = false;
allowChangeCmd = false;
}

View File

@ -444,7 +444,7 @@ router.put(
if (
instance.config.processType === "docker" &&
!systemConfig?.allowEditCmdOnDocker &&
!systemConfig?.allowChangeCmd &&
!hasPermission
)
return verificationFailed(ctx);

View File

@ -80,7 +80,7 @@ router.all(
allowUsePreset: systemConfig?.allowUsePreset || false,
businessMode: systemConfig?.businessMode || false,
businessId: systemConfig?.businessId || null,
allowEditCmdOnDocker: systemConfig?.allowEditCmdOnDocker || false
allowChangeCmd: systemConfig?.allowChangeCmd || false
} as Partial<SystemConfig>
};
}

View File

@ -53,8 +53,7 @@ router.put("/setting", permission({ level: ROLE.ADMIN }), async (ctx) => {
if (config.presetPackAddr != null) systemConfig.presetPackAddr = String(config.presetPackAddr);
if (config.businessMode != null) systemConfig.businessMode = Boolean(config.businessMode);
if (config.businessId != null) systemConfig.businessId = String(config.businessId);
if (config.allowEditCmdOnDocker != null)
systemConfig.allowEditCmdOnDocker = Boolean(config.allowEditCmdOnDocker);
if (config.allowChangeCmd != null) systemConfig.allowChangeCmd = Boolean(config.allowChangeCmd);
if (config.language != null) {
logger.warn($t("TXT_CODE_e29a9317"), config.language);
systemConfig.language = String(config.language);