perf: 小助手可以关闭

pull/409/head
xiaojunnuo 2025-05-15 23:06:22 +08:00
parent 44f11b38e7
commit 3e2101aa5b
4 changed files with 8 additions and 2 deletions

View File

@ -27,6 +27,7 @@ export class SysPublicSettings extends BaseSettings {
icpNo?: string; icpNo?: string;
mpsNo?: string; mpsNo?: string;
robots?: boolean = true; robots?: boolean = true;
aiChatEnabled = true;
} }
export class SysPrivateSettings extends BaseSettings { export class SysPrivateSettings extends BaseSettings {

View File

@ -3,7 +3,7 @@
<FsFormProvider> <FsFormProvider>
<contextHolder /> <contextHolder />
<router-view /> <router-view />
<MaxKBChat ref="chatBox" /> <MaxKBChat v-if="settingsStore.sysPublic.aiChatEnabled !== false" ref="chatBox" />
</FsFormProvider> </FsFormProvider>
</AConfigProvider> </AConfigProvider>
</template> </template>
@ -22,7 +22,7 @@ import AConfigProvider from "ant-design-vue/es/config-provider";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import MaxKBChat from "/@/components/ai/index.vue"; import MaxKBChat from "/@/components/ai/index.vue";
import { util } from "/@/utils"; import { util } from "/@/utils";
import { useSettingStore } from "/@/store/settings";
defineOptions({ defineOptions({
name: "App", name: "App",
}); });
@ -49,6 +49,7 @@ localeChanged("zh-cn");
provide("fn:router.reload", reload); provide("fn:router.reload", reload);
provide("fn:locale.changed", localeChanged); provide("fn:locale.changed", localeChanged);
const settingsStore = useSettingStore();
const { isDark } = usePreferences(); const { isDark } = usePreferences();
const { tokens } = useAntdDesignTokens(); const { tokens } = useAntdDesignTokens();

View File

@ -41,6 +41,7 @@ export type SysPublicSetting = {
icpNo?: string; icpNo?: string;
mpsNo?: string; mpsNo?: string;
robots?: boolean; robots?: boolean;
aiChatEnabled?: boolean;
}; };
export type SuiteSetting = { export type SuiteSetting = {
enabled?: boolean; enabled?: boolean;

View File

@ -8,6 +8,9 @@
<a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" /> <a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" />
</a-form-item> </a-form-item>
<a-form-item label="开启小助手" :name="['public', 'aiChatEnabled']">
<a-switch v-model:checked="formState.public.aiChatEnabled" />
</a-form-item>
<a-form-item label="允许爬虫" :name="['public', 'robots']"> <a-form-item label="允许爬虫" :name="['public', 'robots']">
<a-switch v-model:checked="formState.public.robots" /> <a-switch v-model:checked="formState.public.robots" />
</a-form-item> </a-form-item>