mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
fix(app): close feature association gaps
This commit is contained in:
+1
-1
@@ -182,7 +182,7 @@ export default function App() {
|
||||
/>
|
||||
<Route
|
||||
path="api-configs"
|
||||
element={<Navigate to="/admin" replace />}
|
||||
element={<Navigate to="/admin?tab=api" replace />}
|
||||
/>
|
||||
<Route
|
||||
path="tasks"
|
||||
|
||||
@@ -310,24 +310,28 @@ export function Layout() {
|
||||
</Link>
|
||||
|
||||
{/* Quick Discover shortcut button */}
|
||||
<Link
|
||||
to="/discover"
|
||||
className="hidden md:flex items-center gap-2 rounded-xl border border-gray-200 px-4 py-2.5 text-xs font-bold text-gray-500 hover:bg-gray-50 hover:text-gray-900 transition-all"
|
||||
>
|
||||
<Sparkles size={14} className="text-brand-500" />
|
||||
<span>发现新片</span>
|
||||
</Link>
|
||||
{can('can_view_discover') && (
|
||||
<Link
|
||||
to="/discover"
|
||||
className="hidden md:flex items-center gap-2 rounded-xl border border-gray-200 px-4 py-2.5 text-xs font-bold text-gray-500 hover:bg-gray-50 hover:text-gray-900 transition-all"
|
||||
>
|
||||
<Sparkles size={14} className="text-brand-500" />
|
||||
<span>发现新片</span>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{/* Notification alert bubble */}
|
||||
<Link
|
||||
to="/notify-channels"
|
||||
title="通知配置"
|
||||
aria-label="打开通知配置"
|
||||
className="relative rounded-xl border border-gray-200 p-2.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 transition-all"
|
||||
>
|
||||
<Bell size={18} />
|
||||
<span className="absolute top-1.5 right-1.5 h-2 w-2 rounded-full bg-brand-500 ring-2 ring-white animate-pulse" />
|
||||
</Link>
|
||||
{isAdmin && (
|
||||
<Link
|
||||
to="/notify-channels"
|
||||
title="通知配置"
|
||||
aria-label="打开通知配置"
|
||||
className="relative rounded-xl border border-gray-200 p-2.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 transition-all"
|
||||
>
|
||||
<Bell size={18} />
|
||||
<span className="absolute top-1.5 right-1.5 h-2 w-2 rounded-full bg-brand-500 ring-2 ring-white animate-pulse" />
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{/* Horizontal divider lines */}
|
||||
<span className="h-6 w-px bg-gray-200" />
|
||||
|
||||
@@ -324,7 +324,7 @@ export function AIAssistantPage() {
|
||||
{!status?.enabled && (
|
||||
<p className="text-xs text-sand-500">
|
||||
提示: 当前未配置外部 AI Provider,系统将使用本地规则引擎解析查询。
|
||||
管理员可在 <Link to="/api-configs" className="text-brand-500">API 配置</Link>{' '}
|
||||
管理员可在 <Link to="/admin?tab=api" className="text-brand-500">API 配置</Link>{' '}
|
||||
中接入 OpenAI / DeepSeek 等服务以获得更好效果。
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FormEvent, useEffect, useState } from 'react'
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import toast from 'react-hot-toast'
|
||||
import { KeyRound, Pencil, Plus, ShieldCheck, Trash2, UserCheck, UserX, X } from 'lucide-react'
|
||||
|
||||
@@ -11,13 +12,31 @@ import { ManagementShortcuts } from '../components/ManagementShortcuts'
|
||||
import { confirmAction } from '../components/ConfirmDialog'
|
||||
import { requestPassword } from '../components/PasswordDialog'
|
||||
|
||||
type AdminTab = 'library' | 'users' | 'api'
|
||||
|
||||
function parseAdminTab(value: string | null): AdminTab {
|
||||
if (value === 'users' || value === 'api') return value
|
||||
return 'library'
|
||||
}
|
||||
|
||||
export function AdminPage() {
|
||||
const [tab, setTab] = useState<'library' | 'users' | 'api'>('library')
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const [tab, setTab] = useState<AdminTab>(() => parseAdminTab(searchParams.get('tab')))
|
||||
const tabs = [
|
||||
{ key: 'library' as const, label: '媒体库' },
|
||||
{ key: 'users' as const, label: '用户' },
|
||||
{ key: 'api' as const, label: '外部API' },
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
setTab(parseAdminTab(searchParams.get('tab')))
|
||||
}, [searchParams])
|
||||
|
||||
const selectTab = (next: AdminTab) => {
|
||||
setTab(next)
|
||||
setSearchParams(next === 'library' ? {} : { tab: next })
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<h1 className="font-display text-3xl font-bold text-ink-600">管理后台</h1>
|
||||
@@ -35,7 +54,7 @@ export function AdminPage() {
|
||||
{tabs.map((k) => (
|
||||
<button
|
||||
key={k.key}
|
||||
onClick={() => setTab(k.key)}
|
||||
onClick={() => selectTab(k.key)}
|
||||
className={
|
||||
'border-b-2 px-4 py-2 text-sm transition ' +
|
||||
(tab === k.key
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FormEvent, useEffect, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import toast from 'react-hot-toast'
|
||||
import { ArrowDown, ArrowUp, Download, Film, HardDrive, Rss, ShieldCheck, Trash2 } from 'lucide-react'
|
||||
|
||||
@@ -280,11 +281,18 @@ export function DownloadsPage() {
|
||||
</div>
|
||||
{torrents === null && (
|
||||
<div className="glass-panel text-sand-500">
|
||||
尚未连接到下载器 — 请到{' '}
|
||||
<a href="/download-clients" className="text-brand-500 hover:underline">
|
||||
下载器
|
||||
</a>{' '}
|
||||
页面添加并测试连接。
|
||||
尚未连接到下载器 —{' '}
|
||||
{role === 'admin' ? (
|
||||
<>
|
||||
请到{' '}
|
||||
<Link to="/download-clients" className="text-brand-500 hover:underline">
|
||||
下载器
|
||||
</Link>{' '}
|
||||
页面添加并测试连接。
|
||||
</>
|
||||
) : (
|
||||
'请联系管理员添加并测试下载器连接。'
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{torrents && torrents.length === 0 && (
|
||||
|
||||
Reference in New Issue
Block a user