style(webui): refine UI polish and enhance component interactions
This commit is contained in:
@@ -1,10 +1,39 @@
|
||||
<div x-data="dashboard" class="view-container">
|
||||
<!-- Compact Header -->
|
||||
<div class="flex items-center justify-between gap-4 mb-6">
|
||||
<!-- Title with inline subtitle -->
|
||||
<div class="flex items-baseline gap-3">
|
||||
<h1 class="text-2xl font-bold text-white tracking-tight" x-text="$store.global.t('dashboard')">
|
||||
Dashboard
|
||||
</h1>
|
||||
<span class="text-[10px] font-mono text-gray-600 uppercase tracking-[0.15em]"
|
||||
x-text="$store.global.t('systemDesc')">
|
||||
CLAUDE PROXY SYSTEM
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Compact Status Indicator -->
|
||||
<div class="flex items-center gap-2 px-2.5 py-1.5 rounded-lg bg-space-900/60 border border-space-border/40">
|
||||
<div class="relative flex items-center justify-center">
|
||||
<span class="absolute w-1.5 h-1.5 bg-neon-green rounded-full animate-ping opacity-75"></span>
|
||||
<span class="relative w-1.5 h-1.5 bg-neon-green rounded-full"></span>
|
||||
</div>
|
||||
<span class="text-[10px] font-mono text-gray-500 uppercase tracking-wider">Live</span>
|
||||
<span class="text-gray-700">•</span>
|
||||
<span class="text-[10px] font-mono text-gray-400 tabular-nums"
|
||||
x-text="new Date().toLocaleTimeString([], {hour: '2-digit', minute: '2-digit', second: '2-digit'})">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stats Grid -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
<div
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-lg p-4 hover:border-space-border/60 transition-colors group relative">
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-xl p-6 hover:border-cyan-500/30 hover:bg-cyan-500/5 transition-all duration-300 group relative cursor-pointer"
|
||||
@click="$store.global.activeTab = 'accounts'"
|
||||
:title="$store.global.t('clickToViewAllAccounts')">
|
||||
<!-- Icon 移到右上角,缩小并变灰 -->
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-gray-600/60 transition-colors">
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-cyan-400/70 transition-colors">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0z">
|
||||
@@ -15,14 +44,19 @@
|
||||
<div class="stat-value text-white font-mono text-4xl font-bold mb-1" x-text="stats.total"></div>
|
||||
<div class="stat-title text-gray-500 font-mono text-xs uppercase tracking-wider truncate"
|
||||
x-text="$store.global.t('totalAccounts')"></div>
|
||||
<div class="stat-desc text-gray-600 text-[10px] truncate" x-text="$store.global.t('registeredNodes')">
|
||||
Registered
|
||||
Nodes</div>
|
||||
<div class="stat-desc text-cyan-400/60 text-[10px] truncate flex items-center gap-1">
|
||||
<span x-text="$store.global.t('registeredNodes')"></span>
|
||||
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-lg p-4 hover:border-space-border/60 transition-colors group relative">
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-neon-green/50 transition-colors">
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-xl p-6 hover:border-green-500/30 hover:bg-green-500/5 transition-all duration-300 group relative cursor-pointer"
|
||||
@click="$store.global.activeTab = 'models'"
|
||||
:title="$store.global.t('clickToViewModels')">
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-green-400/70 transition-colors">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
@@ -31,13 +65,19 @@
|
||||
<div class="stat-value text-white font-mono text-4xl font-bold mb-1" x-text="stats.active"></div>
|
||||
<div class="stat-title text-gray-500 font-mono text-xs uppercase tracking-wider truncate"
|
||||
x-text="$store.global.t('active')"></div>
|
||||
<div class="stat-desc text-neon-green/60 text-[10px] truncate" x-text="$store.global.t('operational')">
|
||||
<div class="stat-desc text-green-400/60 text-[10px] truncate flex items-center gap-1">
|
||||
<span x-text="$store.global.t('operational')"></span>
|
||||
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-lg p-4 hover:border-space-border/60 transition-colors group relative">
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-red-500/50 transition-colors">
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-xl p-6 hover:border-red-500/30 hover:bg-red-500/5 transition-all duration-300 group relative cursor-pointer"
|
||||
@click="$store.global.activeTab = 'accounts'"
|
||||
:title="$store.global.t('clickToViewLimitedAccounts')">
|
||||
<div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-red-500/70 transition-colors">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
@@ -46,14 +86,19 @@
|
||||
<div class="stat-value text-white font-mono text-4xl font-bold mb-1" x-text="stats.limited"></div>
|
||||
<div class="stat-title text-gray-500 font-mono text-xs uppercase tracking-wider truncate"
|
||||
x-text="$store.global.t('rateLimited')"></div>
|
||||
<div class="stat-desc text-red-500/60 text-[10px] truncate" x-text="$store.global.t('cooldown')"></div>
|
||||
<div class="stat-desc text-red-500/60 text-[10px] truncate flex items-center gap-1">
|
||||
<span x-text="$store.global.t('cooldown')"></span>
|
||||
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Global Quota Chart -->
|
||||
<div
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-lg p-4 col-span-1 lg:col-start-4 lg:row-start-1 h-full flex items-center justify-between gap-3 overflow-hidden relative group hover:border-space-border/60 transition-colors">
|
||||
class="stat bg-space-900/40 border border-space-border/30 rounded-xl p-6 col-span-1 lg:col-start-4 lg:row-start-1 h-full flex items-center justify-between gap-3 overflow-hidden relative group hover:border-space-border/60 transition-colors">
|
||||
<!-- Chart Container -->
|
||||
<div class="h-16 w-16 lg:h-20 lg:w-20 relative flex-shrink-0">
|
||||
<div class="h-14 w-14 lg:h-16 lg:w-16 relative flex-shrink-0">
|
||||
<canvas id="quotaChart"></canvas>
|
||||
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
|
||||
<div class="text-[10px] font-bold text-white font-mono" x-text="stats.overallHealth + '%'">%</div>
|
||||
@@ -61,7 +106,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Legend / Info -->
|
||||
<div class="flex flex-col justify-center gap-2 flex-grow min-w-0 z-10">
|
||||
<div class="flex flex-col justify-center gap-2 flex-grow min-w-0">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-[10px] text-gray-500 uppercase tracking-wider font-mono truncate"
|
||||
x-text="$store.global.t('globalQuota')">Global Quota</span>
|
||||
@@ -69,35 +114,37 @@
|
||||
|
||||
<!-- Custom Legend -->
|
||||
<div class="space-y-1">
|
||||
<div class="flex items-center justify-between text-[10px] text-gray-400">
|
||||
<div class="flex items-center justify-between text-[10px] text-gray-400 cursor-pointer hover:text-neon-purple transition-colors group/legend"
|
||||
@click="$store.global.activeTab = 'models'; $nextTick(() => { $store.data.filters.family = 'claude'; $store.data.computeQuotaRows(); })"
|
||||
:title="$store.global.t('clickToFilterClaude')">
|
||||
<div class="flex items-center gap-1.5 truncate">
|
||||
<div
|
||||
class="w-1.5 h-1.5 rounded-full bg-neon-purple shadow-[0_0_4px_rgba(168,85,247,0.4)] flex-shrink-0">
|
||||
</div>
|
||||
<div class="w-1.5 h-1.5 rounded-full bg-neon-purple flex-shrink-0"></div>
|
||||
<span class="truncate" x-text="$store.global.t('familyClaude')">Claude</span>
|
||||
<svg class="w-2.5 h-2.5 opacity-0 group-hover/legend:opacity-100 transition-opacity" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between text-[10px] text-gray-400">
|
||||
<div class="flex items-center justify-between text-[10px] text-gray-400 cursor-pointer hover:text-neon-green transition-colors group/legend"
|
||||
@click="$store.global.activeTab = 'models'; $nextTick(() => { $store.data.filters.family = 'gemini'; $store.data.computeQuotaRows(); })"
|
||||
:title="$store.global.t('clickToFilterGemini')">
|
||||
<div class="flex items-center gap-1.5 truncate">
|
||||
<div
|
||||
class="w-1.5 h-1.5 rounded-full bg-neon-green shadow-[0_0_4px_rgba(34,197,94,0.4)] flex-shrink-0">
|
||||
</div>
|
||||
<div class="w-1.5 h-1.5 rounded-full bg-neon-green flex-shrink-0"></div>
|
||||
<span class="truncate" x-text="$store.global.t('familyGemini')">Gemini</span>
|
||||
<svg class="w-2.5 h-2.5 opacity-0 group-hover/legend:opacity-100 transition-opacity" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Decorative Glow -->
|
||||
<div class="absolute -right-6 -top-6 w-24 h-24 bg-neon-purple/5 rounded-full blur-2xl pointer-events-none">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Usage Trend Chart -->
|
||||
<div class="glass-panel p-4 rounded-lg">
|
||||
<div class="view-card">
|
||||
<!-- Header with Stats and Filter -->
|
||||
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-4">
|
||||
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6">
|
||||
<div class="flex flex-wrap items-center gap-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
|
||||
@@ -111,17 +158,17 @@
|
||||
|
||||
<!-- Usage Stats Pills -->
|
||||
<div class="flex flex-wrap gap-2 text-[10px] font-mono">
|
||||
<div class="px-2 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<div class="px-2.5 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<span class="text-gray-500" x-text="$store.global.t('totalColon')">Total:</span>
|
||||
<span class="text-white ml-1" x-text="usageStats.total"></span>
|
||||
<span class="text-white ml-1 font-bold" x-text="usageStats.total"></span>
|
||||
</div>
|
||||
<div class="px-2 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<div class="px-2.5 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<span class="text-gray-500" x-text="$store.global.t('todayColon')">Today:</span>
|
||||
<span class="text-neon-cyan ml-1" x-text="usageStats.today"></span>
|
||||
<span class="text-neon-cyan ml-1 font-bold" x-text="usageStats.today"></span>
|
||||
</div>
|
||||
<div class="px-2 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<div class="px-2.5 py-1 rounded bg-space-800 border border-space-border/50 whitespace-nowrap">
|
||||
<span class="text-gray-500" x-text="$store.global.t('hour1Colon')">1H:</span>
|
||||
<span class="text-neon-green ml-1" x-text="usageStats.thisHour"></span>
|
||||
<span class="text-neon-green ml-1 font-bold" x-text="usageStats.thisHour"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user