更新动态路径,和IP管理的badge显示

This commit is contained in:
Eamon-meng
2025-12-15 14:33:55 +08:00
parent e2c9ea7fbf
commit 4bb8d35b2a
2 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ type Props = {
collapsed?: boolean collapsed?: boolean
} }
// 简化的菜单配置 - 扁平结构,支持分组 // 菜单配置 - 扁平结构,支持分组
const MENU_ITEMS = [ const MENU_ITEMS = [
{ {
group: '官网教程', group: '官网教程',
@@ -70,10 +70,10 @@ const MENU_ITEMS = [
export default function Sidebar({collapsed = false}: Props) { export default function Sidebar({collapsed = false}: Props) {
const pathname = usePathname() const pathname = usePathname()
// 获取当前文档 key (从 /help/{key} 路径中提取) // 获取当前文档 key
const getCurrentKey = useCallback(() => { const getCurrentKey = useCallback(() => {
const parts = pathname?.split('/') || [] const parts = pathname?.split('/') || []
return parts[2] || '' // /help/{key} -> key return parts[2] || ''
}, [pathname]) }, [pathname])
const currentKey = getCurrentKey() const currentKey = getCurrentKey()

View File

@@ -240,9 +240,9 @@ export default function ChannelsPage(props: ChannelsPageProps) {
) : hasAuth ? ( ) : hasAuth ? (
<div className="flex flex-col"> <div className="flex flex-col">
<span></span> <span></span>
<div className="px-2 py-1 bg-gray-100 rounded text-sm text-gray-700 font-mono break-all max-w-[120px]"> <Badge variant="secondary">
{channel.username}:{channel.password} {channel.username}:{channel.password}
</div> </Badge >
</div> </div>
) : ( ) : (
<span className="text-sm text-gray-400"></span> <span className="text-sm text-gray-400"></span>