优化控制台顶部面包屑导航与图表交互体验

This commit is contained in:
ucmao
2026-09-09 21:22:19 +08:00
parent f0312fff8b
commit 311b00beff
3 changed files with 69 additions and 17 deletions
+48 -10
View File
@@ -322,29 +322,67 @@
/* ==========================================================================
SVG Charts & Tooltips
========================================================================== */
.chart-container {
position: relative;
width: 100%;
}
.chart-guide-line {
stroke: #cbd5e1;
stroke-width: 1px;
stroke-dasharray: 4 4;
opacity: 0;
transition: opacity 0.15s ease;
pointer-events: none;
}
.chart-hover-dot {
opacity: 0;
transition: opacity 0.15s ease, r 0.15s ease;
pointer-events: none;
}
.chart-tooltip {
position: absolute;
pointer-events: none;
z-index: 30;
display: none;
opacity: 0;
transition: opacity 0.15s ease, transform 0.15s ease;
transform: translate(-50%, -100%);
background: rgba(255, 255, 255, 0.96);
color: #0f172a;
padding: 8px 12px;
border-radius: 10px;
font-size: 12px;
line-height: 1.5;
border: 1px solid #e2e8f0;
box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
backdrop-filter: blur(8px);
white-space: nowrap;
transition: left 0.06s ease, opacity 0.12s ease, transform 0.12s ease;
transform: translateY(4px);
}
.chart-tooltip.visible {
.chart-tooltip.active {
display: block;
opacity: 1;
transform: translateY(0);
}
.chart-tooltip .tt-title {
font-weight: 700;
margin-bottom: 5px;
color: #475569;
border-bottom: 1px solid #f1f5f9;
padding-bottom: 4px;
font-size: 11.5px;
}
.chart-tooltip .tt-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
margin-top: 3px;
color: #475569;
font-size: 12px;
}
.chart-tooltip .tt-row strong {
color: #0f172a;
font-weight: 600;
}
.chart-tooltip .tt-dot {
width: 7px;
height: 7px;
border-radius: 50%;
display: inline-block;
flex-shrink: 0;
}
.pie-slice {
transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
+1 -1
View File
@@ -1,6 +1,6 @@
{% extends 'base_console.html' %}
{% block title %}系统概览 · 管理员后台{% endblock %}
{% block page_title %}系统概览{% endblock %}
{% block page_title %}概览{% endblock %}
{% block console_content %}
<main class="max-w-7xl mx-auto space-y-6">
<div id="overview" class="tab-view space-y-6">
+20 -6
View File
@@ -158,13 +158,27 @@
<!-- 顶部顶栏 (Topbar, 规范 64px 高度) -->
<header class="main-topbar h-16 px-8 bg-white/95 backdrop-blur-md border-b border-slate-200/80 flex items-center justify-between sticky top-0 z-20 shadow-2xs">
<div class="topbar-left flex items-center gap-2 text-sm">
<div class="topbar-breadcrumb flex items-center gap-1.5 text-slate-500 font-medium">
<a href="{{ url_for('web.index') }}" target="_blank" class="hover:text-slate-900 transition">Media Parser</a>
<nav class="topbar-breadcrumb flex items-center gap-1.5 text-slate-500 font-medium" aria-label="Breadcrumb">
<a href="{{ url_for('admin.overview' if g.user['role']=='admin' else 'portal.overview') }}" class="hover:text-slate-900 transition">{{ '管理后台' if g.user['role']=='admin' else '控制台' }}</a>
<span class="topbar-separator text-slate-300">/</span>
<span>{{ '管理后台' if g.user['role']=='admin' else '控制台' }}</span>
<span class="text-slate-500">
{%- block nav_group -%}
{%- if g.user['role'] == 'admin' -%}
{%- if active_nav in ['overview', 'settings'] -%}系统管理
{%- elif active_nav in ['users', 'keys', 'platforms'] -%}业务管理
{%- elif active_nav == 'logs' -%}运维监控
{%- elif active_nav == 'docs' -%}参考文档
{%- else -%}系统管理{%- endif -%}
{%- else -%}
{%- if active_nav in ['overview', 'logs'] -%}概览与统计
{%- elif active_nav in ['keys', 'platforms', 'docs'] -%}开发者中心
{%- else -%}控制中心{%- endif -%}
{%- endif -%}
{%- endblock -%}
</span>
<span class="topbar-separator text-slate-300">/</span>
</div>
<h1 class="page-title text-sm font-bold text-slate-900" id="active-page-title">{% block page_title %}{% endblock %}</h1>
<h1 class="page-title text-sm font-bold text-slate-900 inline" id="active-page-title">{% block page_title %}{% endblock %}</h1>
</nav>
</div>
<div class="topbar-right flex items-center gap-3">
{% if is_api_enabled() %}
@@ -299,7 +313,7 @@ function initChartInteractions() {
const containerRect = container.getBoundingClientRect();
const svgRect = svg.getBoundingClientRect();
const scaleX = svgRect.width / 720;
const targetX = cx * scaleX;
const targetX = (cx * scaleX) + (svgRect.left - containerRect.left);
let tooltipWidth = tooltip.offsetWidth || 130;
let left = targetX - (tooltipWidth / 2);