Merge branch 'feature/footer' into dev

This commit is contained in:
Sun 2024-01-06 12:56:15 +08:00
commit 7ebe35856e
4 changed files with 17 additions and 0 deletions

View File

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

View File

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

View File

@ -55,6 +55,7 @@ declare namespace Panel {
maxWidth?:number
maxWidthUnit:string
marginX?:number
footerHtml?:string
}
interface userConfig{

View File

@ -485,6 +485,7 @@ function handleAddItem(itemIconGroupId?: number) {
</div>
</div>
</div>
<div class="mt-5 footer" v-html="panelState.panelConfig.footerHtml" />
</div>
</div>