feat(webui): Add Models tab and refactor model configuration

- Add standalone Models tab with real-time quota/status display
- Move model identity table from Dashboard to Models tab
- Slim down Dashboard to KPI cards and charts only
- Dashboard charts now use unfiltered data (independent of Models filters)

Settings > Models improvements:
- Remove redundant Alias column (only Mapping is functional)
- Fix column misalignment bug (empty td)
- Add column widths and hidden row opacity styling
- Single row edit constraint (only one Mapping editable at a time)
- showHiddenModels toggle now only affects Settings (not Models tab)
- Update description text to match current functionality

i18n:
- Add 'models' and 'modelsPageDesc' keys (EN/ZH)
- Add 'modelMappingHint' for Claude CLI guidance
- Update 'modelsDesc' to reflect new functionality
This commit is contained in:
Wha1eChai
2026-01-09 04:39:05 +08:00
parent a4814b8c34
commit 40a766ded6
10 changed files with 1182 additions and 832 deletions

View File

@@ -9,6 +9,7 @@
document.addEventListener('alpine:init', () => { document.addEventListener('alpine:init', () => {
// Register Components (loaded from separate files via window.Components) // Register Components (loaded from separate files via window.Components)
Alpine.data('dashboard', window.Components.dashboard); Alpine.data('dashboard', window.Components.dashboard);
Alpine.data('models', window.Components.models);
Alpine.data('accountManager', window.Components.accountManager); Alpine.data('accountManager', window.Components.accountManager);
Alpine.data('claudeConfig', window.Components.claudeConfig); Alpine.data('claudeConfig', window.Components.claudeConfig);
Alpine.data('logsViewer', window.Components.logsViewer); Alpine.data('logsViewer', window.Components.logsViewer);

View File

@@ -114,8 +114,10 @@
class="w-8 h-8 rounded bg-gradient-to-br from-neon-purple to-blue-600 flex items-center justify-center text-white font-bold shadow-[0_0_15px_rgba(168,85,247,0.4)]"> class="w-8 h-8 rounded bg-gradient-to-br from-neon-purple to-blue-600 flex items-center justify-center text-white font-bold shadow-[0_0_15px_rgba(168,85,247,0.4)]">
AG</div> AG</div>
<div class="flex flex-col"> <div class="flex flex-col">
<span class="text-sm font-bold tracking-wide text-white" x-text="$store.global.t('systemName')">ANTIGRAVITY</span> <span class="text-sm font-bold tracking-wide text-white"
<span class="text-[10px] text-gray-500 font-mono tracking-wider" x-text="$store.global.t('systemDesc')">CLAUDE PROXY SYSTEM</span> x-text="$store.global.t('systemName')">ANTIGRAVITY</span>
<span class="text-[10px] text-gray-500 font-mono tracking-wider"
x-text="$store.global.t('systemDesc')">CLAUDE PROXY SYSTEM</span>
</div> </div>
</div> </div>
@@ -151,7 +153,8 @@
<!-- Sidebar --> <!-- Sidebar -->
<div class="w-64 bg-space-900 border-r border-space-border flex flex-col pt-6 pb-4"> <div class="w-64 bg-space-900 border-r border-space-border flex flex-col pt-6 pb-4">
<div class="px-4 mb-2 text-xs font-bold text-gray-600 uppercase tracking-widest" x-text="$store.global.t('main')">Main</div> <div class="px-4 mb-2 text-xs font-bold text-gray-600 uppercase tracking-widest"
x-text="$store.global.t('main')">Main</div>
<nav class="flex flex-col gap-1"> <nav class="flex flex-col gap-1">
<button <button
class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5" class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5"
@@ -163,6 +166,16 @@
</svg> </svg>
<span x-text="$store.global.t('dashboard')">Dashboard</span> <span x-text="$store.global.t('dashboard')">Dashboard</span>
</button> </button>
<button
class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5"
:class="{'active': $store.global.activeTab === 'models'}"
@click="$store.global.activeTab = 'models'">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
</svg>
<span x-text="$store.global.t('models')">Models</span>
</button>
<button <button
class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5" class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5"
:class="{'active': $store.global.activeTab === 'accounts'}" :class="{'active': $store.global.activeTab === 'accounts'}"
@@ -175,7 +188,8 @@
</button> </button>
</nav> </nav>
<div class="px-4 mt-8 mb-2 text-xs font-bold text-gray-600 uppercase tracking-widest" x-text="$store.global.t('system')">System</div> <div class="px-4 mt-8 mb-2 text-xs font-bold text-gray-600 uppercase tracking-widest"
x-text="$store.global.t('system')">System</div>
<nav class="flex flex-col gap-1"> <nav class="flex flex-col gap-1">
<button <button
class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5" class="nav-item flex items-center gap-3 px-6 py-3 text-sm font-medium text-gray-400 hover:text-white hover:bg-white/5"
@@ -219,6 +233,11 @@
x-transition:enter="fade-enter-active" x-transition:enter-start="fade-enter-from" x-transition:enter="fade-enter-active" x-transition:enter-start="fade-enter-from"
class="max-w-7xl mx-auto h-full"></div> class="max-w-7xl mx-auto h-full"></div>
<!-- Models -->
<div x-show="$store.global.activeTab === 'models'" x-load-view="'models'"
x-transition:enter="fade-enter-active" x-transition:enter-start="fade-enter-from"
class="max-w-7xl mx-auto h-full"></div>
<!-- Logs --> <!-- Logs -->
<div x-show="$store.global.activeTab === 'logs'" x-load-view="'logs'" x-transition:enter="fade-enter-active" <div x-show="$store.global.activeTab === 'logs'" x-load-view="'logs'" x-transition:enter="fade-enter-active"
x-transition:enter-start="fade-enter-from" class="h-full"></div> x-transition:enter-start="fade-enter-from" class="h-full"></div>
@@ -241,21 +260,24 @@
<h3 class="font-bold text-lg text-white" x-text="$store.global.t('addNode')">Add New Account</h3> <h3 class="font-bold text-lg text-white" x-text="$store.global.t('addNode')">Add New Account</h3>
<div class="py-6 flex flex-col gap-4"> <div class="py-6 flex flex-col gap-4">
<p class="text-sm text-gray-400" x-text="$store.global.t('connectGoogleDesc')">Connect a Google Workspace account to increase your API quota limit. <p class="text-sm text-gray-400" x-text="$store.global.t('connectGoogleDesc')">Connect a Google
Workspace account to increase your API quota limit.
The account will be used to proxy Claude requests via Antigravity.</p> The account will be used to proxy Claude requests via Antigravity.</p>
<button <button class="btn btn-primary flex items-center justify-center gap-3 h-12" @click="addAccountWeb">
class="btn btn-primary flex items-center justify-center gap-3 h-12"
@click="addAccountWeb">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor"> <svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path <path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"></path> d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z">
</path>
<path <path
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"></path> d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z">
</path>
<path <path
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"></path> d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z">
</path>
<path <path
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"></path> d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z">
</path>
</svg> </svg>
<span x-text="$store.global.t('connectGoogle')">Connect Google Account</span> <span x-text="$store.global.t('connectGoogle')">Connect Google Account</span>
</button> </button>
@@ -264,7 +286,8 @@
<div class="collapse collapse-arrow bg-space-800 border border-space-border/50"> <div class="collapse collapse-arrow bg-space-800 border border-space-border/50">
<input type="checkbox" /> <input type="checkbox" />
<div class="collapse-title text-sm font-medium text-gray-400" x-text="$store.global.t('useCliCommand')"> <div class="collapse-title text-sm font-medium text-gray-400"
x-text="$store.global.t('useCliCommand')">
Use CLI Command Use CLI Command
</div> </div>
<div class="collapse-content"> <div class="collapse-content">
@@ -295,6 +318,7 @@
<script src="js/settings-store.js"></script> <script src="js/settings-store.js"></script>
<!-- 3. Components (register to window.Components) --> <!-- 3. Components (register to window.Components) -->
<script src="js/components/dashboard.js"></script> <script src="js/components/dashboard.js"></script>
<script src="js/components/models.js"></script>
<script src="js/components/account-manager.js"></script> <script src="js/components/account-manager.js"></script>
<script src="js/components/claude-config.js"></script> <script src="js/components/claude-config.js"></script>
<script src="js/components/logs-viewer.js"></script> <script src="js/components/logs-viewer.js"></script>

View File

@@ -439,7 +439,7 @@ window.Components.dashboard = () => ({
padding: 10, padding: 10,
displayColors: true, displayColors: true,
callbacks: { callbacks: {
label: function(context) { label: function (context) {
return context.dataset.label + ': ' + context.parsed.y; return context.dataset.label + ': ' + context.parsed.y;
} }
} }
@@ -531,7 +531,8 @@ window.Components.dashboard = () => ({
this.charts.quotaDistribution.destroy(); this.charts.quotaDistribution.destroy();
} }
const rows = Alpine.store('data').quotaRows; // Use UNFILTERED data for global health chart
const rows = Alpine.store('data').getUnfilteredQuotaData();
// Dynamic family aggregation (supports any model family) // Dynamic family aggregation (supports any model family)
const familyStats = {}; const familyStats = {};
@@ -580,12 +581,12 @@ window.Components.dashboard = () => ({
// Labels using translations if possible // Labels using translations if possible
const activeLabel = family === 'claude' ? store.t('claudeActive') : const activeLabel = family === 'claude' ? store.t('claudeActive') :
family === 'gemini' ? store.t('geminiActive') : family === 'gemini' ? store.t('geminiActive') :
`${familyName} ${store.t('activeSuffix')}`; `${familyName} ${store.t('activeSuffix')}`;
const depletedLabel = family === 'claude' ? store.t('claudeEmpty') : const depletedLabel = family === 'claude' ? store.t('claudeEmpty') :
family === 'gemini' ? store.t('geminiEmpty') : family === 'gemini' ? store.t('geminiEmpty') :
`${familyName} ${store.t('depleted')}`; `${familyName} ${store.t('depleted')}`;
// Active segment // Active segment
data.push(activeVal); data.push(activeVal);

View File

@@ -6,10 +6,36 @@
window.Components = window.Components || {}; window.Components = window.Components || {};
window.Components.modelManager = () => ({ window.Components.modelManager = () => ({
// Track which model is currently being edited (null = none)
editingModelId: null,
init() { init() {
// Component is ready // Component is ready
}, },
/**
* Start editing a model's mapping
* @param {string} modelId - The model to edit
*/
startEditing(modelId) {
this.editingModelId = modelId;
},
/**
* Stop editing
*/
stopEditing() {
this.editingModelId = null;
},
/**
* Check if a model is being edited
* @param {string} modelId - The model to check
*/
isEditing(modelId) {
return this.editingModelId === modelId;
},
/** /**
* Update model configuration with authentication * Update model configuration with authentication
* @param {string} modelId - The model ID to update * @param {string} modelId - The model ID to update

View File

@@ -0,0 +1,58 @@
/**
* Models Component
* Displays model quota/status list
* Registers itself to window.Components for Alpine.js to consume
*/
window.Components = window.Components || {};
window.Components.models = () => ({
init() {
// Ensure data is fetched when this tab becomes active
this.$watch('$store.global.activeTab', (val) => {
if (val === 'models') {
// Trigger recompute to ensure filters are applied
this.$nextTick(() => {
Alpine.store('data').computeQuotaRows();
});
}
});
// Initial compute if already on models tab
if (this.$store.global.activeTab === 'models') {
this.$nextTick(() => {
Alpine.store('data').computeQuotaRows();
});
}
},
/**
* Update model configuration (Pin/Hide quick actions)
* @param {string} modelId - The model ID to update
* @param {object} configUpdates - Configuration updates (pinned, hidden)
*/
async updateModelConfig(modelId, configUpdates) {
const store = Alpine.store('global');
try {
const { response, newPassword } = await window.utils.request('/api/models/config', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ modelId, config: configUpdates })
}, store.webuiPassword);
if (newPassword) store.webuiPassword = newPassword;
if (!response.ok) {
throw new Error('Failed to update model config');
}
// Optimistic update
Alpine.store('data').modelConfig[modelId] = {
...Alpine.store('data').modelConfig[modelId],
...configUpdates
};
Alpine.store('data').computeQuotaRows();
} catch (e) {
store.showToast('Failed to update: ' + e.message, 'error');
}
}
});

View File

@@ -69,34 +69,32 @@ document.addEventListener('alpine:init', () => {
computeQuotaRows() { computeQuotaRows() {
const models = this.models || []; const models = this.models || [];
const rows = []; const rows = [];
const showExhausted = Alpine.store('settings')?.showExhausted ?? true; // Need settings store const showExhausted = Alpine.store('settings')?.showExhausted ?? true;
// Temporary debug flag or settings flag to show hidden models
const showHidden = Alpine.store('settings')?.showHiddenModels ?? false;
models.forEach(modelId => { models.forEach(modelId => {
// Config // Config
const config = this.modelConfig[modelId] || {}; const config = this.modelConfig[modelId] || {};
const family = this.getModelFamily(modelId); const family = this.getModelFamily(modelId);
// Smart Visibility Logic: // Visibility Logic for Models Tab (quotaRows):
// 1. If explicit config exists, use it. // 1. If explicitly hidden via config, always hide
// 2. If no config, default 'unknown' families to HIDDEN to prevent clutter. // 2. If no config, default 'unknown' families to HIDDEN
// 3. Known families (Claude/Gemini) default to VISIBLE. // 3. Known families (Claude/Gemini) default to VISIBLE
// Note: showHiddenModels toggle is for Settings page only, NOT here
let isHidden = config.hidden; let isHidden = config.hidden;
if (isHidden === undefined) { if (isHidden === undefined) {
isHidden = (family === 'other' || family === 'unknown'); isHidden = (family === 'other' || family === 'unknown');
} }
// Skip hidden models unless "Show Hidden" is enabled // Models Tab: ALWAYS hide hidden models (no toggle check)
if (isHidden && !showHidden) return; if (isHidden) return;
// Filters // Filters
if (this.filters.family !== 'all' && this.filters.family !== family) return; if (this.filters.family !== 'all' && this.filters.family !== family) return;
if (this.filters.search) { if (this.filters.search) {
const searchLower = this.filters.search.toLowerCase(); const searchLower = this.filters.search.toLowerCase();
const aliasMatch = config.alias && config.alias.toLowerCase().includes(searchLower);
const idMatch = modelId.toLowerCase().includes(searchLower); const idMatch = modelId.toLowerCase().includes(searchLower);
if (!aliasMatch && !idMatch) return; if (!idMatch) return;
} }
// Data Collection // Data Collection
@@ -138,7 +136,7 @@ document.addEventListener('alpine:init', () => {
rows.push({ rows.push({
modelId, modelId,
displayName: config.alias || modelId, // Use alias if available displayName: modelId, // Simplified: no longer using alias
family, family,
minQuota, minQuota,
avgQuota, // Added Average Quota avgQuota, // Added Average Quota
@@ -165,6 +163,43 @@ document.addEventListener('alpine:init', () => {
if (lower.includes('claude')) return 'claude'; if (lower.includes('claude')) return 'claude';
if (lower.includes('gemini')) return 'gemini'; if (lower.includes('gemini')) return 'gemini';
return 'other'; return 'other';
},
/**
* Get quota data without filters applied (for Dashboard global charts)
* Returns array of { modelId, family, quotaInfo: [{pct}] }
*/
getUnfilteredQuotaData() {
const models = this.models || [];
const rows = [];
const showHidden = Alpine.store('settings')?.showHiddenModels ?? false;
models.forEach(modelId => {
const config = this.modelConfig[modelId] || {};
const family = this.getModelFamily(modelId);
// Smart visibility (same logic as computeQuotaRows)
let isHidden = config.hidden;
if (isHidden === undefined) {
isHidden = (family === 'other' || family === 'unknown');
}
if (isHidden && !showHidden) return;
const quotaInfo = [];
// Use ALL accounts (no account filter)
this.accounts.forEach(acc => {
const limit = acc.limits?.[modelId];
if (!limit) return;
const pct = limit.remainingFraction !== null ? Math.round(limit.remainingFraction * 100) : 0;
quotaInfo.push({ pct });
});
if (quotaInfo.length === 0) return;
rows.push({ modelId, family, quotaInfo });
});
return rows;
} }
}); });
}); });

View File

@@ -15,6 +15,7 @@ document.addEventListener('alpine:init', () => {
translations: { translations: {
en: { en: {
dashboard: "Dashboard", dashboard: "Dashboard",
models: "Models",
accounts: "Accounts", accounts: "Accounts",
logs: "Logs", logs: "Logs",
settings: "Settings", settings: "Settings",
@@ -77,14 +78,16 @@ document.addEventListener('alpine:init', () => {
noSignal: "NO SIGNAL DETECTED", noSignal: "NO SIGNAL DETECTED",
establishingUplink: "ESTABLISHING UPLINK...", establishingUplink: "ESTABLISHING UPLINK...",
// Settings - Models // Settings - Models
modelsDesc: "Manage visibility and ordering of models in the dashboard.", modelsDesc: "Configure model visibility, pinning, and request redirection.",
modelsPageDesc: "Real-time quota and status for all available models.",
showHidden: "Show Hidden Models", showHidden: "Show Hidden Models",
modelId: "Model ID", modelId: "Model ID",
alias: "Alias",
actions: "Actions", actions: "Actions",
pinToTop: "Pin to top", pinToTop: "Pin to top",
toggleVisibility: "Toggle Visibility", toggleVisibility: "Toggle Visibility",
noModels: "NO MODELS DETECTED", noModels: "NO MODELS DETECTED",
modelMappingHint: "Server-side model redirection. Claude Code users: see 'Claude CLI' tab for easier setup.",
modelMapping: "Mapping (Target Model)",
// Settings - Claude // Settings - Claude
proxyConnection: "Proxy Connection", proxyConnection: "Proxy Connection",
modelSelection: "Model Selection", modelSelection: "Model Selection",
@@ -219,6 +222,7 @@ document.addEventListener('alpine:init', () => {
}, },
zh: { zh: {
dashboard: "仪表盘", dashboard: "仪表盘",
models: "模型列表",
accounts: "账号管理", accounts: "账号管理",
logs: "运行日志", logs: "运行日志",
settings: "系统设置", settings: "系统设置",
@@ -282,14 +286,16 @@ document.addEventListener('alpine:init', () => {
noSignal: "无信号连接", noSignal: "无信号连接",
establishingUplink: "正在建立上行链路...", establishingUplink: "正在建立上行链路...",
// Settings - Models // Settings - Models
modelsDesc: "管理仪表盘中模型的可见性和排序。", modelsDesc: "配置模型的可见性、置顶和请求重定向。",
modelsPageDesc: "所有可用模型的实时配额和状态。",
showHidden: "显示隐藏模型", showHidden: "显示隐藏模型",
modelId: "模型 ID", modelId: "模型 ID",
alias: "别名",
actions: "操作", actions: "操作",
pinToTop: "置顶", pinToTop: "置顶",
toggleVisibility: "切换可见性", toggleVisibility: "切换可见性",
noModels: "未检测到模型", noModels: "未检测到模型",
modelMappingHint: "服务端模型重定向功能。Claude Code 用户请使用 'Claude CLI' 标签页以便捷配置。",
modelMapping: "映射 (目标模型)",
// Settings - Claude // Settings - Claude
proxyConnection: "代理连接", proxyConnection: "代理连接",
modelSelection: "模型选择", modelSelection: "模型选择",

View File

@@ -5,8 +5,7 @@
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-lg p-4 hover:border-space-border/60 transition-colors group relative">
<!-- Icon 移到右上角,缩小并变灰 --> <!-- 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-gray-600/60 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
class="w-5 h-5 stroke-current">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <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"> 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">
</path> </path>
@@ -16,15 +15,15 @@
<div class="stat-value text-white font-mono text-4xl font-bold mb-1" x-text="stats.total"></div> <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" <div class="stat-title text-gray-500 font-mono text-xs uppercase tracking-wider truncate"
x-text="$store.global.t('totalAccounts')"></div> x-text="$store.global.t('totalAccounts')"></div>
<div class="stat-desc text-gray-600 text-[10px] truncate" x-text="$store.global.t('registeredNodes')">Registered <div class="stat-desc text-gray-600 text-[10px] truncate" x-text="$store.global.t('registeredNodes')">
Registered
Nodes</div> Nodes</div>
</div> </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"> 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"> <div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-neon-green/50 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
class="w-5 h-5 stroke-current">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <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> d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg> </svg>
@@ -32,14 +31,14 @@
<div class="stat-value text-white font-mono text-4xl font-bold mb-1" x-text="stats.active"></div> <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" <div class="stat-title text-gray-500 font-mono text-xs uppercase tracking-wider truncate"
x-text="$store.global.t('active')"></div> 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> <div class="stat-desc text-neon-green/60 text-[10px] truncate" x-text="$store.global.t('operational')">
</div>
</div> </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"> 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"> <div class="absolute top-3 right-3 text-gray-700/40 group-hover:text-red-500/50 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-5 h-5 stroke-current">
class="w-5 h-5 stroke-current">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <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> d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg> </svg>
@@ -72,14 +71,16 @@
<div class="space-y-1"> <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">
<div class="flex items-center gap-1.5 truncate"> <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
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>
<span class="truncate" x-text="$store.global.t('familyClaude')">Claude</span> <span class="truncate" x-text="$store.global.t('familyClaude')">Claude</span>
</div> </div>
</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">
<div class="flex items-center gap-1.5 truncate"> <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
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>
<span class="truncate" x-text="$store.global.t('familyGemini')">Gemini</span> <span class="truncate" x-text="$store.global.t('familyGemini')">Gemini</span>
</div> </div>
@@ -157,8 +158,9 @@
<!-- Dropdown Menu --> <!-- Dropdown Menu -->
<div x-show="showModelFilter" @click.outside="showModelFilter = false" <div x-show="showModelFilter" @click.outside="showModelFilter = false"
x-transition:enter="transition ease-out duration-100" x-transition:enter-start="opacity-0 scale-95" x-transition:enter="transition ease-out duration-100"
x-transition:enter-end="opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:enter-start="opacity-0 scale-95" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95"
class="absolute right-0 mt-1 w-72 bg-space-900 border border-space-border rounded-lg shadow-xl z-50 overflow-hidden" class="absolute right-0 mt-1 w-72 bg-space-900 border border-space-border rounded-lg shadow-xl z-50 overflow-hidden"
style="display: none;"> style="display: none;">
@@ -191,7 +193,8 @@
class="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-white/5 cursor-pointer group" class="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-white/5 cursor-pointer group"
x-show="displayMode === 'family'"> x-show="displayMode === 'family'">
<input type="checkbox" :checked="isFamilySelected(family)" <input type="checkbox" :checked="isFamilySelected(family)"
@change="toggleFamily(family)" class="checkbox checkbox-xs checkbox-primary"> @change="toggleFamily(family)"
class="checkbox checkbox-xs checkbox-primary">
<div class="w-2 h-2 rounded-full flex-shrink-0" <div class="w-2 h-2 rounded-full flex-shrink-0"
:style="'background-color:' + getFamilyColor(family)"></div> :style="'background-color:' + getFamilyColor(family)"></div>
<span class="text-xs text-gray-300 font-medium group-hover:text-white" <span class="text-xs text-gray-300 font-medium group-hover:text-white"
@@ -205,7 +208,8 @@
x-show="displayMode === 'model'"> x-show="displayMode === 'model'">
<div class="w-1.5 h-1.5 rounded-full" <div class="w-1.5 h-1.5 rounded-full"
:style="'background-color:' + getFamilyColor(family)"></div> :style="'background-color:' + getFamilyColor(family)"></div>
<span x-text="$store.global.t('family' + family.charAt(0).toUpperCase() + family.slice(1))"></span> <span
x-text="$store.global.t('family' + family.charAt(0).toUpperCase() + family.slice(1))"></span>
</div> </div>
<!-- Models in Family --> <!-- Models in Family -->
@@ -249,7 +253,8 @@
<template x-for="family in selectedFamilies" :key="family"> <template x-for="family in selectedFamilies" :key="family">
<div class="flex items-center gap-1.5 text-[10px] font-mono"> <div class="flex items-center gap-1.5 text-[10px] font-mono">
<div class="w-2 h-2 rounded-full" :style="'background-color:' + getFamilyColor(family)"></div> <div class="w-2 h-2 rounded-full" :style="'background-color:' + getFamilyColor(family)"></div>
<span class="text-gray-400" x-text="$store.global.t('family' + family.charAt(0).toUpperCase() + family.slice(1))"></span> <span class="text-gray-400"
x-text="$store.global.t('family' + family.charAt(0).toUpperCase() + family.slice(1))"></span>
</div> </div>
</template> </template>
</template> </template>
@@ -288,140 +293,4 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Controls -->
<div class="flex flex-col lg:flex-row items-center justify-between gap-4 glass-panel p-4 rounded-lg h-auto">
<div class="flex flex-col md:flex-row items-center gap-4 w-full lg:w-auto">
<!-- Custom Select -->
<div class="relative w-full md:w-64 h-10">
<select
class="appearance-none w-full h-full bg-space-800 border border-space-border text-gray-300 rounded-lg pl-4 pr-10 focus:outline-none focus:border-neon-purple focus:ring-1 focus:ring-neon-purple transition-all truncate text-sm"
x-model="$store.data.filters.account" @change="$store.data.computeQuotaRows()">
<option value="all" x-text="$store.global.t('allAccounts')">All Accounts</option>
<template x-for="acc in $store.data.accounts" :key="acc.email">
<option :value="acc.email" x-text="acc.email.split('@')[0]"></option>
</template>
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-gray-500">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</div>
</div>
<!-- Filter Buttons -->
<div class="join h-10 w-full md:w-auto overflow-x-auto">
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'all'}"
@click="$store.data.filters.family = 'all'; $store.data.computeQuotaRows()" x-text="$store.global.t('allCaps')">ALL</button>
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'claude'}"
@click="$store.data.filters.family = 'claude'; $store.data.computeQuotaRows()" x-text="$store.global.t('claudeCaps')">CLAUDE</button>
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'gemini'}"
@click="$store.data.filters.family = 'gemini'; $store.data.computeQuotaRows()" x-text="$store.global.t('geminiCaps')">GEMINI</button>
</div>
</div>
<!-- Search -->
<div class="relative w-full md:w-72 h-10">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg class="h-4 w-4 text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<input type="text" :placeholder="$store.global.t('searchPlaceholder')"
class="w-full h-full bg-space-800 border border-space-border text-gray-300 rounded-lg pl-10 pr-4 focus:outline-none focus:border-neon-purple focus:ring-1 focus:ring-neon-purple transition-all text-sm placeholder-gray-600"
x-model.debounce="$store.data.filters.search" @input="$store.data.computeQuotaRows()">
</div>
</div>
<!-- Main Table -->
<div class="glass-panel rounded-xl overflow-x-auto min-h-[400px]">
<table class="standard-table"
:class="{'table-xs': $store.settings.compact, 'table-sm': !$store.settings.compact}">
<thead>
<tr>
<th class="w-14 py-3 pl-4 whitespace-nowrap" x-text="$store.global.t('stat')">Stat</th>
<th class="py-3 whitespace-nowrap" x-text="$store.global.t('modelIdentity')">Model Identity</th>
<th class="min-w-[12rem] py-3 whitespace-nowrap" x-text="$store.global.t('globalQuota')">Global Quota</th>
<th class="min-w-[8rem] py-3 whitespace-nowrap" x-text="$store.global.t('nextReset')">Next Reset</th>
<th class="py-3 pr-4 text-right whitespace-nowrap" x-text="$store.global.t('distribution')">Account
Distribution</th>
</tr>
</thead>
<tbody class="text-sm">
<template x-for="row in $store.data.quotaRows" :key="row.modelId">
<tr class="group">
<td class="pl-4">
<div class="w-2 h-2 rounded-full transition-all duration-500"
:class="row.avgQuota > 0 ? 'bg-neon-green shadow-[0_0_8px_rgba(34,197,94,0.6)]' : 'bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]'">
</div>
</td>
<td>
<div class="font-bold text-gray-200 group-hover:text-neon-purple transition-colors"
x-text="row.modelId"></div>
<div class="text-[10px] font-mono text-gray-500 uppercase"
x-text="$store.global.t('family' + row.family.charAt(0).toUpperCase() + row.family.slice(1))">
</div>
</td>
<td>
<div class="flex flex-col gap-1 pr-4">
<div class="flex justify-between text-xs font-mono">
<span x-text="row.avgQuota + '%'"
:class="row.avgQuota > 0 ? 'text-white' : 'text-red-500'"></span>
</div>
<progress class="progress w-full h-1 bg-space-800"
:class="row.avgQuota > 50 ? 'progress-gradient-success' : (row.avgQuota > 0 ? 'progress-gradient-warning' : 'progress-gradient-error')"
:value="row.avgQuota" max="100"></progress>
</div>
</td>
<td class="font-mono text-xs">
<span x-text="row.resetIn"
:class="(row.resetIn && row.resetIn.indexOf('h') === -1 && row.resetIn !== '-') ? 'text-neon-purple font-bold' : 'text-gray-400'"></span>
</td>
<td>
<div class="flex items-center justify-end gap-3 pr-4">
<div
class="text-[10px] font-mono text-gray-500 hidden xl:block text-right leading-tight opacity-70">
<div x-text="$store.global.t('activeCount', {count: row.quotaInfo.filter(q => q.pct > 0).length})"></div>
</div>
<div class="flex flex-wrap gap-1 justify-end max-w-[200px]">
<template x-for="q in row.quotaInfo" :key="q.fullEmail">
<div class="tooltip tooltip-left" :data-tip="q.fullEmail + ' (' + q.pct + '%)'">
<div class="w-1.5 h-3 rounded-[1px] transition-all hover:scale-125 cursor-help"
:class="q.pct > 50 ? 'bg-neon-green opacity-80' : (q.pct > 0 ? 'bg-yellow-500 opacity-80' : 'bg-red-900 opacity-50')">
</div>
</div>
</template>
</div>
</div>
</td>
</tr>
</template>
<!-- Loading -->
<tr x-show="$store.data.loading && !$store.data.quotaRows.length">
<td colspan="5" class="h-64 text-center">
<div class="flex flex-col items-center justify-center gap-3">
<span class="loading loading-bars loading-md text-neon-purple"></span>
<span class="text-xs font-mono text-gray-600 animate-pulse"
x-text="$store.global.t('establishingUplink')">ESTABLISHING
UPLINK...</span>
</div>
</td>
</tr>
<!-- Empty -->
<tr x-show="!$store.data.loading && $store.data.quotaRows.length === 0">
<td colspan="5" class="h-64 text-center text-gray-600 font-mono text-xs"
x-text="$store.global.t('noSignal')">
NO SIGNAL DETECTED
</td>
</tr>
</tbody>
</table>
</div>
</div> </div>

193
public/views/models.html Normal file
View File

@@ -0,0 +1,193 @@
<div x-data="models" class="view-container">
<!-- Header -->
<div class="flex items-center justify-between mb-6">
<div>
<h2 class="text-xl font-bold text-white" x-text="$store.global.t('models')">Models</h2>
<p class="text-sm text-gray-500" x-text="$store.global.t('modelsPageDesc')">Real-time quota and status for
all available models.</p>
</div>
</div>
<!-- Controls -->
<div class="flex flex-col lg:flex-row items-center justify-between gap-4 glass-panel p-4 rounded-lg h-auto mb-6">
<div class="flex flex-col md:flex-row items-center gap-4 w-full lg:w-auto">
<!-- Custom Select -->
<div class="relative w-full md:w-64 h-10">
<select
class="appearance-none w-full h-full bg-space-800 border border-space-border text-gray-300 rounded-lg pl-4 pr-10 focus:outline-none focus:border-neon-purple focus:ring-1 focus:ring-neon-purple transition-all truncate text-sm"
x-model="$store.data.filters.account" @change="$store.data.computeQuotaRows()">
<option value="all" x-text="$store.global.t('allAccounts')">All Accounts</option>
<template x-for="acc in $store.data.accounts" :key="acc.email">
<option :value="acc.email" x-text="acc.email.split('@')[0]"></option>
</template>
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-gray-500">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</div>
</div>
<!-- Filter Buttons -->
<div class="join h-10 w-full md:w-auto overflow-x-auto">
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'all'}"
@click="$store.data.filters.family = 'all'; $store.data.computeQuotaRows()"
x-text="$store.global.t('allCaps')">ALL</button>
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'claude'}"
@click="$store.data.filters.family = 'claude'; $store.data.computeQuotaRows()"
x-text="$store.global.t('claudeCaps')">CLAUDE</button>
<button
class="join-item btn btn-sm h-full flex-1 md:flex-none px-4 md:px-6 border-space-border bg-space-800 text-gray-400 hover:text-white hover:bg-space-700 hover:border-space-600 transition-all font-medium text-xs tracking-wide whitespace-nowrap"
:class="{'bg-neon-purple text-white border-neon-purple hover:bg-purple-600 hover:border-purple-500': $store.data.filters.family === 'gemini'}"
@click="$store.data.filters.family = 'gemini'; $store.data.computeQuotaRows()"
x-text="$store.global.t('geminiCaps')">GEMINI</button>
</div>
</div>
<!-- Search -->
<div class="relative w-full md:w-72 h-10">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg class="h-4 w-4 text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<input type="text" :placeholder="$store.global.t('searchPlaceholder')"
class="w-full h-full bg-space-800 border border-space-border text-gray-300 rounded-lg pl-10 pr-4 focus:outline-none focus:border-neon-purple focus:ring-1 focus:ring-neon-purple transition-all text-sm placeholder-gray-600"
x-model.debounce="$store.data.filters.search" @input="$store.data.computeQuotaRows()">
</div>
</div>
<!-- Main Table -->
<div class="glass-panel rounded-xl overflow-x-auto min-h-[400px]">
<table class="standard-table"
:class="{'table-xs': $store.settings.compact, 'table-sm': !$store.settings.compact}">
<thead>
<tr>
<th class="w-14 py-3 pl-4 whitespace-nowrap" x-text="$store.global.t('stat')">Stat</th>
<th class="py-3 whitespace-nowrap" x-text="$store.global.t('modelIdentity')">Model Identity</th>
<th class="min-w-[12rem] py-3 whitespace-nowrap" x-text="$store.global.t('globalQuota')">Global
Quota</th>
<th class="min-w-[8rem] py-3 whitespace-nowrap" x-text="$store.global.t('nextReset')">Next Reset
</th>
<th class="py-3 whitespace-nowrap" x-text="$store.global.t('distribution')">Account
Distribution</th>
<th class="w-20 py-3 pr-4 text-right whitespace-nowrap" x-text="$store.global.t('actions')">Actions
</th>
</tr>
</thead>
<tbody class="text-sm">
<template x-for="row in $store.data.quotaRows" :key="row.modelId">
<tr class="group">
<td class="pl-4">
<div class="w-2 h-2 rounded-full transition-all duration-500"
:class="row.avgQuota > 0 ? 'bg-neon-green shadow-[0_0_8px_rgba(34,197,94,0.6)]' : 'bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]'">
</div>
</td>
<td>
<div class="font-bold text-gray-200 group-hover:text-neon-purple transition-colors"
x-text="row.modelId"></div>
<div class="text-[10px] font-mono text-gray-500 uppercase"
x-text="$store.global.t('family' + row.family.charAt(0).toUpperCase() + row.family.slice(1))">
</div>
</td>
<td>
<div class="flex flex-col gap-1 pr-4">
<div class="flex justify-between text-xs font-mono">
<span x-text="row.avgQuota + '%'"
:class="row.avgQuota > 0 ? 'text-white' : 'text-red-500'"></span>
</div>
<progress class="progress w-full h-1 bg-space-800"
:class="row.avgQuota > 50 ? 'progress-gradient-success' : (row.avgQuota > 0 ? 'progress-gradient-warning' : 'progress-gradient-error')"
:value="row.avgQuota" max="100"></progress>
</div>
</td>
<td class="font-mono text-xs">
<span x-text="row.resetIn"
:class="(row.resetIn && row.resetIn.indexOf('h') === -1 && row.resetIn !== '-') ? 'text-neon-purple font-bold' : 'text-gray-400'"></span>
</td>
<td>
<div class="flex items-center justify-end gap-3">
<div
class="text-[10px] font-mono text-gray-500 hidden xl:block text-right leading-tight opacity-70">
<div
x-text="$store.global.t('activeCount', {count: row.quotaInfo.filter(q => q.pct > 0).length})">
</div>
</div>
<div class="flex flex-wrap gap-1 justify-end max-w-[200px]">
<template x-for="q in row.quotaInfo" :key="q.fullEmail">
<div class="tooltip tooltip-left" :data-tip="q.fullEmail + ' (' + q.pct + '%)">
<div class="w-1.5 h-3 rounded-[1px] transition-all hover:scale-125 cursor-help"
:class="q.pct > 50 ? 'bg-neon-green opacity-80' : (q.pct > 0 ? 'bg-yellow-500 opacity-80' : 'bg-red-900 opacity-50')">
</div>
</div>
</template>
</div>
</div>
</td>
<td class="text-right pr-4">
<div
class="flex items-center justify-end gap-1 opacity-50 group-hover:opacity-100 transition-opacity">
<!-- Pin Toggle -->
<button class="btn btn-xs btn-circle transition-colors"
:class="row.pinned ? 'bg-neon-purple/20 text-neon-purple border-neon-purple/50 hover:bg-neon-purple/30' : 'btn-ghost text-gray-600 hover:text-gray-300'"
@click="await updateModelConfig(row.modelId, { pinned: !row.pinned })"
:title="$store.global.t('pinToTop')">
<svg x-show="row.pinned" xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5"
viewBox="0 0 20 20" fill="currentColor">
<path d="M5 4a2 2 0 012-2h6a2 2 0 012 2v14l-5-2.5L5 18V4z" />
</svg>
<svg x-show="!row.pinned" xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z" />
</svg>
</button>
<!-- Hide Toggle -->
<button class="btn btn-xs btn-circle transition-colors"
:class="row.hidden ? 'bg-red-500/20 text-red-400 border-red-500/50 hover:bg-red-500/30' : 'btn-ghost text-gray-400 hover:text-white'"
@click="await updateModelConfig(row.modelId, { hidden: !row.hidden })"
:title="$store.global.t('toggleVisibility')">
<svg x-show="!row.hidden" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
<svg x-show="row.hidden" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
</button>
</div>
</td>
</tr>
</template>
<!-- Loading -->
<tr x-show="$store.data.loading && !$store.data.quotaRows.length">
<td colspan="6" class="h-64 text-center">
<div class="flex flex-col items-center justify-center gap-3">
<span class="loading loading-bars loading-md text-neon-purple"></span>
<span class="text-xs font-mono text-gray-600 animate-pulse"
x-text="$store.global.t('establishingUplink')">ESTABLISHING
UPLINK...</span>
</div>
</td>
</tr>
<!-- Empty -->
<tr x-show="!$store.data.loading && $store.data.quotaRows.length === 0">
<td colspan="6" class="h-64 text-center text-gray-600 font-mono text-xs"
x-text="$store.global.t('noSignal')">
NO SIGNAL DETECTED
</td>
</tr>
</tbody>
</table>
</div>
</div>

File diff suppressed because it is too large Load Diff