"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/
Python
fix(hub): compact footer analytics
yuhao1bb1010de491
diff --git a/docs/hub/index-modern.html b/docs/hub/index-modern.htmlindex 881a10e48..5555bc71a 100644--- a/docs/hub/index-modern.html+++ b/docs/hub/index-modern.html@@ -869,7 +869,7 @@top: 16px;z-index: 6;margin: 1.15rem;- padding: 1rem;+ padding: 0.75rem;border-radius: var(--radius-lg);border: 1px solid var(--border);background: linear-gradient(180deg, rgba(14, 18, 26, 0.94), rgba(20, 26, 36, 0.84));@@ -1488,7 +1488,7 @@box-shadow: var(--shadow-md);display: grid;grid-template-columns: 1fr;- gap: 0.8rem;+ gap: 0.55rem;}.footer-band,@@ -1496,25 +1496,26 @@border-radius: var(--radius-lg);border: 1px solid var(--border);background: rgba(255,255,255,0.03);- padding: 1rem 1.05rem;+ padding: 0.72rem 0.85rem;}.footer-band {display: flex;flex-direction: column;- gap: 0.6rem;+ gap: 0.38rem;}.footer-label {color: var(--text-tertiary);- font-size: 0.74rem;+ font-size: 0.68rem;letter-spacing: 0.12em;text-transform: uppercase;}.footer-copy {color: var(--text-secondary);- font-size: 0.95rem;+ font-size: 0.88rem;+ line-height: 1.38;}.footer-copy a,@@ -1530,97 +1531,100 @@.footer-brand {color: var(--text-tertiary);- font-size: 0.86rem;+ font-size: 0.78rem;+ line-height: 1.3;}.footer-stats {display: flex;- flex-direction: column;justify-content: center;- gap: 0.55rem;- width: min(760px, 100%);+ width: min(860px, 100%);margin: 0 auto;+ padding: 0.5rem 0.72rem;+ border-radius: var(--radius-md);+ background: rgba(255,255,255,0.03);}.footer-analytics-board {- border-radius: 20px;- border: 1px solid var(--border);- background: rgba(255,255,255,0.03);- box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);- padding: 0.34rem 0.95rem;+ display: flex;+ align-items: center;+ justify-content: center;+ flex-wrap: wrap;+ gap: 0.32rem 0.7rem;+ min-width: 0;font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;+ font-size: 0.74rem;+ line-height: 1.35;+ color: var(--text-tertiary);+ }++ .analytics-kicker,+ .analytics-row,+ .analytics-key,+ .metric-cell,+ .metric-pair {+ display: inline-flex;+ align-items: center;+ min-width: 0;+ white-space: nowrap;+ }++ .analytics-kicker {+ font-size: 0.65rem;+ font-weight: 700;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ color: var(--text-tertiary);}.analytics-row {- display: grid;- grid-template-columns: minmax(0, 168px) repeat(3, minmax(0, 1fr));- align-items: end;- gap: 0.7rem;- padding: 0.74rem 0;+ gap: 0.42rem;}- .analytics-row + .analytics-row {- border-top: 1px solid var(--border);+ .analytics-key {+ font-size: 0.68rem;+ color: var(--text-tertiary);+ font-variant-numeric: tabular-nums;}.analytics-title {- font-size: 0.93rem;font-weight: 600;- color: var(--text);- letter-spacing: -0.02em;- line-height: 1.2;+ color: var(--text-secondary);}.metric-cell {- display: flex;- flex-direction: column;- align-items: flex-start;- gap: 0.18rem;- min-width: 0;+ gap: 0.22rem;}.metric-label {- display: inline-flex;- align-items: center;- gap: 0.34rem;- min-width: 0;- font-size: 0.69rem;color: var(--text-tertiary);- letter-spacing: 0.01em;- white-space: nowrap;}- .metric-dot {- width: 0.42rem;- height: 0.42rem;- border-radius: 999px;- flex-shrink: 0;- background: rgba(129, 144, 171, 0.55);- }-- .metric-value {- font-size: 1.05rem;+ .metric-value,+ .metric-pair strong {+ font-size: 0.84rem;line-height: 1;color: var(--text);font-variant-numeric: tabular-nums;- letter-spacing: -0.03em;+ letter-spacing: -0.018em;white-space: nowrap;}- .metric-cell.total .metric-value {- font-weight: 700;- }-- .metric-cell.human .metric-dot {- background: var(--green);+ .metric-pair {+ gap: 0.18rem;+ color: var(--text-tertiary);}- .metric-cell.agent .metric-dot {- background: var(--accent);+ .metric-pair .human-value,+ .metric-pair .agent-value {+ color: var(--text);}- .metric-cell.total .metric-label {- color: var(--text-secondary);+ .analytics-divider {+ width: 1px;+ height: 0.9rem;+ background: var(--border);+ flex: 0 0 auto;}.sr-only {@@ -1739,14 +1743,7 @@grid-template-columns: 1fr;}- .analytics-row {- grid-template-columns: repeat(3, minmax(0, 1fr));- gap: 0.5rem 0.75rem;- }-- .analytics-title {- grid-column: 1 / -1;- }+ .footer-analytics-board { justify-content: flex-start; }}@media (max-width: 640px) {@@ -1821,18 +1818,11 @@padding-right: 0.9rem;}- .footer-analytics-board {- padding: 0.3rem 0.78rem;- }-- .analytics-row {- padding: 0.58rem 0;- grid-template-columns: repeat(2, minmax(0, 1fr));+ .footer-stats {+ padding: 0.5rem 0.68rem;}- .analytics-title {- grid-column: 1 / -1;- }+ .analytics-divider { display: none; }}</style><!-- Analytics provider is configured in the footer script. -->@@ -2091,38 +2081,20 @@<div class="footer-brand">Powered by <a href="https://github.com/HKUDS/CLI-Anything" target="_blank">CLI-Anything</a></div></div><div class="footer-stats">- <div class="footer-label">Traffic Snapshot</div><div class="footer-analytics-board" aria-label="Traffic snapshot">- <div class="analytics-row">- <div class="analytics-title">Website Visits</div>- <div class="metric-cell total">- <span class="metric-label">Total</span>- <strong id="stat-total" class="metric-value">...</strong>- </div>- <div class="metric-cell human">- <span class="metric-label"><span class="metric-dot" aria-hidden="true"></span>Human</span>- <strong id="stat-human" class="metric-value">...</strong>- </div>- <div class="metric-cell agent">- <span class="metric-label"><span class="metric-dot" aria-hidden="true"></span>Agent</span>- <strong id="stat-agent" class="metric-value">...</strong>- </div>- </div>- <div class="analytics-row">- <div class="analytics-title">CLI-Hub Usage</div>- <div class="metric-cell total">- <span class="metric-label">Total</span>- <strong id="stat-cli-total" class="metric-value">...</strong>- </div>- <div class="metric-cell human">- <span class="metric-label"><span class="metric-dot" aria-hidden="true"></span>Human</span>- <strong id="stat-cli-human" class="metric-value">...</strong>- </div>- <div class="metric-cell agent">- <span class="metric-label"><span class="metric-dot" aria-hidden="true"></span>Agent</span>- <strong id="stat-cli-agent" class="metric-value">...</strong>- </div>- </div>+ <span class="analytics-kicker">Traffic</span>+ <span class="analytics-key">Human/Agent</span>+ <span class="analytics-row">+ <span class="analytics-title">Page</span>+ <strong id="stat-total" class="metric-value">...</strong>+ <span class="metric-pair"><strong id="stat-human" class="human-value">...</strong>/<strong id="stat-agent" class="agent-value">...</strong></span>+ </span>+ <span class="analytics-divider" aria-hidden="true"></span>+ <span class="analytics-row">+ <span class="analytics-title">CLI</span>+ <strong id="stat-cli-total" class="metric-value">...</strong>+ <span class="metric-pair"><strong id="stat-cli-human" class="human-value">...</strong>/<strong id="stat-cli-agent" class="agent-value">...</strong></span>+ </span></div></div></footer>@@ -2701,12 +2673,17 @@}function applyVisitorStats(stats) {- document.getElementById('stat-total').textContent = (stats.total || 0).toLocaleString();- document.getElementById('stat-human').textContent = (stats.human || 0).toLocaleString();- document.getElementById('stat-agent').textContent = (stats.agent || 0).toLocaleString();- document.getElementById('stat-cli-total').textContent = (stats.cli_hub_total || 0).toLocaleString();- document.getElementById('stat-cli-human').textContent = (stats.cli_hub_human || 0).toLocaleString();- document.getElementById('stat-cli-agent').textContent = (stats.cli_hub_agent || 0).toLocaleString();+ const formatK = (val) => {+ const n = Number(val) || 0;+ if (!n) return '0K';+ return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'K';+ };+ document.getElementById('stat-total').textContent = formatK(stats.total);+ document.getElementById('stat-human').textContent = formatK(stats.human);+ document.getElementById('stat-agent').textContent = formatK(stats.agent);+ document.getElementById('stat-cli-total').textContent = formatK(stats.cli_hub_total);+ document.getElementById('stat-cli-human').textContent = formatK(stats.cli_hub_human);+ document.getElementById('stat-cli-agent').textContent = formatK(stats.cli_hub_agent);}function readUaBrands() {@@ -2908,9 +2885,8 @@});// ── Live analytics via Cloudflare Worker proxy ──- // Runtime stats are fetched once per page load. The Worker combines- // Cloudflare HTTP totals with tracked agent events and derives human- // website visits as total HTTP requests minus visit-agent events.+ // Runtime stats are fetched once per page load and rendered as compact+ // site page-view and CLI-Hub usage counters split by human/agent.const ANALYTICS_PROXY_URL = 'https://analytics.clianything.cc/';const ZERO_STATS = {human: 0, agent: 0,diff --git a/docs/hub/index.html b/docs/hub/index.htmlindex 2dae96375..3ce224f45 100644--- a/docs/hub/index.html+++ b/docs/hub/index.html@@ -1537,18 +1537,20 @@.footer {max-width: 1120px;margin: 0 auto;- padding: 2rem 1.5rem;+ padding: 1.05rem 1.5rem 1rem;border-top: 1px solid var(--border-subtle);display: flex;justify-content: space-between;align-items: center;flex-wrap: wrap;- gap: 0.75rem;+ gap: 0.52rem 1rem;}.footer-left {+ flex: 1 1 620px;font-size: 0.8rem;color: var(--text-tertiary);+ line-height: 1.45;}.footer-left a {@@ -1578,198 +1580,95 @@width: 100%;display: flex;justify-content: center;- padding-top: 1.1rem;- margin-top: 0.35rem;+ padding-top: 0.45rem;+ margin-top: 0.05rem;+ border-top: 1px solid var(--border-subtle);}.analytics-report {- width: min(780px, 100%);- padding: 0.95rem 1.2rem 0.9rem;+ width: min(860px, 100%);+ min-height: 2rem;+ padding: 0.36rem 0.62rem;border: 1px solid var(--border-subtle);- border-radius: 14px;- background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0));+ border-radius: 8px;+ background: rgba(255,255,255,0.014);+ display: flex;+ align-items: center;+ justify-content: center;+ flex-wrap: wrap;+ gap: 0.32rem 0.7rem;font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;- transition: border-color 0.2s ease, background 0.2s ease;+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.026);+ transition: border-color 0.2s ease;}:root[data-theme="light"] .analytics-report {- background: linear-gradient(180deg, rgba(9,9,11,0.012), rgba(9,9,11,0));+ background: rgba(9,9,11,0.018);}.analytics-report:hover {border-color: var(--border);}- .analytics-report-head {- display: flex;+ .analytics-kicker,+ .analytics-row,+ .analytics-key,+ .analytics-pair {+ display: inline-flex;align-items: center;- justify-content: space-between;- gap: 1rem;- margin-bottom: 0.75rem;+ min-width: 0;+ white-space: nowrap;}- .analytics-eyebrow {- display: inline-flex;- align-items: center;- gap: 0.5rem;- font-size: 0.66rem;+ .analytics-kicker {+ font-size: 0.65rem;font-weight: 600;- letter-spacing: 0.14em;+ letter-spacing: 0.12em;text-transform: uppercase;color: var(--text-tertiary);}- .analytics-eyebrow::before {- content: "";- width: 0.4rem;- height: 0.4rem;- border-radius: 999px;- background: var(--green);- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);- animation: analyticsPulse 2.4s ease-in-out infinite;- }-- @keyframes analyticsPulse {- 0%, 100% { opacity: 1; }- 50% { opacity: 0.45; }- }-- .analytics-legend {- display: inline-flex;- align-items: center;- gap: 1rem;- font-size: 0.7rem;- color: var(--text-tertiary);- letter-spacing: 0.01em;- }-- .analytics-legend-item {- display: inline-flex;- align-items: center;- gap: 0.42rem;- }-- .analytics-dot {- width: 0.42rem;- height: 0.42rem;- border-radius: 999px;- background: var(--text-tertiary);- flex-shrink: 0;- }-- .analytics-dot.human { background: var(--green); }- .analytics-dot.agent { background: var(--accent); }-- .analytics-report-grid {- display: grid;- grid-template-columns: repeat(2, minmax(0, 1fr));- gap: 1.5rem;- }-- .analytics-stat {- display: flex;- flex-direction: column;+ .analytics-row {gap: 0.42rem;- min-width: 0;+ font-size: 0.74rem;+ color: var(--text-tertiary);}- .analytics-stat + .analytics-stat {- border-left: 1px solid var(--border-subtle);- padding-left: 1.5rem;+ .analytics-key {+ font-size: 0.68rem;+ color: var(--text-tertiary);+ font-variant-numeric: tabular-nums;}- .analytics-stat-label {- font-size: 0.7rem;- font-weight: 500;+ .analytics-title {color: var(--text-secondary);- letter-spacing: 0;- line-height: 1;+ font-weight: 600;}- .analytics-stat-value {- display: block;- font-size: 1.55rem;- font-weight: 600;- line-height: 1;+ .analytics-total,+ .analytics-pair strong {color: var(--text);+ font-size: 0.84rem;+ font-weight: 650;font-variant-numeric: tabular-nums;- letter-spacing: -0.04em;- white-space: nowrap;+ letter-spacing: -0.018em;}- .analytics-bar {- position: relative;- display: flex;- width: 100%;- height: 2px;- border-radius: 999px;- background: var(--border-subtle);- overflow: hidden;- }-- .analytics-bar > span {- display: block;- height: 100%;- transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);- }-- .analytics-bar .bar-human {- background: var(--green);- }-- .analytics-bar .bar-agent {- background: var(--accent);- }-- .analytics-split {- display: flex;- flex-wrap: wrap;- gap: 0.3rem 1.1rem;- margin: 0;- }-- .analytics-split-item {- display: inline-flex;- align-items: baseline;- gap: 0.42rem;- min-width: 0;- }-- .analytics-split-item dt {- display: inline-flex;- align-items: center;- gap: 0.34rem;- font-size: 0.68rem;+ .analytics-pair {+ gap: 0.18rem;color: var(--text-tertiary);- letter-spacing: 0.01em;- line-height: 1;- margin: 0;}- .analytics-split-item dd {- display: inline-flex;- align-items: baseline;- gap: 0.34rem;- margin: 0;- min-width: 0;- }-- .analytics-split-num {- font-size: 0.82rem;- font-weight: 500;+ .analytics-pair .human-value,+ .analytics-pair .agent-value {color: var(--text);- font-variant-numeric: tabular-nums;- letter-spacing: -0.02em;- line-height: 1;- white-space: nowrap;}- .analytics-split-pct {- font-size: 0.68rem;- color: var(--text-tertiary);- font-variant-numeric: tabular-nums;- letter-spacing: 0;- line-height: 1;+ .analytics-divider {+ width: 1px;+ height: 0.9rem;+ background: var(--border-subtle);+ flex: 0 0 auto;}/* ── Responsive ── */@@ -1823,7 +1722,11 @@}.marketplace-prelude { padding: 0.75rem 1.25rem 0; }.nav { padding: 0.75rem 1.25rem; }- .footer { padding: 1.5rem 1.25rem; flex-direction: column; align-items: flex-start; }+ .footer { padding: 1.1rem 1.25rem; align-items: flex-start; }+ .footer-stats { justify-content: flex-start; }+ .analytics-report {+ justify-content: flex-start;+ }.empower-row { flex-direction: column; }.empower-card { margin: 0 0 1rem; padding: 1.25rem; }.typing-shell { padding: 0.72rem 0.78rem 0.8rem; }@@ -1833,25 +1736,6 @@.empower-self .cmd-grid { grid-template-columns: 1fr; }.deck-nav { padding: 1.25rem 1.25rem 0; }.deck-arrow-btn span { display: none; }- .analytics-report {- padding: 0.85rem 1rem 0.8rem;- border-radius: 12px;- }- .analytics-report-head {- gap: 0.75rem;- margin-bottom: 0.65rem;- }- .analytics-report-grid {- grid-template-columns: 1fr;- gap: 0.75rem;- }- .analytics-stat + .analytics-stat {- border-left: none;- border-top: 1px solid var(--border-subtle);- padding-left: 0;- padding-top: 0.75rem;- }- .analytics-stat-value { font-size: 1.4rem; }}@media (max-width: 1120px) {@@ -2077,51 +1961,19 @@</div><div class="footer-stats"><section class="analytics-report" aria-label="Traffic snapshot">- <header class="analytics-report-head">- <span class="analytics-eyebrow">Live traffic</span>- <span class="analytics-legend" aria-hidden="true">- <span class="analytics-legend-item"><span class="analytics-dot human"></span>Human</span>- <span class="analytics-legend-item"><span class="analytics-dot agent"></span>Agent</span>- </span>- </header>- <div class="analytics-report-grid">- <article class="analytics-stat">- <span class="analytics-stat-label">Website visits</span>- <strong id="stat-total" class="analytics-stat-value">...</strong>- <div class="analytics-bar" aria-hidden="true">- <span class="bar-human" id="bar-site-human" style="width: 0%"></span>- <span class="bar-agent" id="bar-site-agent" style="width: 0%"></span>- </div>- <dl class="analytics-split">- <div class="analytics-split-item">- <dt><span class="analytics-dot human"></span>Human</dt>- <dd><span id="stat-human" class="analytics-split-num">...</span><span id="pct-site-human" class="analytics-split-pct">...</span></dd>- </div>- <div class="analytics-split-item">- <dt><span class="analytics-dot agent"></span>Agent</dt>- <dd><span id="stat-agent" class="analytics-split-num">...</span><span id="pct-site-agent" class="analytics-split-pct">...</span></dd>- </div>- </dl>- </article>- <article class="analytics-stat">- <span class="analytics-stat-label">CLI-Hub usage</span>- <strong id="stat-cli-total" class="analytics-stat-value">...</strong>- <div class="analytics-bar" aria-hidden="true">- <span class="bar-human" id="bar-cli-human" style="width: 0%"></span>- <span class="bar-agent" id="bar-cli-agent" style="width: 0%"></span>- </div>- <dl class="analytics-split">- <div class="analytics-split-item">- <dt><span class="analytics-dot human"></span>Human</dt>- <dd><span id="stat-cli-human" class="analytics-split-num">...</span><span id="pct-cli-human" class="analytics-split-pct">...</span></dd>- </div>- <div class="analytics-split-item">- <dt><span class="analytics-dot agent"></span>Agent</dt>- <dd><span id="stat-cli-agent" class="analytics-split-num">...</span><span id="pct-cli-agent" class="analytics-split-pct">...</span></dd>- </div>- </dl>- </article>- </div>+ <span class="analytics-kicker">Traffic</span>+ <span class="analytics-key">Human/Agent</span>+ <span class="analytics-row">+ <span class="analytics-title">Page</span>+ <strong id="stat-total" class="analytics-total">...</strong>+ <span class="analytics-pair"><strong id="stat-human" class="human-value">...</strong>/<strong id="stat-agent" class="agent-value">...</strong></span>+ </span>+ <span class="analytics-divider" aria-hidden="true"></span>+ <span class="analytics-row">+ <span class="analytics-title">CLI</span>+ <strong id="stat-cli-total" class="analytics-total">...</strong>+ <span class="analytics-pair"><strong id="stat-cli-human" class="human-value">...</strong>/<strong id="stat-cli-agent" class="agent-value">...</strong></span>+ </span></section></div></footer>@@ -2895,23 +2747,14 @@}function applyVisitorStats(stats) {+ const formatK = (val) => {+ const n = Number(val) || 0;+ if (!n) return '0K';+ return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'K';+ };const setText = (id, val) => {const el = document.getElementById(id);- if (el) el.textContent = (val || 0).toLocaleString();- };- const setSplit = (prefix, human, agent) => {- const total = (human || 0) + (agent || 0);- const humanPct = total > 0 ? (human / total) * 100 : 0;- const agentPct = total > 0 ? 100 - humanPct : 0;- const fmtPct = (n) => (n >= 10 || n === 0 ? Math.round(n) : n.toFixed(1)) + '%';- const barH = document.getElementById('bar-' + prefix + '-human');- const barA = document.getElementById('bar-' + prefix + '-agent');- if (barH) barH.style.width = humanPct.toFixed(2) + '%';- if (barA) barA.style.width = agentPct.toFixed(2) + '%';- const pctH = document.getElementById('pct-' + prefix + '-human');- const pctA = document.getElementById('pct-' + prefix + '-agent');- if (pctH) pctH.textContent = fmtPct(humanPct);- if (pctA) pctA.textContent = fmtPct(agentPct);+ if (el) el.textContent = formatK(val);};setText('stat-total', stats.total);setText('stat-human', stats.human);@@ -2919,8 +2762,6 @@setText('stat-cli-total', stats.cli_hub_total);setText('stat-cli-human', stats.cli_hub_human);setText('stat-cli-agent', stats.cli_hub_agent);- setSplit('site', stats.human || 0, stats.agent || 0);- setSplit('cli', stats.cli_hub_human || 0, stats.cli_hub_agent || 0);}function readUaBrands() {@@ -3122,9 +2963,8 @@});// ── Live analytics via Cloudflare Worker proxy ──- // Runtime stats are fetched once per page load. The Worker combines- // Cloudflare HTTP totals with tracked agent events and derives human- // website visits as total HTTP requests minus visit-agent events.+ // Runtime stats are fetched once per page load and rendered as compact+ // site page-view and CLI-Hub usage counters split by human/agent.const ANALYTICS_PROXY_URL = 'https://analytics.clianything.cc/';const ZERO_STATS = {human: 0, agent: 0,