@ -7,6 +7,7 @@ type GlobalConfigPayload = {
config : {
config : {
siteName : string
siteName : string
allowRegister : boolean
allowRegister : boolean
showDiscoverInHeaderForGuest : boolean
mediaOrphanAutoSweepEnabled : boolean
mediaOrphanAutoSweepEnabled : boolean
mediaOrphanAutoSweepIntervalMinutes : number
mediaOrphanAutoSweepIntervalMinutes : number
commentEmailNotifyEnabled : boolean
commentEmailNotifyEnabled : boolean
@ -30,6 +31,7 @@ const saving = ref(false)
const testingEmail = ref ( false )
const testingEmail = ref ( false )
const siteName = ref ( '' )
const siteName = ref ( '' )
const allowRegister = ref ( true )
const allowRegister = ref ( true )
const showDiscoverInHeaderForGuest = ref ( true )
const mediaOrphanAutoSweepEnabled = ref ( false )
const mediaOrphanAutoSweepEnabled = ref ( false )
const mediaOrphanAutoSweepIntervalMinutes = ref ( 60 )
const mediaOrphanAutoSweepIntervalMinutes = ref ( 60 )
const commentEmailNotifyEnabled = ref ( false )
const commentEmailNotifyEnabled = ref ( false )
@ -72,6 +74,7 @@ async function load() {
const { config : cfg } = await fetchData < GlobalConfigPayload > ( '/api/config/global' )
const { config : cfg } = await fetchData < GlobalConfigPayload > ( '/api/config/global' )
siteName . value = cfg . siteName
siteName . value = cfg . siteName
allowRegister . value = cfg . allowRegister
allowRegister . value = cfg . allowRegister
showDiscoverInHeaderForGuest . value = cfg . showDiscoverInHeaderForGuest
mediaOrphanAutoSweepEnabled . value = cfg . mediaOrphanAutoSweepEnabled
mediaOrphanAutoSweepEnabled . value = cfg . mediaOrphanAutoSweepEnabled
mediaOrphanAutoSweepIntervalMinutes . value = cfg . mediaOrphanAutoSweepIntervalMinutes
mediaOrphanAutoSweepIntervalMinutes . value = cfg . mediaOrphanAutoSweepIntervalMinutes
commentEmailNotifyEnabled . value = cfg . commentEmailNotifyEnabled
commentEmailNotifyEnabled . value = cfg . commentEmailNotifyEnabled
@ -106,6 +109,7 @@ async function save() {
try {
try {
await putKey ( 'siteName' , siteName . value . trim ( ) )
await putKey ( 'siteName' , siteName . value . trim ( ) )
await putKey ( 'allowRegister' , allowRegister . value )
await putKey ( 'allowRegister' , allowRegister . value )
await putKey ( 'showDiscoverInHeaderForGuest' , showDiscoverInHeaderForGuest . value )
await putKey ( 'mediaOrphanAutoSweepEnabled' , mediaOrphanAutoSweepEnabled . value )
await putKey ( 'mediaOrphanAutoSweepEnabled' , mediaOrphanAutoSweepEnabled . value )
await putKey ( 'mediaOrphanAutoSweepIntervalMinutes' , mediaOrphanAutoSweepIntervalMinutes . value )
await putKey ( 'mediaOrphanAutoSweepIntervalMinutes' , mediaOrphanAutoSweepIntervalMinutes . value )
await putKey ( 'commentEmailNotifyEnabled' , commentEmailNotifyEnabled . value )
await putKey ( 'commentEmailNotifyEnabled' , commentEmailNotifyEnabled . value )
@ -151,7 +155,7 @@ async function sendTestEmail() {
应用配置
应用配置
< / h1 >
< / h1 >
< p class = "mt-1 text-sm text-muted" >
< p class = "mt-1 text-sm text-muted" >
管理全局设置 : 站点名称 、 注册开关 、 媒体自动清扫与评论通知邮件 。
管理全局设置 : 站点名称 、 注册与导航 开关 、 媒体自动清扫与评论通知邮件 。
< / p >
< / p >
< / div >
< / div >
@ -175,6 +179,12 @@ async function sendTestEmail() {
< UCheckbox v -model = " allowRegister " label = "开启" / >
< UCheckbox v -model = " allowRegister " label = "开启" / >
< / UFormField >
< / UFormField >
< UFormField
< UFormField
label = "未登录时在 Header 显示发现入口"
description = "关闭后,游客将不再在顶栏看到“发现”导航入口。"
>
< UCheckbox v -model = " showDiscoverInHeaderForGuest " label = "显示发现入口" / >
< / UFormField >
< UFormField
label = "媒体孤儿自动清扫"
label = "媒体孤儿自动清扫"
description = "全站生效、仅删除已过宽限期且无引用的图片、建议先在「图片孤儿审查」确认。"
description = "全站生效、仅删除已过宽限期且无引用的图片、建议先在「图片孤儿审查」确认。"
>
>