mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
fix: remove unused imports and leftover jsx in settings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef, ChangeEvent } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
@@ -23,7 +23,6 @@ import {
|
||||
deletePanelAddress,
|
||||
validatePanelAddress,
|
||||
} from "@/utils/panel";
|
||||
import { siteConfig, updateSiteConfig } from "@/config/site";
|
||||
|
||||
interface PanelAddress {
|
||||
name: string;
|
||||
@@ -184,83 +183,6 @@ export const SettingsPage = () => {
|
||||
{/* 内容区域 */}
|
||||
<div className="max-w-4xl mx-auto px-4 py-6">
|
||||
<div className="space-y-6">
|
||||
<Card>
|
||||
<CardBody className="p-6">
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-white mb-4">
|
||||
外观设置
|
||||
</h2>
|
||||
<div className="space-y-4">
|
||||
<div className="flex flex-col gap-2">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
自定义背景图片
|
||||
</label>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mb-3">
|
||||
留空则使用系统默认的网格渐变背景。推荐上传 1920x1080 尺寸的图片。
|
||||
</p>
|
||||
<div className="flex items-center gap-4">
|
||||
{bgImage ? (
|
||||
<div className="relative w-40 h-24 rounded-md overflow-hidden border border-gray-200 dark:border-gray-700 group">
|
||||
<img src={bgImage} alt="Background Preview" className="w-full h-full object-cover" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center justify-center w-40 h-24 rounded-md border border-dashed border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-400 text-xs">
|
||||
无自定义背景
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
className="hidden"
|
||||
ref={fileInputRef}
|
||||
onChange={handleBgImageUpload}
|
||||
/>
|
||||
<Button
|
||||
color="primary"
|
||||
variant="flat"
|
||||
size="sm"
|
||||
isDisabled={!admin || bgImageSaving}
|
||||
onPress={() => fileInputRef.current?.click()}
|
||||
>
|
||||
选择图片...
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-end gap-2 mt-2">
|
||||
{bgImage && (
|
||||
<Button
|
||||
color="danger"
|
||||
variant="flat"
|
||||
isDisabled={!admin || bgImageSaving}
|
||||
onPress={() => {
|
||||
setBgImage("");
|
||||
void handleBgImageSave("");
|
||||
}}
|
||||
>
|
||||
恢复默认
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
color="primary"
|
||||
isDisabled={!admin}
|
||||
isLoading={bgImageSaving}
|
||||
onPress={() => handleBgImageSave()}
|
||||
>
|
||||
保存背景
|
||||
</Button>
|
||||
</div>
|
||||
{!admin && (
|
||||
<p className="mt-2 text-xs text-amber-600 dark:text-amber-400">
|
||||
仅管理员可修改该全局配置。
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</CardBody>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardBody className="p-6">
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-white mb-4">
|
||||
|
||||
Reference in New Issue
Block a user