diff --git a/src/components/apps/Style/index.vue b/src/components/apps/Style/index.vue index 42b77e2..2aa37de 100644 --- a/src/components/apps/Style/index.vue +++ b/src/components/apps/Style/index.vue @@ -241,6 +241,18 @@ function resetPanelConfig() { </NGrid> </NCard> + <NCard style="border-radius:10px" class="mt-[10px]" size="small"> + <div class="text-slate-500 mb-[5px] font-bold"> + 自定义footer + </div> + + <NInput + v-model:value="panelState.panelConfig.footerHtml" + type="textarea" + placeholder="基本的 Textarea" + /> + </NCard> + <NCard style="border-radius:10px" class="mt-[10px]" size="small"> <NPopconfirm @positive-click="resetPanelConfig" diff --git a/src/store/modules/panel/helper.ts b/src/store/modules/panel/helper.ts index d660409..ec40f0d 100644 --- a/src/store/modules/panel/helper.ts +++ b/src/store/modules/panel/helper.ts @@ -3,6 +3,8 @@ import { PanelPanelConfigStyleEnum, PanelStateNetworkModeEnum } from '@/enums' import defaultBackground from '@/assets/defaultBackground.webp' const LOCAL_NAME = 'panelStorage' +const defaultFooterHtml = '<div class="flex justify-center text-slate-300">Powered By <a href="https://github.com/hslr-s/sun-panel" target="_blank" class="ml-[5px] text-slate-500">Sun-Panel</a></div>' + export function defaultStatePanelConfig(): Panel.panelConfig { return { backgroundImageSrc: defaultBackground, @@ -22,6 +24,7 @@ export function defaultStatePanelConfig(): Panel.panelConfig { maxWidth: 1200, maxWidthUnit: 'px', marginX: 5, + footerHtml: defaultFooterHtml, } } diff --git a/src/typings/panel.d.ts b/src/typings/panel.d.ts index d99f4cc..bc98f99 100644 --- a/src/typings/panel.d.ts +++ b/src/typings/panel.d.ts @@ -55,6 +55,7 @@ declare namespace Panel { maxWidth?:number maxWidthUnit:string marginX?:number + footerHtml?:string } interface userConfig{ diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 0ee1f6d..261cd10 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -485,6 +485,7 @@ function handleAddItem(itemIconGroupId?: number) { </div> </div> </div> + <div class="mt-5 footer" v-html="panelState.panelConfig.footerHtml" /> </div> </div>