mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-06 11:49:41 +08:00
feat: add local settings
This commit is contained in:
@@ -50,7 +50,6 @@ interface SiteConfig {
|
||||
Announcement: string;
|
||||
SearchDownstreamMaxPage: number;
|
||||
SiteInterfaceCacheTime: number;
|
||||
SearchResultDefaultAggregate: boolean;
|
||||
}
|
||||
|
||||
// 视频源数据类型
|
||||
@@ -948,7 +947,6 @@ const SiteConfigComponent = ({ config }: { config: AdminConfig | null }) => {
|
||||
Announcement: '',
|
||||
SearchDownstreamMaxPage: 1,
|
||||
SiteInterfaceCacheTime: 7200,
|
||||
SearchResultDefaultAggregate: false,
|
||||
});
|
||||
// 保存状态
|
||||
const [saving, setSaving] = useState(false);
|
||||
@@ -1094,45 +1092,6 @@ const SiteConfigComponent = ({ config }: { config: AdminConfig | null }) => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 默认按标题和年份聚合 */}
|
||||
<div className='flex items-center justify-between'>
|
||||
<label
|
||||
className={`text-gray-700 dark:text-gray-300 ${
|
||||
isD1Storage ? 'opacity-50' : ''
|
||||
}`}
|
||||
>
|
||||
搜索结果默认按标题和年份聚合
|
||||
{isD1Storage && (
|
||||
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
|
||||
(D1 环境下不可修改)
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<button
|
||||
onClick={() =>
|
||||
!isD1Storage &&
|
||||
setSiteSettings((prev) => ({
|
||||
...prev,
|
||||
SearchResultDefaultAggregate: !prev.SearchResultDefaultAggregate,
|
||||
}))
|
||||
}
|
||||
disabled={isD1Storage}
|
||||
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${
|
||||
siteSettings.SearchResultDefaultAggregate
|
||||
? 'bg-green-600'
|
||||
: 'bg-gray-200 dark:bg-gray-700'
|
||||
} ${isD1Storage ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
>
|
||||
<span
|
||||
className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
||||
siteSettings.SearchResultDefaultAggregate
|
||||
? 'translate-x-6'
|
||||
: 'translate-x-1'
|
||||
}`}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 操作按钮 */}
|
||||
<div className='flex justify-end'>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user