mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-06 10:06:36 +08:00
优化
This commit is contained in:
@@ -4,7 +4,7 @@ export type SiteConfig = typeof siteConfig;
|
||||
|
||||
// 缓存相关常量
|
||||
const CACHE_PREFIX = 'vite_config_';
|
||||
const VERSION = "1.2.8";
|
||||
const VERSION = "1.2.9";
|
||||
|
||||
|
||||
const getInitialConfig = () => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -63,6 +63,7 @@ export default function DashboardPage() {
|
||||
const [userTunnels, setUserTunnels] = useState<UserTunnel[]>([]);
|
||||
const [forwardList, setForwardList] = useState<Forward[]>([]);
|
||||
const [statisticsFlows, setStatisticsFlows] = useState<StatisticsFlow[]>([]);
|
||||
const [isAdmin, setIsAdmin] = useState(false);
|
||||
|
||||
const [addressModalOpen, setAddressModalOpen] = useState(false);
|
||||
const [addressModalTitle, setAddressModalTitle] = useState('');
|
||||
@@ -166,6 +167,10 @@ export default function DashboardPage() {
|
||||
setForwardList([]);
|
||||
setStatisticsFlows([]);
|
||||
|
||||
// 检查用户是否是管理员
|
||||
const adminStatus = localStorage.getItem('admin');
|
||||
setIsAdmin(adminStatus === 'true');
|
||||
|
||||
loadPackageData();
|
||||
localStorage.setItem('e', '/dashboard');
|
||||
}, []);
|
||||
@@ -751,8 +756,9 @@ export default function DashboardPage() {
|
||||
</CardBody>
|
||||
</Card>
|
||||
|
||||
{/* 隧道权限 */}
|
||||
<Card className="mb-6 lg:mb-8 border border-gray-200 dark:border-default-200 shadow-md">
|
||||
{/* 隧道权限 - 管理员不显示 */}
|
||||
{!isAdmin && (
|
||||
<Card className="mb-6 lg:mb-8 border border-gray-200 dark:border-default-200 shadow-md">
|
||||
<CardHeader className="pb-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<svg className="w-5 h-5 text-primary" fill="currentColor" viewBox="0 0 20 20">
|
||||
@@ -828,6 +834,7 @@ export default function DashboardPage() {
|
||||
)}
|
||||
</CardBody>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{/* 转发配置 */}
|
||||
<Card className="border border-gray-200 dark:border-default-200 shadow-md">
|
||||
|
||||
@@ -10,6 +10,7 @@ import DefaultLayout from "@/layouts/default";
|
||||
import { login, LoginData, checkCaptcha } from "@/api";
|
||||
import "@/utils/tac.css";
|
||||
import "@/utils/tac.min.js";
|
||||
import bgImage from "@/images/bg.jpg";
|
||||
|
||||
|
||||
interface LoginForm {
|
||||
@@ -31,6 +32,8 @@ interface CaptchaConfig {
|
||||
}
|
||||
|
||||
interface CaptchaStyle {
|
||||
btnUrl?: string;
|
||||
bgUrl?: string;
|
||||
logoUrl?: string | null;
|
||||
moveTrackMaskBgColor?: string;
|
||||
moveTrackMaskBorderColor?: string;
|
||||
@@ -117,7 +120,6 @@ export default function IndexPage() {
|
||||
performLogin();
|
||||
},
|
||||
validFail: (_: any, _captcha: any, tac: any) => {
|
||||
toast.error("验证码验证失败,请重试");
|
||||
tac.reloadCaptcha();
|
||||
},
|
||||
btnCloseFun: (_event: any, tac: any) => {
|
||||
@@ -130,10 +132,19 @@ export default function IndexPage() {
|
||||
}
|
||||
};
|
||||
|
||||
// 检测暗黑模式
|
||||
const isDarkMode = document.documentElement.classList.contains('dark') ||
|
||||
document.documentElement.getAttribute('data-theme') === 'dark' ||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
// 根据主题调整颜色
|
||||
const trackColor = isDarkMode ? "#4a5568" : "#7db0be"; // 暗黑模式使用更深的灰蓝色
|
||||
|
||||
const style: CaptchaStyle = {
|
||||
logoUrl: null, // 去除默认logo
|
||||
moveTrackMaskBgColor: "#0298f8",
|
||||
moveTrackMaskBorderColor: "#0298f8"
|
||||
bgUrl: bgImage,
|
||||
logoUrl: null,
|
||||
moveTrackMaskBgColor: trackColor,
|
||||
moveTrackMaskBorderColor: trackColor
|
||||
};
|
||||
|
||||
tacInstanceRef.current = new window.TAC(config, style);
|
||||
@@ -289,14 +300,20 @@ export default function IndexPage() {
|
||||
{/* 验证码弹层 */}
|
||||
{showCaptcha && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
||||
{/* 背景遮罩层 - 模糊效果 */}
|
||||
<div className="absolute inset-0 bg-black/50 backdrop-blur-sm captcha-backdrop-enter" />
|
||||
{/* 背景遮罩层 - 模糊效果,暗黑模式下更深 */}
|
||||
<div className="absolute inset-0 bg-black/60 dark:bg-black/80 backdrop-blur-sm captcha-backdrop-enter" />
|
||||
{/* 验证码容器 */}
|
||||
<div className="mb-4">
|
||||
<div
|
||||
id="captcha-container"
|
||||
ref={captchaContainerRef}
|
||||
className="w-full flex justify-center"
|
||||
style={{
|
||||
filter: document.documentElement.classList.contains('dark') ||
|
||||
document.documentElement.getAttribute('data-theme') === 'dark' ||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
? 'brightness(0.8) contrast(0.9)' : 'none'
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -879,21 +879,9 @@ export default function NodePage() {
|
||||
<Alert
|
||||
color="primary"
|
||||
variant="flat"
|
||||
description="服务器ip是你要添加的服务器的ip地址,不是面板的ip地址"
|
||||
description="服务器ip是你要添加的服务器的ip地址,不是面板的ip地址。入口ip是用于展示在转发页面,面向用户的访问地址。实在理解不到说明你没这个需求,都填节点的服务器ip就行!"
|
||||
className="mt-4"
|
||||
/>
|
||||
<Alert
|
||||
color="primary"
|
||||
variant="flat"
|
||||
description="入口ip是用于展示在转发页面,面向用户的访问地址"
|
||||
className="mt-4"
|
||||
/>
|
||||
<Alert
|
||||
color="primary"
|
||||
variant="flat"
|
||||
description="实在理解不到说明你没这个需求,都填节点的服务器ip就行"
|
||||
className="mt-4"
|
||||
/>
|
||||
</div>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
@@ -100,8 +100,8 @@ export default function TunnelPage() {
|
||||
inNodeId: null,
|
||||
outNodeId: null,
|
||||
protocol: 'tls',
|
||||
tcpListenAddr: '0.0.0.0',
|
||||
udpListenAddr: '0.0.0.0',
|
||||
tcpListenAddr: '[::]',
|
||||
udpListenAddr: '[::]',
|
||||
interfaceName: '',
|
||||
flow: 1,
|
||||
trafficRatio: 1.0,
|
||||
@@ -195,8 +195,8 @@ export default function TunnelPage() {
|
||||
inNodeId: null,
|
||||
outNodeId: null,
|
||||
protocol: 'tls',
|
||||
tcpListenAddr: '0.0.0.0',
|
||||
udpListenAddr: '0.0.0.0',
|
||||
tcpListenAddr: '[::]',
|
||||
udpListenAddr: '[::]',
|
||||
interfaceName: '',
|
||||
flow: 1,
|
||||
trafficRatio: 1.0,
|
||||
@@ -216,8 +216,8 @@ export default function TunnelPage() {
|
||||
inNodeId: tunnel.inNodeId,
|
||||
outNodeId: tunnel.outNodeId || null,
|
||||
protocol: tunnel.protocol || 'tls',
|
||||
tcpListenAddr: tunnel.tcpListenAddr || '0.0.0.0',
|
||||
udpListenAddr: tunnel.udpListenAddr || '0.0.0.0',
|
||||
tcpListenAddr: tunnel.tcpListenAddr || '[::]',
|
||||
udpListenAddr: tunnel.udpListenAddr || '[::]',
|
||||
interfaceName: tunnel.interfaceName || '',
|
||||
flow: tunnel.flow,
|
||||
trafficRatio: tunnel.trafficRatio,
|
||||
|
||||
@@ -988,7 +988,7 @@ export default function UserPage() {
|
||||
aria-label="用户隧道权限列表"
|
||||
classNames={{
|
||||
wrapper: "shadow-none",
|
||||
th: "bg-gray-50 text-gray-700 font-medium"
|
||||
th: "bg-gray-50 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium"
|
||||
}}
|
||||
>
|
||||
<TableHeader>
|
||||
|
||||
Reference in New Issue
Block a user