fix: fix DisableYellowFilter switch style

This commit is contained in:
shinya
2025-08-01 13:39:15 +08:00
parent 25c699a819
commit 774f047beb
3 changed files with 38 additions and 36 deletions

View File

@@ -1 +1 @@
20250801131720
20250801133915

View File

@@ -1615,54 +1615,56 @@ const SiteConfigComponent = ({ config }: { config: AdminConfig | null }) => {
{/* 禁用黄色过滤器 */}
<div>
<label
className={`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 ${
isD1Storage || isUpstashStorage ? 'opacity-50' : ''
}`}
>
{isD1Storage && (
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
(D1 )
</span>
)}
{isUpstashStorage && (
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
(Upstash )
</span>
)}
</label>
<div className='flex items-center'>
<input
type='checkbox'
id='disableYellowFilter'
checked={siteSettings.DisableYellowFilter}
onChange={(e) =>
<div className='flex items-center justify-between'>
<label
className={`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 ${
isD1Storage || isUpstashStorage ? 'opacity-50' : ''
}`}
>
{isD1Storage && (
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
(D1 )
</span>
)}
{isUpstashStorage && (
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
(Upstash )
</span>
)}
</label>
<button
type='button'
onClick={() =>
!isD1Storage &&
!isUpstashStorage &&
setSiteSettings((prev) => ({
...prev,
DisableYellowFilter: e.target.checked,
DisableYellowFilter: !prev.DisableYellowFilter,
}))
}
disabled={isD1Storage || isUpstashStorage}
className={`w-4 h-4 text-green-600 bg-gray-100 border-gray-300 rounded focus:ring-green-500 dark:focus:ring-green-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 ${
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.DisableYellowFilter
? 'bg-green-600'
: 'bg-gray-200 dark:bg-gray-700'
} ${
isD1Storage || isUpstashStorage
? 'opacity-50 cursor-not-allowed'
: ''
}`}
/>
<label
htmlFor='disableYellowFilter'
className={`ml-2 text-sm text-gray-700 dark:text-gray-300 ${
isD1Storage || isUpstashStorage ? 'opacity-50' : ''
}`}
>
</label>
<span
className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
siteSettings.DisableYellowFilter
? 'translate-x-6'
: 'translate-x-1'
}`}
/>
</button>
</div>
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
</p>
</div>

View File

@@ -2,7 +2,7 @@
'use client';
const CURRENT_VERSION = '20250801131720';
const CURRENT_VERSION = '20250801133915';
// 版本检查结果枚举
export enum UpdateStatus {