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> <div>
<label <div className='flex items-center justify-between'>
className={`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 ${ <label
isD1Storage || isUpstashStorage ? 'opacity-50' : '' 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'> {isD1Storage && (
(D1 ) <span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
</span> (D1 )
)} </span>
{isUpstashStorage && ( )}
<span className='ml-2 text-xs text-gray-500 dark:text-gray-400'> {isUpstashStorage && (
(Upstash ) <span className='ml-2 text-xs text-gray-500 dark:text-gray-400'>
</span> (Upstash )
)} </span>
</label> )}
<div className='flex items-center'> </label>
<input <button
type='checkbox' type='button'
id='disableYellowFilter' onClick={() =>
checked={siteSettings.DisableYellowFilter}
onChange={(e) =>
!isD1Storage && !isD1Storage &&
!isUpstashStorage && !isUpstashStorage &&
setSiteSettings((prev) => ({ setSiteSettings((prev) => ({
...prev, ...prev,
DisableYellowFilter: e.target.checked, DisableYellowFilter: !prev.DisableYellowFilter,
})) }))
} }
disabled={isD1Storage || isUpstashStorage} 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 isD1Storage || isUpstashStorage
? 'opacity-50 cursor-not-allowed' ? 'opacity-50 cursor-not-allowed'
: '' : ''
}`} }`}
/>
<label
htmlFor='disableYellowFilter'
className={`ml-2 text-sm text-gray-700 dark:text-gray-300 ${
isD1Storage || isUpstashStorage ? 'opacity-50' : ''
}`}
> >
<span
</label> className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
siteSettings.DisableYellowFilter
? 'translate-x-6'
: 'translate-x-1'
}`}
/>
</button>
</div> </div>
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'> <p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
</p> </p>
</div> </div>

View File

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