Files
k8s-manifests/portfolio/configmap-html.yaml
T
chemavx 9508ddffee feat(portfolio): add ze manual page at /ze
- Add ze-manual-html ConfigMap serving ze-manual.html at /ze/index.html
- Mount ze-manual-html in nginx at /usr/share/nginx/html/ze
- Add Projects section in portfolio index with ze card linking to /ze
2026-05-16 11:21:44 +00:00

149 lines
13 KiB
YAML

apiVersion: v1
data:
index.html: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\"
/>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"
/>\n <title>ChemaVX</title>\n <style>\n *, *::before, *::after { box-sizing:
border-box; margin: 0; padding: 0; }\n\n :root {\n --bg: #0d1117;\n
\ --surface: #161b22;\n --border: #30363d;\n --text: #e6edf3;\n
\ --muted: #8b949e;\n --accent: #58a6ff;\n --green: #3fb950;\n
\ --red: #f85149;\n --yellow: #d29922;\n --purple: #bc8cff;\n
\ }\n\n body {\n background: var(--bg);\n color: var(--text);\n
\ font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica,
Arial, sans-serif;\n min-height: 100vh;\n display: flex;\n flex-direction:
column;\n align-items: center;\n padding: 3rem 1.5rem 4rem;\n }\n\n
\ /* ── Header ─────────────────────────────────── */\n header {\n text-align:
center;\n margin-bottom: 3.5rem;\n }\n .avatar {\n width: 80px;
height: 80px;\n border-radius: 50%;\n background: linear-gradient(135deg,
#1f6feb 0%, #bc8cff 100%);\n display: flex; align-items: center; justify-content:
center;\n font-size: 2rem; font-weight: 700; color: #fff;\n margin:
0 auto 1.25rem;\n box-shadow: 0 0 0 3px var(--border);\n }\n h1 { font-size:
2rem; font-weight: 700; letter-spacing: -0.5px; }\n .tagline {\n color:
var(--muted); font-size: 0.95rem; margin-top: 0.4rem;\n }\n .dot { display:
inline-block; width: 8px; height: 8px;\n border-radius: 50%; background:
var(--green);\n margin-right: 6px; animation: pulse 2s infinite; }\n
\ @keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity:
0.4; }\n }\n\n /* ── Section title ───────────────────────────── */\n .section-title
{\n font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em;\n text-transform:
uppercase; color: var(--muted);\n margin-bottom: 0.875rem;\n }\n\n /*
── Services grid ───────────────────────────── */\n .services-grid {\n display:
grid;\n grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));\n gap:
0.75rem;\n width: 100%; max-width: 720px;\n margin-bottom: 2.5rem;\n
\ }\n .service-card {\n background: var(--surface);\n border: 1px
solid var(--border);\n border-radius: 10px;\n padding: 1rem 1.1rem;\n
\ text-decoration: none;\n color: var(--text);\n transition: border-color
0.15s, transform 0.15s, box-shadow 0.15s;\n display: flex; align-items: center;
gap: 0.65rem;\n }\n .service-card:hover {\n border-color: var(--accent);\n
\ transform: translateY(-2px);\n box-shadow: 0 4px 16px rgba(88,166,255,0.1);\n
\ }\n .service-icon { font-size: 1.3rem; flex-shrink: 0; }\n .service-name
{ font-size: 0.9rem; font-weight: 500; }\n\n /* ── Polymarket card ───────────────────────────
*/\n .poly-wrapper { width: 100%; max-width: 720px; }\n .poly-card {\n background:
var(--surface);\n border: 1px solid var(--border);\n border-radius:
12px;\n padding: 1.5rem;\n margin-bottom: 2.5rem;\n }\n .poly-header
{\n display: flex; align-items: center; justify-content: space-between;\n
\ margin-bottom: 1.25rem;\n }\n .poly-title {\n display: flex;
align-items: center; gap: 0.5rem;\n font-size: 0.95rem; font-weight: 600;\n
\ }\n .poly-badge {\n font-size: 0.65rem; font-weight: 600; letter-spacing:
0.04em;\n padding: 2px 7px; border-radius: 20px;\n background: rgba(188,140,255,0.15);
color: var(--purple);\n border: 1px solid rgba(188,140,255,0.3);\n }\n
\ #poly-updated {\n font-size: 0.72rem; color: var(--muted);\n }\n\n
\ .metrics-grid {\n display: grid;\n grid-template-columns: repeat(2,
1fr);\n gap: 0.75rem;\n }\n @media (min-width: 480px) {\n .metrics-grid
{ grid-template-columns: repeat(4, 1fr); }\n }\n .metric {\n background:
var(--bg);\n border: 1px solid var(--border);\n border-radius: 8px;\n
\ padding: 0.875rem 1rem;\n }\n .metric-label {\n font-size: 0.68rem;
color: var(--muted);\n text-transform: uppercase; letter-spacing: 0.06em;\n
\ margin-bottom: 0.35rem;\n }\n .metric-value {\n font-size: 1.35rem;
font-weight: 700; font-variant-numeric: tabular-nums;\n transition: color
0.3s;\n }\n .metric-value.positive { color: var(--green); }\n .metric-value.negative
{ color: var(--red); }\n .metric-value.neutral { color: var(--text); }\n .metric-value.loading
\ { color: var(--muted); font-size: 1rem; }\n\n /* ── Footer ────────────────────────────────────
*/\n footer {\n color: var(--muted); font-size: 0.75rem; text-align: center;\n
\ width: 100%; max-width: 720px;\n border-top: 1px solid var(--border);\n
\ padding-top: 1.25rem;\n }\n footer a { color: var(--accent); text-decoration:
none; }\n footer a:hover { text-decoration: underline; }\n </style>\n</head>\n<body>\n\n
\ <header>\n <div class=\"avatar\">C</div>\n <h1>ChemaVX</h1>\n <p class=\"tagline\">\n
\ <span class=\"dot\"></span>Homelab · k3s · Self-hosted\n </p>\n </header>\n\n
\ <!-- Services -->\n <div style=\"width:100%;max-width:720px;margin-bottom:2.5rem;\">\n
\ <p class=\"section-title\">Services</p>\n <div class=\"services-grid\">\n
\ <a class=\"service-card\" href=\"https://grafana.chemavx.xyz\" target=\"_blank\"
rel=\"noopener\">\n <span class=\"service-icon\">\U0001F4CA</span>\n <span
class=\"service-name\">Grafana</span>\n </a>\n <a class=\"service-card\"
href=\"https://n8n.chemavx.xyz\" target=\"_blank\" rel=\"noopener\">\n <span
class=\"service-icon\">⚙️</span>\n <span class=\"service-name\">n8n</span>\n
\ </a>\n <a class=\"service-card\" href=\"https://home.chemavx.xyz\"
target=\"_blank\" rel=\"noopener\">\n <span class=\"service-icon\">\U0001F3E0</span>\n
\ <span class=\"service-name\">Homarr</span>\n </a>\n <a class=\"service-card\"
href=\"https://polymarket.chemavx.xyz\" target=\"_blank\" rel=\"noopener\">\n
\ <span class=\"service-icon\">\U0001F4C8</span>\n <span class=\"service-name\">Polymarket
Bot</span>\n </a>\n <a class=\"service-card\" href=\"https://chat.chemavx.xyz\"
target=\"_blank\" rel=\"noopener\">\n <span class=\"service-icon\">\U0001F916</span>\n
\ <span class=\"service-name\">Open WebUI</span>\n </a>\n <a class=\"service-card\"
href=\"https://git.chemavx.xyz\" target=\"_blank\" rel=\"noopener\">\n <span
class=\"service-icon\">\U0001F419</span>\n <span class=\"service-name\">Gitea</span>\n
\ </a>\n <a class=\"service-card\" href=\"https://argocd.chemavx.xyz\"
target=\"_blank\" rel=\"noopener\">\n <span class=\"service-icon\">\U0001F504</span>\n
\ <span class=\"service-name\">ArgoCD</span>\n </a>\n <a class=\"service-card\"
href=\"https://vaultwarden.chemavx.xyz\" target=\"_blank\" rel=\"noopener\">\n
\ <span class=\"service-icon\">\U0001F510</span>\n <span class=\"service-name\">Vaultwarden</span>\n
\ </a>\n </div>\n </div>\n\n <!-- Projects -->\n <div style=\"width:100%;max-width:720px;margin-bottom:2.5rem;\">\n
\ <p class=\"section-title\">Projects</p>\n <div class=\"services-grid\">\n
\ <a class=\"service-card\" href=\"/ze\">\n <span class=\"service-icon\">\U0001F6F8</span>\n
\ <span class=\"service-name\">ze</span>\n </a>\n </div>\n </div>\n\n
\ <!-- Polymarket live metrics -->\n <div class=\"poly-wrapper\">\n <p class=\"section-title\">Polymarket
Bot — Live</p>\n <div class=\"poly-card\">\n <div class=\"poly-header\">\n
\ <div class=\"poly-title\">\n <span>\U0001F4C8</span>\n <span>Portfolio
Summary</span>\n <span class=\"poly-badge\" id=\"poly-mode\">PAPER</span>\n
\ </div>\n <span id=\"poly-updated\">Loading…</span>\n </div>\n
\ <div class=\"metrics-grid\">\n <div class=\"metric\">\n <div
class=\"metric-label\">P&amp;L</div>\n <div class=\"metric-value loading\"
id=\"m-pnl\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Win Rate</div>\n <div class=\"metric-value loading\"
id=\"m-winrate\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Deployed</div>\n <div class=\"metric-value loading\"
id=\"m-deployed\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Trades</div>\n <div class=\"metric-value loading\"
id=\"m-trades\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Bankroll</div>\n <div class=\"metric-value loading\"
id=\"m-bankroll\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Sharpe</div>\n <div class=\"metric-value loading\"
id=\"m-sharpe\">—</div>\n </div>\n <div class=\"metric\">\n <div
class=\"metric-label\">Calibration</div>\n <div class=\"metric-value
loading\" id=\"m-calibration\">—</div>\n </div>\n <div class=\"metric\">\n
\ <div class=\"metric-label\">Status</div>\n <div class=\"metric-value
loading\" id=\"m-status\">—</div>\n </div>\n </div>\n </div>\n
\ </div>\n\n <footer>\n <p>\n Hosted on <strong>k3s</strong> &mdash;\n
\ <a href=\"https://grafana.chemavx.xyz/d/chemavx-homelab-v1/chemavx-homelab-overview\"
target=\"_blank\">Cluster Dashboard</a>\n &mdash; <a href=\"https://git.chemavx.xyz\"
target=\"_blank\">Gitea</a>\n </p>\n </footer>\n\n <script>\n const API
= 'https://polymarket.chemavx.xyz/api/summary';\n const fmt$ = v => v == null
? '—' : '$' + v.toFixed(2);\n const fmtPct = v => v == null ? '—' : (v * 100).toFixed(1)
+ '%';\n const fmtN = v => v == null ? '—' : String(v);\n const fmtF =
(v, d=3) => v == null ? '—' : v.toFixed(d);\n\n function colorClass(id, val)
{\n const el = document.getElementById(id);\n el.classList.remove('positive','negative','neutral','loading');\n
\ if (val > 0) el.classList.add('positive');\n else if (val < 0) el.classList.add('negative');\n
\ else el.classList.add('neutral');\n }\n\n async function fetchMetrics()
{\n try {\n const r = await fetch(API, { cache: 'no-store' });\n if
(!r.ok) throw new Error(r.status);\n const d = await r.json();\n\n document.getElementById('m-pnl').textContent
\ = fmt$(d.total_pnl);\n document.getElementById('m-winrate').textContent
\ = fmtPct(d.win_rate);\n document.getElementById('m-deployed').textContent
\ = fmt$(d.total_deployed);\n document.getElementById('m-trades').textContent
\ = fmtN(d.total_trades);\n document.getElementById('m-bankroll').textContent
\ = fmt$(d.paper_bankroll);\n document.getElementById('m-sharpe').textContent
\ = fmtF(d.sharpe_ratio, 2);\n document.getElementById('m-calibration').textContent
= fmtF(d.calibration_score, 3);\n document.getElementById('m-status').textContent
\ = d.promotion_ready ? '\U0001F680 Ready' : '⏳ Training';\n\n colorClass('m-pnl',
d.total_pnl);\n colorClass('m-sharpe', d.sharpe_ratio);\n\n const
mode = d.paper_mode ? 'PAPER' : 'LIVE';\n const badge = document.getElementById('poly-mode');\n
\ badge.textContent = mode;\n badge.style.background = d.paper_mode\n
\ ? 'rgba(188,140,255,0.15)' : 'rgba(63,185,80,0.15)';\n badge.style.color
= d.paper_mode ? 'var(--purple)' : 'var(--green)';\n badge.style.borderColor
= d.paper_mode\n ? 'rgba(188,140,255,0.3)' : 'rgba(63,185,80,0.3)';\n\n
\ const now = new Date();\n document.getElementById('poly-updated').textContent
=\n 'Updated ' + now.toLocaleTimeString();\n } catch (e) {\n document.getElementById('poly-updated').textContent
= 'Error: ' + e.message;\n }\n }\n\n fetchMetrics();\n setInterval(fetchMetrics,
30000);\n </script>\n</body>\n</html>\n"
kind: ConfigMap
metadata:
name: portfolio-html
namespace: portfolio