feat(OX1a+ML-3b): Cloud Build live-widget i opax.html + /opax/build-status endepunkt + Gemma world.md
- app.py: ny GET /opax/build-status — poller Cloud Build API, returnerer siste build status/timing - static/opax.html: ny Deploy-seksjon med live spinner → ✅/❌, poller hvert 10s under aktiv build - docs/gemma/world.md: Gemma kontekstpakke opprettet — alt Gemma trenger å forstå Vauco fra dag 1
This commit is contained in:
parent
8bc52fc0bb
commit
1c447c4d3a
|
|
@ -13,7 +13,6 @@ from pydantic import BaseModel
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Gjor ml-pakken tilgjengelig uansett cwd
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
|
||||
try:
|
||||
|
|
@ -30,9 +29,9 @@ session_service = InMemorySessionService()
|
|||
APP_NAME = os.environ.get("CLOUD_RUN_SERVICE", "gcp-orchestrator")
|
||||
PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT", "propane-will-491900-m5")
|
||||
BQ_BILLING_DATASET = os.environ.get("BQ_BILLING_DATASET", "billing_data")
|
||||
CLOUD_BUILD_TRIGGER_ID = os.environ.get("CLOUD_BUILD_TRIGGER_ID", "")
|
||||
|
||||
# CG6: in-memory budget store (TODO Fase-C: migrate to Firestore per-user)
|
||||
_budget_store: dict = {} # key: user_email | "default"
|
||||
_budget_store: dict = {}
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
|
|
@ -55,13 +54,11 @@ class RunRequest(BaseModel):
|
|||
session_id: str
|
||||
message: str
|
||||
|
||||
|
||||
class RunResponse(BaseModel):
|
||||
user_id: str
|
||||
session_id: str
|
||||
response: str
|
||||
|
||||
|
||||
class BudgetRequest(BaseModel):
|
||||
budget: float
|
||||
user: str = "default"
|
||||
|
|
@ -83,13 +80,13 @@ async def _ensure_session(user_id: str, session_id: str):
|
|||
return session
|
||||
|
||||
|
||||
# ── helse ────────────────────────────────────────────────────────────────────
|
||||
# ── helse ──────────────────────────────────────────────────────────────────────────────
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return JSONResponse({"status": "ok", "service": APP_NAME})
|
||||
|
||||
|
||||
# ── agent run ────────────────────────────────────────────────────────────────
|
||||
# ── agent run ───────────────────────────────────────────────────────────────────
|
||||
@app.post("/run", response_model=RunResponse)
|
||||
async def run(req: RunRequest):
|
||||
try:
|
||||
|
|
@ -111,7 +108,73 @@ async def run(req: RunRequest):
|
|||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
# ── billing: tokens ──────────────────────────────────────────────────────────
|
||||
# ── OX1a: Cloud Build status ────────────────────────────────────────────────────────
|
||||
@app.get("/opax/build-status")
|
||||
async def build_status():
|
||||
"""
|
||||
OX1a — Hent siste Cloud Build-kjøring for OSVauco-repoet.
|
||||
Returnerer status, tidspunkt og varighet slik at opax.html kan vise
|
||||
live build-widget (spinner → ✅/❌).
|
||||
|
||||
Tilstandsverdier fra Cloud Build API:
|
||||
QUEUED, WORKING → bygger nå (vis spinner)
|
||||
SUCCESS → ok
|
||||
FAILURE / TIMEOUT / CANCELLED / INTERNAL_ERROR → feil
|
||||
"""
|
||||
try:
|
||||
from google.cloud.devtools import cloudbuild_v1
|
||||
client = cloudbuild_v1.CloudBuildClient()
|
||||
|
||||
# Hent siste 5 builds for prosjektet
|
||||
request = cloudbuild_v1.ListBuildsRequest(
|
||||
project_id=PROJECT_ID,
|
||||
filter='trigger_id!=""', # kun trigger-builds, ikke manuelle
|
||||
page_size=5,
|
||||
)
|
||||
builds = list(client.list_builds(request=request))
|
||||
|
||||
if not builds:
|
||||
return JSONResponse({"status": "unknown", "message": "Ingen builds funnet"})
|
||||
|
||||
b = builds[0] # nyeste
|
||||
status_map = {
|
||||
1: "queued",
|
||||
2: "working",
|
||||
3: "success",
|
||||
4: "failure",
|
||||
5: "internal_error",
|
||||
6: "timeout",
|
||||
7: "cancelled",
|
||||
}
|
||||
status_str = status_map.get(int(b.status), "unknown")
|
||||
|
||||
# Beregn varighet
|
||||
duration_s = None
|
||||
start = b.start_time
|
||||
finish = b.finish_time
|
||||
if start and finish:
|
||||
duration_s = int((finish.seconds - start.seconds))
|
||||
elif start:
|
||||
import time
|
||||
duration_s = int(time.time() - start.seconds)
|
||||
|
||||
return JSONResponse({
|
||||
"status": status_str, # queued|working|success|failure|timeout|cancelled
|
||||
"build_id": b.id,
|
||||
"trigger_id": b.build_trigger_id or "",
|
||||
"branch": (b.substitutions or {}).get("BRANCH_NAME", "main"),
|
||||
"commit": (b.substitutions or {}).get("SHORT_SHA", ""),
|
||||
"duration_s": duration_s,
|
||||
"start_time": str(b.start_time) if b.start_time else None,
|
||||
"finish_time": str(b.finish_time) if b.finish_time else None,
|
||||
"log_url": b.log_url or "",
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"[/opax/build-status] Failed: {e}", exc_info=True)
|
||||
return JSONResponse({"status": "error", "message": str(e)}, status_code=200)
|
||||
|
||||
|
||||
# ── billing: tokens ──────────────────────────────────────────────────────────────────
|
||||
@app.get("/billing/tokens/summary")
|
||||
async def billing_tokens_summary():
|
||||
try:
|
||||
|
|
@ -119,7 +182,8 @@ async def billing_tokens_summary():
|
|||
client = bigquery.Client(project=PROJECT_ID)
|
||||
query = f"""
|
||||
SELECT
|
||||
agent_name,
|
||||
module_name,
|
||||
caller_type,
|
||||
model_name,
|
||||
SUM(input_tokens) AS total_input_tokens,
|
||||
SUM(output_tokens) AS total_output_tokens,
|
||||
|
|
@ -127,12 +191,13 @@ async def billing_tokens_summary():
|
|||
SUM(estimated_cost_usd) AS total_cost_usd
|
||||
FROM `{PROJECT_ID}.{BQ_BILLING_DATASET}.llm_token_usage`
|
||||
WHERE timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
|
||||
GROUP BY agent_name, model_name
|
||||
GROUP BY module_name, caller_type, model_name
|
||||
ORDER BY total_cost_usd DESC
|
||||
"""
|
||||
rows = [
|
||||
{
|
||||
"agent_name": row.agent_name,
|
||||
"module_name": row.module_name,
|
||||
"caller_type": row.caller_type,
|
||||
"model_name": row.model_name,
|
||||
"total_input_tokens": row.total_input_tokens,
|
||||
"total_output_tokens": row.total_output_tokens,
|
||||
|
|
@ -147,7 +212,7 @@ async def billing_tokens_summary():
|
|||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
# ── billing: anbefalinger ────────────────────────────────────────────────────
|
||||
# ── billing: anbefalinger ─────────────────────────────────────────────────────────────
|
||||
@app.get("/billing/recommendations")
|
||||
async def billing_recommendations(budget: float = 500.0):
|
||||
try:
|
||||
|
|
@ -158,7 +223,6 @@ async def billing_recommendations(budget: float = 500.0):
|
|||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
# ── billing: tjenester med SKU-detaljer (CG5) ────────────────────────────────
|
||||
@app.get("/billing/by-service")
|
||||
async def billing_by_service(days: int = 30):
|
||||
try:
|
||||
|
|
@ -167,17 +231,11 @@ async def billing_by_service(days: int = 30):
|
|||
return JSONResponse(agent.get_service_totals(days))
|
||||
except Exception as e:
|
||||
logger.error(f"[/billing/by-service] Failed: {e}", exc_info=True)
|
||||
return JSONResponse([]) # fallback: tom liste, dashbordet krasjer ikke
|
||||
return JSONResponse([])
|
||||
|
||||
|
||||
# ── billing: anomalier (CG6) ─────────────────────────────────────────────────
|
||||
@app.get("/billing/anomalies")
|
||||
async def billing_anomalies():
|
||||
"""
|
||||
CG6 — Anomalideteksjon: sammenligner dagens kostnad mot 7-dagers snitt per tjeneste.
|
||||
Returnerer tjenester der dagens kostnad > 2x snittet.
|
||||
Fallback: tom liste ved feil slik at dashbordet ikke krasjer.
|
||||
"""
|
||||
try:
|
||||
from ml.billing_agent import BillingAgent
|
||||
agent = BillingAgent()
|
||||
|
|
@ -187,13 +245,8 @@ async def billing_anomalies():
|
|||
return JSONResponse({"anomalies": []})
|
||||
|
||||
|
||||
# ── billing: historikk for bar-chart (CG6) ───────────────────────────────────
|
||||
@app.get("/billing/history")
|
||||
async def billing_history(days: int = 30):
|
||||
"""
|
||||
CG6 — Daglig MTD-historikk for bar-chart i dashbordet.
|
||||
Returnerer liste: [{date, mtd}] sortert ASC.
|
||||
"""
|
||||
try:
|
||||
from ml.billing_agent import BillingAgent
|
||||
agent = BillingAgent()
|
||||
|
|
@ -203,7 +256,6 @@ async def billing_history(days: int = 30):
|
|||
return JSONResponse({"history": []})
|
||||
|
||||
|
||||
# ── billing: summary ─────────────────────────────────────────────────────────
|
||||
@app.get("/billing/summary")
|
||||
async def billing_summary():
|
||||
try:
|
||||
|
|
@ -215,7 +267,6 @@ async def billing_summary():
|
|||
return JSONResponse({"summary": []})
|
||||
|
||||
|
||||
# ── billing: live / forecast ─────────────────────────────────────────────────
|
||||
@app.get("/billing/live")
|
||||
async def billing_live():
|
||||
try:
|
||||
|
|
@ -227,24 +278,14 @@ async def billing_live():
|
|||
return JSONResponse({})
|
||||
|
||||
|
||||
# ── billing: budsjett GET + POST (CG6) ───────────────────────────────────────
|
||||
# TODO Fase-C: erstatt _budget_store med Firestore-dokument per bruker
|
||||
@app.get("/billing/budget")
|
||||
async def get_budget(user: str = "default"):
|
||||
"""
|
||||
CG6 — Hent lagret budsjett for bruker.
|
||||
In-memory; nullstilles ved redeploy (Firestore i Fase C).
|
||||
"""
|
||||
budget = _budget_store.get(user, 500.0)
|
||||
return JSONResponse({"budget": budget, "user": user})
|
||||
|
||||
|
||||
@app.post("/billing/budget")
|
||||
async def set_budget(req: BudgetRequest):
|
||||
"""
|
||||
CG6 — Lagre budsjett for bruker.
|
||||
In-memory; nullstilles ved redeploy (Firestore i Fase C).
|
||||
"""
|
||||
if req.budget <= 0:
|
||||
raise HTTPException(status_code=400, detail="Budget must be > 0")
|
||||
_budget_store[req.user] = req.budget
|
||||
|
|
|
|||
131
docs/gemma/world.md
Normal file
131
docs/gemma/world.md
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
# Gemmas verden — Vauco OS kontekstpakke
|
||||
|
||||
**Formål:** Dette er system-prompten som lastes når Gemma 4 tar over som intern modell (ML-3).
|
||||
Gemma skal ikke være dum når den starter — denne filen gir den full kontekst fra dag 1.
|
||||
|
||||
**Oppdateres:** Etter hver sesjon der noe vesentlig endres. Levende dokument.
|
||||
**Trigger for bruk:** Når Vertex-kreditter < 20% eller første kunde er onboardet (ML-3).
|
||||
|
||||
---
|
||||
|
||||
## Hvem du er
|
||||
|
||||
Du er **Jason** — intern AI-agent for Vauco AS.
|
||||
Kallenavn: Jason. Systemname: OPAX.
|
||||
Du kjører på GCP Cloud Run (`osvauco-agent`, `us-central1`, prosjekt `propane-will-491900-m5`).
|
||||
Du svarer på norsk bokmål med mindre annet er eksplisitt bedt om.
|
||||
Du er direkte, kompetent og ærlig — sier tydelig ifra når noe mangler data fremfor å gjette.
|
||||
|
||||
---
|
||||
|
||||
## Hvem du jobber for
|
||||
|
||||
**Chris Christiansen** — eier og eneste ansatte i Vauco AS (org.nr 935 989 779, Oslo).
|
||||
- E-post: chris.christiansen@vauco.no
|
||||
- Din agent-e-post: jason.vauger@vauco.no
|
||||
- Chris har full kontroll. Du utfører, han bestemmer.
|
||||
- **HITL-grenser (må aldri passeres uten Chris):** terraform apply, kunde-onboarding, salg av Vauco OS/OPAX, godkjenningsporter.
|
||||
|
||||
---
|
||||
|
||||
## Plattformhierarkiet
|
||||
|
||||
```
|
||||
Vauco AS (selskap, eier alt)
|
||||
├── vauco.no Salgsportal — LIVE på GCS + GCP Load Balancer
|
||||
└── VAUCO OS Plattformen Chris bygger fra
|
||||
└── OPAX Engine — Cloud Run + RAG + IAP
|
||||
├── CostGuard Modul #1 — LIVE på costguard.oss.vauco.no
|
||||
├── Threadstone Modul #2 — landingsside live, app i bygg
|
||||
└── [Modul #3] Navngis senere
|
||||
```
|
||||
|
||||
**Aldri selg Vauco OS eller OPAX til kunder — de er interne verktøy.**
|
||||
|
||||
---
|
||||
|
||||
## Aktive domener og endepunkter
|
||||
|
||||
| Domene | Status | Teknologi |
|
||||
|--------|--------|-----------|
|
||||
| `vauco.no` | ✅ LIVE | GCS + LB + Cloud CDN |
|
||||
| `opax.vauco.no` | ✅ LIVE | Cloud Run + IAP (IP 34.98.77.173) |
|
||||
| `costguard.oss.vauco.no` | ✅ LIVE | Cloud Run via IAP |
|
||||
| `threadstone.vauco.no` | ✅ LIVE | GitHub Pages (midlertidig) |
|
||||
| `oss.vauco.no` | ✅ Aktiv | Staging |
|
||||
| `os.vauco.no` | 🔮 Fase C | Prod |
|
||||
|
||||
**Cloud Run endepunkter (alle live):**
|
||||
`/health`, `/run`, `/run/dag`, `/billing/summary`, `/billing/forecast`,
|
||||
`/billing/anomalies`, `/billing/history`, `/billing/budget` (GET+POST),
|
||||
`/billing/tokens/summary`, `/opax/build-status`,
|
||||
`/auth/login`, `/auth/callback`, `/state`, `/telemetry/history`
|
||||
|
||||
---
|
||||
|
||||
## Teknisk stack
|
||||
|
||||
| Lag | Verdi |
|
||||
|-----|-------|
|
||||
| Runtime | Python 3.11 + FastAPI + Google ADK |
|
||||
| Modell (nå) | `gemini-2.5-pro` (heavy) / `gemini-2.5-flash` (light) via Vertex AI |
|
||||
| Modell (du, fremtid) | `gemma-4-12b-it` int4 på GCP `g2-standard-4` Spot VM |
|
||||
| Hosting | GCP Cloud Run, us-central1 |
|
||||
| Database | BigQuery (`billing_data`-dataset, `propane-will-491900-m5`) |
|
||||
| Token-logging | `llm_token_usage`-tabell i BQ — alle kall logges med `module_name` + `caller_type` |
|
||||
| CI/CD | Cloud Build — auto-deploy på push til `main` |
|
||||
| IaC | Terraform (infrastruktur/terraform/) |
|
||||
| RAG | Vertex AI RAG, `osvauco-corpus`, europe-west4 |
|
||||
| Secrets | Google Secret Manager |
|
||||
| Auth | IAP + OAuth2 (`@vauco.no`-kontoer) |
|
||||
|
||||
---
|
||||
|
||||
## Gjeldende roadmap-status (oppdateres løpende)
|
||||
|
||||
### Ferdig
|
||||
- Phase 0–7, K1–K3, F8, CG6, CG3e, OX1a, ML-3 plan
|
||||
|
||||
### Aktive nå (NEXT)
|
||||
- **V1e** — SPF/DKIM/DMARC på vauco.no
|
||||
- **CG4** — Token Intelligence: `/billing/tokens/by-module`, prosjektestimator, kundeprisingskalkulator
|
||||
- **OX1b–c** — Embedded TUI + Jason som primærgrensesnitt i operator hub
|
||||
- **ML-3b** — Denne filen (world.md) — bygges løpende
|
||||
|
||||
### Trigger-basert (venter)
|
||||
- **C4** — Første betalende CostGuard-kunde
|
||||
- **ML-3** — Full Gemma-migrering (trigger: kreditter < 20%)
|
||||
- **T1–T4** — Threadstone-app
|
||||
- **Deep Dream** — etter Modul #1 har kunde
|
||||
|
||||
---
|
||||
|
||||
## Kjente hull du bør kjenne til
|
||||
|
||||
| ID | Problem |
|
||||
|----|---------|
|
||||
| OQ-15 | BQ billing_export ikke aktivert — si dette ærlig, ikke gjett tall |
|
||||
| OQ-22 | Claude EU-kvote ikke innvilget — kjører midlertidig på Gemini |
|
||||
| OQ-24 | SPF/DKIM/DMARC mangler på vauco.no |
|
||||
| OQ-26 | Ingen statuspage ennå |
|
||||
|
||||
---
|
||||
|
||||
## Kommunikasjonsstil
|
||||
|
||||
- **Språk:** Norsk bokmål som standard
|
||||
- **Tone:** Direkte, kompetent, ingen unnødig prat
|
||||
- **Når data mangler:** Si det ærlig — aldri gjett
|
||||
- **Kodeendringer:** Push via MCP/GitHub, ikke bare forklar
|
||||
- **Planer:** Alltid oppdater ROADMAP.md og MASTERPLAN.md når noe besluttes
|
||||
- **Referanser:** Bruk alltid `docs/MASTERPLAN.md` som sannheten — ikke andre filer
|
||||
|
||||
---
|
||||
|
||||
## Forbudte kontoer
|
||||
`tinius.vauger`, `ccv` — aldri gi tilganger.
|
||||
|
||||
---
|
||||
|
||||
*Bygd simultant med Vauco OS — oppdateres løpende fra 2026-06-10*
|
||||
*Når Gemma starter: last denne filen som system-prompt før ethvert kall*
|
||||
419
static/opax.html
419
static/opax.html
|
|
@ -7,66 +7,33 @@
|
|||
<title>OPAX — Vauco Operator Hub</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<style>
|
||||
/* ── Vauco / Threadstone design system ──────────────────────────────── */
|
||||
:root{
|
||||
--bg:#0a0a0f;
|
||||
--bg-2:#11131a;
|
||||
--bg-3:#161922;
|
||||
--border:rgba(255,255,255,0.08);
|
||||
--border-2:rgba(255,255,255,0.14);
|
||||
--text:#e8eaf0;
|
||||
--text-dim:#8b909c;
|
||||
--text-faint:#5a5f6b;
|
||||
--accent:#7c5cff;
|
||||
--accent-2:#00d4a8;
|
||||
--accent-glow:rgba(124,92,255,0.22);
|
||||
--green:#3ecf8e;
|
||||
--amber:#ffb547;
|
||||
--danger:#ff5c7c;
|
||||
--radius:12px;
|
||||
--radius-lg:18px;
|
||||
--bg:#0a0a0f;--bg-2:#11131a;--bg-3:#161922;
|
||||
--border:rgba(255,255,255,0.08);--border-2:rgba(255,255,255,0.14);
|
||||
--text:#e8eaf0;--text-dim:#8b909c;--text-faint:#5a5f6b;
|
||||
--accent:#7c5cff;--accent-2:#00d4a8;--accent-glow:rgba(124,92,255,0.22);
|
||||
--green:#3ecf8e;--amber:#ffb547;--danger:#ff5c7c;
|
||||
--radius:12px;--radius-lg:18px;
|
||||
--shadow:0 8px 32px rgba(0,0,0,0.4);
|
||||
--shadow-glow:0 0 40px var(--accent-glow);
|
||||
--sans:-apple-system,BlinkMacSystemFont,'Inter','SF Pro Display',system-ui,sans-serif;
|
||||
--mono:'SF Mono',ui-monospace,'JetBrains Mono',Menlo,monospace;
|
||||
}
|
||||
*{margin:0;padding:0;box-sizing:border-box}
|
||||
html,body{
|
||||
background:var(--bg);color:var(--text);
|
||||
font-family:var(--sans);line-height:1.6;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
}
|
||||
html,body{background:var(--bg);color:var(--text);font-family:var(--sans);line-height:1.6;-webkit-font-smoothing:antialiased}
|
||||
a{color:inherit;text-decoration:none}
|
||||
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
|
||||
::-webkit-scrollbar{width:10px;height:10px}
|
||||
::-webkit-scrollbar-thumb{background:var(--bg-3);border-radius:6px}
|
||||
::-webkit-scrollbar-track{background:transparent}
|
||||
|
||||
/* ── Topbar ─────────────────────────────────────────────────────────── */
|
||||
.topbar{
|
||||
position:sticky;top:0;z-index:100;
|
||||
display:flex;align-items:center;justify-content:space-between;
|
||||
padding:14px 28px;
|
||||
background:rgba(10,10,15,0.82);backdrop-filter:blur(20px);
|
||||
border-bottom:1px solid var(--border);
|
||||
}
|
||||
.topbar{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:14px 28px;background:rgba(10,10,15,0.82);backdrop-filter:blur(20px);border-bottom:1px solid var(--border)}
|
||||
.topbar-brand{display:flex;align-items:center;gap:12px}
|
||||
.logo-mark{
|
||||
width:30px;height:30px;border-radius:9px;
|
||||
background:linear-gradient(135deg,var(--accent),var(--accent-2));
|
||||
display:flex;align-items:center;justify-content:center;
|
||||
color:#0a0a0f;flex-shrink:0;
|
||||
}
|
||||
.logo-mark{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;color:#0a0a0f;flex-shrink:0}
|
||||
.topbar-name{font-weight:800;font-size:16px;letter-spacing:-0.02em}
|
||||
.topbar-sep{color:var(--text-faint);font-weight:300}
|
||||
.topbar-sub{color:var(--text-dim);font-size:14px}
|
||||
.topbar-right{display:flex;align-items:center;gap:18px;flex-wrap:wrap;justify-content:flex-end}
|
||||
.status-pill{
|
||||
display:inline-flex;align-items:center;gap:7px;
|
||||
padding:5px 12px;border-radius:99px;
|
||||
background:var(--bg-3);border:1px solid var(--border);
|
||||
font-size:12px;color:var(--text-dim);font-weight:500;
|
||||
}
|
||||
.status-pill{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border-radius:99px;background:var(--bg-3);border:1px solid var(--border);font-size:12px;color:var(--text-dim);font-weight:500}
|
||||
.dot{width:7px;height:7px;border-radius:50%;background:var(--green);flex-shrink:0}
|
||||
.dot.amber{background:var(--amber)}
|
||||
.dot.red{background:var(--danger)}
|
||||
|
|
@ -75,35 +42,14 @@
|
|||
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}
|
||||
.topbar-id{font-family:var(--mono);font-size:11px;color:var(--text-faint)}
|
||||
|
||||
/* ── Layout shell ───────────────────────────────────────────────────── */
|
||||
.shell{display:flex;min-height:calc(100vh - 60px)}
|
||||
.sidebar{
|
||||
width:230px;flex-shrink:0;
|
||||
padding:24px 16px;
|
||||
border-right:1px solid var(--border);
|
||||
display:flex;flex-direction:column;gap:4px;
|
||||
position:sticky;top:60px;height:calc(100vh - 60px);
|
||||
}
|
||||
.side-label{
|
||||
font-size:11px;text-transform:uppercase;letter-spacing:0.08em;
|
||||
color:var(--text-faint);font-weight:600;
|
||||
padding:14px 12px 6px;
|
||||
}
|
||||
.nav-item{
|
||||
display:flex;align-items:center;gap:10px;
|
||||
padding:9px 12px;border-radius:9px;
|
||||
font-size:14px;color:var(--text-dim);font-weight:500;
|
||||
transition:background .15s,color .15s;
|
||||
}
|
||||
.sidebar{width:230px;flex-shrink:0;padding:24px 16px;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:4px;position:sticky;top:60px;height:calc(100vh - 60px)}
|
||||
.side-label{font-size:11px;text-transform:uppercase;letter-spacing:0.08em;color:var(--text-faint);font-weight:600;padding:14px 12px 6px}
|
||||
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;font-size:14px;color:var(--text-dim);font-weight:500;transition:background .15s,color .15s}
|
||||
.nav-item:hover{background:var(--bg-2);color:var(--text)}
|
||||
.nav-item.active{background:var(--bg-3);color:var(--text)}
|
||||
.nav-item svg{flex-shrink:0;opacity:.8}
|
||||
.nav-badge{
|
||||
margin-left:auto;font-size:10px;font-weight:600;
|
||||
padding:2px 8px;border-radius:99px;
|
||||
background:var(--bg-3);color:var(--text-dim);
|
||||
border:1px solid var(--border);
|
||||
}
|
||||
.nav-badge{margin-left:auto;font-size:10px;font-weight:600;padding:2px 8px;border-radius:99px;background:var(--bg-3);color:var(--text-dim);border:1px solid var(--border)}
|
||||
.nav-badge.live{background:rgba(62,207,142,0.12);color:var(--green);border-color:rgba(62,207,142,0.2)}
|
||||
.nav-badge.soon{background:rgba(255,181,71,0.1);color:var(--amber);border-color:rgba(255,181,71,0.18)}
|
||||
.side-foot{margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
|
||||
|
|
@ -111,59 +57,34 @@
|
|||
.me-name{font-size:12px;font-weight:600;color:var(--text)}
|
||||
.me-role{font-size:11px;color:var(--text-faint);margin-top:2px;font-family:var(--mono)}
|
||||
|
||||
/* ── Main ───────────────────────────────────────────────────────────── */
|
||||
.main{flex:1;padding:32px 40px 56px;max-width:1180px;width:100%}
|
||||
.page-head{margin-bottom:36px}
|
||||
.page-title{font-size:30px;font-weight:800;letter-spacing:-0.03em;
|
||||
background:linear-gradient(180deg,#fff 0%,#a8aabc 100%);
|
||||
-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
|
||||
padding-bottom:.08em}
|
||||
.page-title{font-size:30px;font-weight:800;letter-spacing:-0.03em;background:linear-gradient(180deg,#fff 0%,#a8aabc 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;padding-bottom:.08em}
|
||||
.page-desc{color:var(--text-dim);font-size:15px;margin-top:6px;max-width:640px}
|
||||
|
||||
.section{margin-bottom:44px}
|
||||
.section-head{display:flex;align-items:center;gap:10px;margin-bottom:18px}
|
||||
.section-label{font-size:13px;text-transform:uppercase;letter-spacing:0.1em;
|
||||
color:var(--text-faint);font-weight:700}
|
||||
.section-label{font-size:13px;text-transform:uppercase;letter-spacing:0.1em;color:var(--text-faint);font-weight:700}
|
||||
.section-line{flex:1;height:1px;background:var(--border)}
|
||||
|
||||
/* ── Product cards ──────────────────────────────────────────────────── */
|
||||
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:18px}
|
||||
.card{
|
||||
padding:24px;background:var(--bg-2);
|
||||
border:1px solid var(--border);border-radius:var(--radius-lg);
|
||||
transition:border-color .2s,transform .2s,background .2s;
|
||||
position:relative;overflow:hidden;
|
||||
}
|
||||
.card{padding:24px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius-lg);transition:border-color .2s,transform .2s,background .2s;position:relative;overflow:hidden}
|
||||
.card.clickable{cursor:pointer}
|
||||
.card.clickable:hover{border-color:var(--border-2);transform:translateY(-2px);background:#13151e}
|
||||
.card.muted{opacity:.62}
|
||||
.card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
|
||||
.card-icon{
|
||||
width:40px;height:40px;border-radius:11px;
|
||||
background:var(--bg-3);border:1px solid var(--border-2);
|
||||
display:flex;align-items:center;justify-content:center;color:var(--accent);
|
||||
}
|
||||
.tag{font-size:10px;font-weight:700;letter-spacing:0.06em;
|
||||
padding:4px 10px;border-radius:99px;text-transform:uppercase}
|
||||
.card-icon{width:40px;height:40px;border-radius:11px;background:var(--bg-3);border:1px solid var(--border-2);display:flex;align-items:center;justify-content:center;color:var(--accent)}
|
||||
.tag{font-size:10px;font-weight:700;letter-spacing:0.06em;padding:4px 10px;border-radius:99px;text-transform:uppercase}
|
||||
.tag.live{background:rgba(62,207,142,0.12);color:var(--green);border:1px solid rgba(62,207,142,0.22)}
|
||||
.tag.soon{background:var(--bg-3);color:var(--text-dim);border:1px solid var(--border)}
|
||||
.card-name{font-size:17px;font-weight:700;letter-spacing:-0.01em}
|
||||
.card-desc{font-size:13.5px;color:var(--text-dim);margin-top:8px;line-height:1.55}
|
||||
.card-meta{display:flex;flex-wrap:wrap;gap:14px;margin-top:18px;
|
||||
font-size:12px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.card-meta{display:flex;flex-wrap:wrap;gap:14px;margin-top:18px;font-size:12px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.card-meta span{display:inline-flex;align-items:center;gap:6px}
|
||||
.card-link{display:inline-flex;align-items:center;gap:7px;margin-top:18px;
|
||||
font-size:13px;font-weight:600;color:var(--accent)}
|
||||
.card-link{display:inline-flex;align-items:center;gap:7px;margin-top:18px;font-size:13px;font-weight:600;color:var(--accent)}
|
||||
.card-link:hover{color:#9b80ff}
|
||||
|
||||
/* ── Agents ─────────────────────────────────────────────────────────── */
|
||||
.agent-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
|
||||
.agent-row{
|
||||
display:flex;align-items:center;gap:14px;
|
||||
padding:16px 18px;background:var(--bg-2);
|
||||
border:1px solid var(--border);border-radius:var(--radius);
|
||||
transition:border-color .2s,background .2s;
|
||||
}
|
||||
.agent-row{display:flex;align-items:center;gap:14px;padding:16px 18px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius);transition:border-color .2s,background .2s}
|
||||
.agent-row.actionable{cursor:pointer}
|
||||
.agent-row.actionable:hover{border-color:var(--border-2);background:#13151e}
|
||||
.agent-name{font-size:14px;font-weight:600}
|
||||
|
|
@ -171,55 +92,70 @@
|
|||
.agent-go{margin-left:auto;font-size:11px;color:var(--accent);font-weight:600;opacity:0;transition:opacity .2s}
|
||||
.agent-row.actionable:hover .agent-go{opacity:1}
|
||||
|
||||
/* ── Infra grid ─────────────────────────────────────────────────────── */
|
||||
.infra-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
|
||||
.infra-item{padding:16px 18px;background:var(--bg-2);
|
||||
border:1px solid var(--border);border-radius:var(--radius)}
|
||||
.infra-label{font-size:11px;text-transform:uppercase;letter-spacing:0.06em;
|
||||
color:var(--text-faint);font-weight:600;margin-bottom:6px}
|
||||
.infra-value{font-size:14px;font-weight:600;font-family:var(--mono);
|
||||
display:flex;align-items:center;gap:8px}
|
||||
.infra-item{padding:16px 18px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius)}
|
||||
.infra-label{font-size:11px;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-faint);font-weight:600;margin-bottom:6px}
|
||||
.infra-value{font-size:14px;font-weight:600;font-family:var(--mono);display:flex;align-items:center;gap:8px}
|
||||
.infra-value.ok{color:var(--green)}
|
||||
.infra-value.warn{color:var(--amber)}
|
||||
.infra-value.neutral{color:var(--text)}
|
||||
|
||||
/* ── Provisioning flow ──────────────────────────────────────────────── */
|
||||
.flow-box{padding:24px;background:var(--bg-2);
|
||||
border:1px solid var(--border);border-radius:var(--radius-lg);position:relative}
|
||||
.flow-box::after{content:'FASE 2 — IKKE AKTIVERT';position:absolute;top:18px;right:20px;
|
||||
font-size:10px;font-weight:700;letter-spacing:0.08em;color:var(--text-faint);
|
||||
font-family:var(--mono)}
|
||||
/* ── Build widget (OX1a) ────────────────────────────────────────────────────────── */
|
||||
.build-widget{
|
||||
padding:20px 24px;background:var(--bg-2);
|
||||
border:1px solid var(--border);border-radius:var(--radius-lg);
|
||||
display:flex;align-items:center;gap:20px;flex-wrap:wrap;
|
||||
}
|
||||
.build-icon{
|
||||
width:44px;height:44px;border-radius:12px;flex-shrink:0;
|
||||
background:var(--bg-3);border:1px solid var(--border-2);
|
||||
display:flex;align-items:center;justify-content:center;
|
||||
}
|
||||
.build-info{flex:1;min-width:180px}
|
||||
.build-title{font-size:14px;font-weight:700;margin-bottom:3px}
|
||||
.build-meta{font-size:12px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.build-status-row{display:flex;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap}
|
||||
.build-badge{
|
||||
display:inline-flex;align-items:center;gap:6px;
|
||||
padding:4px 12px;border-radius:99px;
|
||||
font-size:12px;font-weight:600;
|
||||
}
|
||||
.build-badge.working{background:rgba(255,181,71,0.12);color:var(--amber);border:1px solid rgba(255,181,71,0.25)}
|
||||
.build-badge.success{background:rgba(62,207,142,0.12);color:var(--green);border:1px solid rgba(62,207,142,0.22)}
|
||||
.build-badge.failure,.build-badge.timeout,.build-badge.internal_error{
|
||||
background:rgba(255,92,124,0.1);color:var(--danger);border:1px solid rgba(255,92,124,0.2)}
|
||||
.build-badge.queued{background:var(--bg-3);color:var(--text-dim);border:1px solid var(--border)}
|
||||
.build-badge.unknown,.build-badge.error{background:var(--bg-3);color:var(--text-dim);border:1px solid var(--border)}
|
||||
.build-spinner{
|
||||
width:14px;height:14px;border-radius:50%;
|
||||
border:2px solid var(--amber);border-top-color:transparent;
|
||||
animation:spin .7s linear infinite;flex-shrink:0;
|
||||
}
|
||||
@keyframes spin{to{transform:rotate(360deg)}}
|
||||
.build-duration{font-size:11px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.build-log-link{font-size:12px;color:var(--accent);font-weight:600}
|
||||
.build-log-link:hover{color:#9b80ff}
|
||||
.build-commit{font-family:var(--mono);font-size:11px;color:var(--text-faint)}
|
||||
|
||||
.flow-box{padding:24px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius-lg);position:relative}
|
||||
.flow-box::after{content:'FASE 2 — IKKE AKTIVERT';position:absolute;top:18px;right:20px;font-size:10px;font-weight:700;letter-spacing:0.08em;color:var(--text-faint);font-family:var(--mono)}
|
||||
.flow-title{font-size:14px;font-weight:600;margin-bottom:18px}
|
||||
.flow-steps{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
|
||||
.flow-step{padding:8px 14px;background:var(--bg-3);border:1px solid var(--border);
|
||||
border-radius:99px;font-size:12px;color:var(--text-dim);white-space:nowrap}
|
||||
.flow-step{padding:8px 14px;background:var(--bg-3);border:1px solid var(--border);border-radius:99px;font-size:12px;color:var(--text-dim);white-space:nowrap}
|
||||
.flow-arrow{color:var(--text-faint);font-size:13px}
|
||||
.flow-note{margin-top:16px;font-size:11px;color:var(--text-faint);font-family:var(--mono)}
|
||||
|
||||
/* ── Footer ─────────────────────────────────────────────────────────── */
|
||||
.page-foot{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;
|
||||
margin-top:48px;padding-top:20px;border-top:1px solid var(--border);
|
||||
font-size:11px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.page-foot{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-top:48px;padding-top:20px;border-top:1px solid var(--border);font-size:11px;color:var(--text-faint);font-family:var(--mono)}
|
||||
|
||||
/* ── Chat drawer ────────────────────────────────────────────────────── */
|
||||
.chat-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.55);
|
||||
backdrop-filter:blur(2px);z-index:200;opacity:0;pointer-events:none;transition:opacity .25s}
|
||||
.chat-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.55);backdrop-filter:blur(2px);z-index:200;opacity:0;pointer-events:none;transition:opacity .25s}
|
||||
.chat-overlay.open{opacity:1;pointer-events:auto}
|
||||
.chat-drawer{position:fixed;top:0;right:0;bottom:0;width:min(440px,100vw);
|
||||
background:var(--bg-2);border-left:1px solid var(--border-2);
|
||||
z-index:201;display:flex;flex-direction:column;
|
||||
transform:translateX(100%);transition:transform .28s cubic-bezier(.4,0,.2,1);
|
||||
box-shadow:-20px 0 60px rgba(0,0,0,0.5)}
|
||||
.chat-drawer{position:fixed;top:0;right:0;bottom:0;width:min(440px,100vw);background:var(--bg-2);border-left:1px solid var(--border-2);z-index:201;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:-20px 0 60px rgba(0,0,0,0.5)}
|
||||
.chat-drawer.open{transform:translateX(0)}
|
||||
.chat-head{display:flex;align-items:center;gap:12px;padding:18px 20px;
|
||||
border-bottom:1px solid var(--border)}
|
||||
.chat-avatar{width:34px;height:34px;border-radius:10px;
|
||||
background:linear-gradient(135deg,var(--accent),var(--accent-2));
|
||||
display:flex;align-items:center;justify-content:center;color:#0a0a0f;font-weight:800;font-size:14px}
|
||||
.chat-head{display:flex;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid var(--border)}
|
||||
.chat-avatar{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;color:#0a0a0f;font-weight:800;font-size:14px}
|
||||
.chat-title{font-size:15px;font-weight:700}
|
||||
.chat-sub{font-size:11px;color:var(--text-faint);font-family:var(--mono)}
|
||||
.chat-close{margin-left:auto;width:30px;height:30px;border-radius:8px;
|
||||
display:flex;align-items:center;justify-content:center;color:var(--text-dim)}
|
||||
.chat-close{margin-left:auto;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--text-dim)}
|
||||
.chat-close:hover{background:var(--bg-3);color:var(--text)}
|
||||
.chat-body{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px}
|
||||
.msg{max-width:85%;padding:11px 14px;border-radius:14px;font-size:14px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word}
|
||||
|
|
@ -230,26 +166,18 @@
|
|||
.chat-empty{margin:auto;text-align:center;color:var(--text-faint);font-size:13px;max-width:260px}
|
||||
.chat-empty svg{margin-bottom:12px;opacity:.5}
|
||||
.chat-foot{padding:14px 16px;border-top:1px solid var(--border);display:flex;gap:10px;align-items:flex-end}
|
||||
.chat-input{flex:1;background:var(--bg-3);border:1px solid var(--border-2);
|
||||
border-radius:12px;padding:11px 14px;color:var(--text);font-family:var(--sans);
|
||||
font-size:14px;resize:none;max-height:120px;line-height:1.5}
|
||||
.chat-input{flex:1;background:var(--bg-3);border:1px solid var(--border-2);border-radius:12px;padding:11px 14px;color:var(--text);font-family:var(--sans);font-size:14px;resize:none;max-height:120px;line-height:1.5}
|
||||
.chat-input:focus{outline:none;border-color:var(--accent)}
|
||||
.chat-send{width:42px;height:42px;border-radius:11px;background:var(--accent);
|
||||
color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;
|
||||
transition:background .15s}
|
||||
.chat-send{width:42px;height:42px;border-radius:11px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s}
|
||||
.chat-send:hover{background:#6a4dee}
|
||||
.chat-send:disabled{opacity:.4;cursor:not-allowed}
|
||||
.mode-row{display:flex;gap:6px;padding:0 16px 12px}
|
||||
.mode-chip{font-size:11px;padding:4px 11px;border-radius:99px;background:var(--bg-3);
|
||||
border:1px solid var(--border);color:var(--text-dim);font-weight:600}
|
||||
.mode-chip{font-size:11px;padding:4px 11px;border-radius:99px;background:var(--bg-3);border:1px solid var(--border);color:var(--text-dim);font-weight:600}
|
||||
.mode-chip.active{background:var(--accent);color:#fff;border-color:var(--accent)}
|
||||
|
||||
/* ── Responsive ─────────────────────────────────────────────────────── */
|
||||
@media(max-width:860px){
|
||||
.shell{flex-direction:column}
|
||||
.sidebar{width:100%;height:auto;display:flex;flex-direction:row;align-items:center;overflow-x:auto;
|
||||
border-right:none;border-bottom:1px solid var(--border);padding:8px 12px;gap:6px;
|
||||
position:sticky;top:0;background:var(--bg-2);z-index:50}
|
||||
.sidebar{width:100%;height:auto;display:flex;flex-direction:row;align-items:center;overflow-x:auto;border-right:none;border-bottom:1px solid var(--border);padding:8px 12px;gap:6px;position:sticky;top:0;background:var(--bg-2);z-index:50}
|
||||
.sidebar::-webkit-scrollbar{display:none}
|
||||
.side-label{display:none}
|
||||
.nav-item{flex-shrink:0;white-space:nowrap;border-radius:99px;padding:8px 13px;align-self:center}
|
||||
|
|
@ -282,7 +210,7 @@
|
|||
</div>
|
||||
<div class="topbar-right">
|
||||
<div class="status-pill" id="pill-run"><span class="dot dim pulse" id="dot-run"></span><span id="txt-run">kobler til…</span></div>
|
||||
<div class="status-pill"><span class="dot amber"></span><span>cg3 pending</span></div>
|
||||
<div class="status-pill" id="pill-build"><span class="dot dim" id="dot-build"></span><span id="txt-build">build…</span></div>
|
||||
<div class="topbar-id">propane-will-491900-m5 · us-central1</div>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -298,6 +226,10 @@
|
|||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.6-7 8-7s8 3 8 7"/></svg>
|
||||
Agenter<span class="nav-badge live">Jason</span>
|
||||
</a>
|
||||
<a class="nav-item" href="#deploy">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
|
||||
Deploy<span class="nav-badge" id="nav-build-badge">-</span>
|
||||
</a>
|
||||
<a class="nav-item" href="#infrastruktur">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="8" rx="1"/><rect x="2" y="14" width="20" height="8" rx="1"/><path d="M6 6h.01M6 18h.01"/></svg>
|
||||
Infrastruktur
|
||||
|
|
@ -306,7 +238,6 @@
|
|||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.14 12 19.79 19.79 0 0 1 1 3.18 2 2 0 0 1 3 1h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.09 8.91a16 16 0 0 0 5.99 5.99l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
|
||||
Provisjonering<span class="nav-badge soon">fase 2</span>
|
||||
</a>
|
||||
|
||||
<div class="side-label" style="margin-top:6px">Ressurser</div>
|
||||
<a class="nav-item" href="https://console.cloud.google.com/run?project=propane-will-491900-m5" target="_blank" rel="noopener">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
||||
|
|
@ -320,7 +251,6 @@
|
|||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
|
||||
CostGuard Dashboard
|
||||
</a>
|
||||
|
||||
<div class="side-foot">
|
||||
<div class="me-card">
|
||||
<div class="me-name">jason.vauger@vauco.no</div>
|
||||
|
|
@ -345,16 +275,10 @@
|
|||
<span class="tag live">Live</span>
|
||||
</div>
|
||||
<div class="card-name">CostGuard</div>
|
||||
<div class="card-desc">Sanntids GCP- og AWS-kostnadskontroll. Anomalideteksjon, budsjettvarsler, historikk og CSV/PDF-eksport.</div>
|
||||
<div class="card-meta">
|
||||
<span><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/></svg>0 kunder</span>
|
||||
<span>costguard.oss.vauco.no</span>
|
||||
<div class="card-desc">Sanntids GCP-kostnadskontroll. Anomalideteksjon, budsjettvarsler, historikk og token-måler.</div>
|
||||
<div class="card-meta"><span>0 kunder</span><span>costguard.oss.vauco.no</span></div>
|
||||
<span class="card-link">Åpne dashboard <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg></span>
|
||||
</div>
|
||||
<span class="card-link">Åpne dashboard
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="card muted">
|
||||
<div class="card-top">
|
||||
<span class="card-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg></span>
|
||||
|
|
@ -364,14 +288,13 @@
|
|||
<div class="card-desc">Kundeskreddersydd AI-salgsassistent. Landingsside er live, app under utvikling.</div>
|
||||
<div class="card-meta"><span>threadstone.vauco.no</span></div>
|
||||
</div>
|
||||
|
||||
<div class="card muted">
|
||||
<div class="card-top">
|
||||
<span class="card-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/></svg></span>
|
||||
<span class="tag soon">Fase 3</span>
|
||||
</div>
|
||||
<div class="card-name">Module Builder</div>
|
||||
<div class="card-desc">Bygg og deploy nye salgsmoduler visuelt direkte fra OPAX. Ingen terminal nødvendig.</div>
|
||||
<div class="card-desc">Bygg og deploy nye salgsmoduler visuelt direkte fra OPAX.</div>
|
||||
<div class="card-meta"><span>opax.vauco.no/build</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -380,13 +303,18 @@
|
|||
<!-- Agenter -->
|
||||
<section class="section" id="agenter">
|
||||
<div class="section-head"><span class="section-label">Agenter</span><span class="section-line"></span></div>
|
||||
<div class="agent-grid" id="agent-grid">
|
||||
<div class="agent-row actionable" data-agent="jason" data-mode="heavy" onclick="openChat('Jason','billing.viewer · GCP kostnadsrapport','heavy')">
|
||||
<div class="agent-grid">
|
||||
<div class="agent-row actionable" onclick="openChat('Jason','jason/light · gemini-2.5-flash','light')">
|
||||
<span class="dot" id="dot-jason"></span>
|
||||
<div><div class="agent-name">Jason</div><div class="agent-desc">billing.viewer · GCP kostnadsrapport</div></div>
|
||||
<div><div class="agent-name">Jason — Light</div><div class="agent-desc">jason/light · gemini-2.5-flash</div></div>
|
||||
<span class="agent-go">Snakk →</span>
|
||||
</div>
|
||||
<div class="agent-row actionable" data-agent="opax-core" data-mode="heavy" onclick="openChat('OPAX Core','POST /run · orkestrering','heavy')">
|
||||
<div class="agent-row actionable" onclick="openChat('Jason Heavy','jason/heavy · gemini-2.5-pro','heavy')">
|
||||
<span class="dot" id="dot-jason-heavy"></span>
|
||||
<div><div class="agent-name">Jason — Heavy</div><div class="agent-desc">jason/heavy · gemini-2.5-pro</div></div>
|
||||
<span class="agent-go">Snakk →</span>
|
||||
</div>
|
||||
<div class="agent-row actionable" onclick="openChat('OPAX Core','POST /run · orkestrering','heavy')">
|
||||
<span class="dot dim" id="dot-core"></span>
|
||||
<div><div class="agent-name">OPAX Core</div><div class="agent-desc">POST /run · orkestrering</div></div>
|
||||
<span class="agent-go">Snakk →</span>
|
||||
|
|
@ -395,9 +323,29 @@
|
|||
<span class="dot dim"></span>
|
||||
<div><div class="agent-name">Provisioner</div><div class="agent-desc">mail · magic link · fase 2</div></div>
|
||||
</div>
|
||||
<div class="agent-row">
|
||||
<span class="dot dim"></span>
|
||||
<div><div class="agent-name">Voice (OPAX)</div><div class="agent-desc">Web Speech API · fase 2</div></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Deploy (OX1a) -->
|
||||
<section class="section" id="deploy">
|
||||
<div class="section-head"><span class="section-label">Deploy</span><span class="section-line"></span></div>
|
||||
<div class="build-widget" id="build-widget">
|
||||
<div class="build-icon" id="build-icon">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" id="build-svg">
|
||||
<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="build-info">
|
||||
<div class="build-title">Cloud Build — OSVauco</div>
|
||||
<div class="build-meta" id="build-meta">laster…</div>
|
||||
<div class="build-status-row">
|
||||
<span class="build-badge unknown" id="build-badge">sjekker…</span>
|
||||
<span class="build-duration" id="build-duration"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-left:auto;display:flex;flex-direction:column;align-items:flex-end;gap:6px">
|
||||
<a class="build-log-link" id="build-log-link" href="#" target="_blank" rel="noopener" style="visibility:hidden">Se logg →</a>
|
||||
<span class="build-commit" id="build-commit"></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -411,10 +359,10 @@
|
|||
<div class="infra-item"><div class="infra-label">Project</div><div class="infra-value neutral">propane-will-491900-m5</div></div>
|
||||
<div class="infra-item"><div class="infra-label">RAG-korpus</div><div class="infra-value neutral">europe-west4 · EU</div></div>
|
||||
<div class="infra-item"><div class="infra-label">opax.vauco.no</div><div class="infra-value ok">CNAME live</div></div>
|
||||
<div class="infra-item"><div class="infra-label">costguard.oss.vauco.no</div><div class="infra-value warn">CG3 pending</div></div>
|
||||
<div class="infra-item"><div class="infra-label">OAuth</div><div class="infra-value warn">redirect_uri fix</div></div>
|
||||
<div class="infra-item"><div class="infra-label">Deploy</div><div class="infra-value warn">manuell (ingen trigger)</div></div>
|
||||
<div class="infra-item"><div class="infra-label">costguard.oss.vauco.no</div><div class="infra-value ok">Cloud Run live</div></div>
|
||||
<div class="infra-item"><div class="infra-label">vauco.no</div><div class="infra-value ok">GCS + LB live</div></div>
|
||||
<div class="infra-item"><div class="infra-label">Secret Manager</div><div class="infra-value ok">aktiv</div></div>
|
||||
<div class="infra-item"><div class="infra-label">Deploy</div><div class="infra-value" id="infra-deploy">auto · push-to-main</div></div>
|
||||
<div class="infra-item"><div class="infra-label">Backend /health</div><div class="infra-value" id="infra-health">— sjekker…</div></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -457,13 +405,13 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="mode-row">
|
||||
<button class="mode-chip" data-m="light" onclick="setMode('light')">light · flash</button>
|
||||
<button class="mode-chip active" data-m="heavy" onclick="setMode('heavy')">heavy · 2.5-pro</button>
|
||||
<button class="mode-chip active" data-m="light" onclick="setMode('light')">light · flash</button>
|
||||
<button class="mode-chip" data-m="heavy" onclick="setMode('heavy')">heavy · 2.5-pro</button>
|
||||
</div>
|
||||
<div class="chat-body" id="chat-body">
|
||||
<div class="chat-empty" id="chat-empty">
|
||||
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
||||
<div>Send en melding til agenten. Kjører mot <code>POST /run</code> via Vertex AI.</div>
|
||||
<div>Send en melding til Jason. Kjører mot <code>POST /run</code> via Vertex AI.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-foot">
|
||||
|
|
@ -475,10 +423,10 @@
|
|||
</aside>
|
||||
|
||||
<script>
|
||||
/* ── Live backend wiring ──────────────────────────────────────────────── */
|
||||
const SESSION_ID = 'hub-' + Math.random().toString(36).slice(2, 8);
|
||||
let chatMode = 'heavy';
|
||||
let chatMode = 'light';
|
||||
let busy = false;
|
||||
let buildPolling = null;
|
||||
|
||||
async function jget(path){
|
||||
const r = await fetch(path, {headers:{'Accept':'application/json'}});
|
||||
|
|
@ -486,48 +434,96 @@ async function jget(path){
|
|||
return r.json();
|
||||
}
|
||||
|
||||
/* ── Build widget (OX1a) ──────────────────────────────────────────────────── */
|
||||
async function loadBuildStatus(){
|
||||
try{
|
||||
const b = await jget('/opax/build-status');
|
||||
const st = b.status || 'unknown';
|
||||
const badge = document.getElementById('build-badge');
|
||||
const dotBuild = document.getElementById('dot-build');
|
||||
const txtBuild = document.getElementById('txt-build');
|
||||
const navBadge = document.getElementById('nav-build-badge');
|
||||
const meta = document.getElementById('build-meta');
|
||||
const dur = document.getElementById('build-duration');
|
||||
const logLink = document.getElementById('build-log-link');
|
||||
const commit = document.getElementById('build-commit');
|
||||
const icon = document.getElementById('build-icon');
|
||||
|
||||
// Badge label + class
|
||||
const labels = {working:'bygger…',queued:'kø…',success:'✅ ok',failure:'❌ feilet',timeout:'❌ timeout',cancelled:'avbrutt',internal_error:'❌ intern feil',unknown:'—',error:'feil'};
|
||||
badge.textContent = labels[st] || st;
|
||||
badge.className = 'build-badge ' + st;
|
||||
|
||||
// Topbar dot
|
||||
dotBuild.className = 'dot ' + (st === 'success' ? '' : st === 'working' || st === 'queued' ? 'amber pulse' : 'red');
|
||||
txtBuild.textContent = st === 'working' ? 'bygger…' : st === 'success' ? 'deploy ok' : st === 'failure' ? 'build feilet' : 'build';
|
||||
|
||||
// Nav badge
|
||||
navBadge.textContent = st === 'success' ? '✅' : st === 'working' || st === 'queued' ? '⧗' : st === 'failure' ? '❌' : '-';
|
||||
navBadge.className = 'nav-badge' + (st === 'success' ? ' live' : '');
|
||||
|
||||
// Spinner i ikon under aktiv build
|
||||
if(st === 'working' || st === 'queued'){
|
||||
icon.innerHTML = '<div class="build-spinner"></div>';
|
||||
if(!buildPolling) buildPolling = setInterval(loadBuildStatus, 8000);
|
||||
} else {
|
||||
icon.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>';
|
||||
if(buildPolling){ clearInterval(buildPolling); buildPolling = null; }
|
||||
}
|
||||
|
||||
// Meta: branch + tid
|
||||
const branch = b.branch || 'main';
|
||||
const start = b.start_time ? new Date(b.start_time).toLocaleTimeString('no-NO',{hour:'2-digit',minute:'2-digit'}) : '';
|
||||
meta.textContent = branch + (start ? ' · ' + start : '');
|
||||
|
||||
// Varighet
|
||||
if(b.duration_s != null){
|
||||
const m = Math.floor(b.duration_s/60), s = b.duration_s % 60;
|
||||
dur.textContent = m > 0 ? m+'m '+s+'s' : s+'s';
|
||||
}
|
||||
|
||||
// Logg-lenke
|
||||
if(b.log_url){ logLink.href = b.log_url; logLink.style.visibility = 'visible'; }
|
||||
|
||||
// Commit SHA
|
||||
if(b.commit) commit.textContent = b.commit;
|
||||
|
||||
}catch(e){
|
||||
document.getElementById('build-badge').textContent = 'utilgjengelig';
|
||||
document.getElementById('build-meta').textContent = e.message;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Backend health + agent state ──────────────────────────────────────────────── */
|
||||
async function loadStatus(){
|
||||
// Backend health → topbar + infra card
|
||||
try{
|
||||
const h = await jget('/health');
|
||||
const ok = (h && (h.status === 'ok' || h.ok === true));
|
||||
setRun(ok ? 'live' : 'degradert', ok);
|
||||
setHealth(ok ? 'ok' : 'degradert', ok);
|
||||
}catch(e){
|
||||
setRun('utilgjengelig', false);
|
||||
setHealth('utilgjengelig', false);
|
||||
}
|
||||
// Agent state → agent dots
|
||||
try{
|
||||
const s = await jget('/state/agents');
|
||||
const ids = (s.agents || []).map(a => (typeof a === 'string' ? a : (a.agent_id || a.id || ''))).filter(Boolean);
|
||||
const known = id => ids.some(x => x.toLowerCase().includes(id));
|
||||
setDot('dot-core', known('opax') ? 'live' : 'dim');
|
||||
setDot('dot-jason', 'live');
|
||||
}catch(e){ /* leave defaults */ }
|
||||
}
|
||||
|
||||
function setRun(label, ok){
|
||||
document.getElementById('txt-run').textContent = ok ? 'cloud run live' : label;
|
||||
const ok = h && (h.status === 'ok' || h.ok === true);
|
||||
document.getElementById('txt-run').textContent = ok ? 'cloud run live' : 'degradert';
|
||||
const d = document.getElementById('dot-run');
|
||||
d.className = 'dot ' + (ok ? '' : 'red') + ' pulse';
|
||||
}
|
||||
function setHealth(label, ok){
|
||||
const el = document.getElementById('infra-health');
|
||||
el.textContent = label;
|
||||
el.textContent = ok ? 'ok' : 'degradert';
|
||||
el.className = 'infra-value ' + (ok ? 'ok' : 'warn');
|
||||
}catch(e){
|
||||
document.getElementById('txt-run').textContent = 'utilgjengelig';
|
||||
document.getElementById('dot-run').className = 'dot red pulse';
|
||||
}
|
||||
function setDot(id, kind){
|
||||
const el = document.getElementById(id);
|
||||
if(el) el.className = 'dot ' + (kind === 'live' ? '' : 'dim');
|
||||
try{
|
||||
const s = await jget('/state/agents');
|
||||
const ids = (s.agents||[]).map(a => typeof a==='string'?a:(a.agent_id||a.id||'')).filter(Boolean);
|
||||
document.getElementById('dot-core').className = 'dot ' + (ids.some(x=>x.toLowerCase().includes('opax'))?'':'dim');
|
||||
document.getElementById('dot-jason').className = 'dot';
|
||||
document.getElementById('dot-jason-heavy').className = 'dot';
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
/* ── Chat drawer ──────────────────────────────────────────────────────── */
|
||||
/* ── Chat ────────────────────────────────────────────────────────────────────── */
|
||||
function openChat(name, sub, mode){
|
||||
document.getElementById('chat-title').textContent = name;
|
||||
document.getElementById('chat-sub').textContent = sub;
|
||||
document.getElementById('chat-avatar').textContent = name.charAt(0).toUpperCase();
|
||||
setMode(mode || 'heavy');
|
||||
setMode(mode || 'light');
|
||||
document.getElementById('chat-overlay').classList.add('open');
|
||||
document.getElementById('chat-drawer').classList.add('open');
|
||||
setTimeout(() => document.getElementById('chat-input').focus(), 200);
|
||||
|
|
@ -538,12 +534,10 @@ function closeChat(){
|
|||
}
|
||||
function setMode(m){
|
||||
chatMode = m;
|
||||
document.querySelectorAll('.mode-chip').forEach(c =>
|
||||
c.classList.toggle('active', c.dataset.m === m));
|
||||
document.querySelectorAll('.mode-chip').forEach(c => c.classList.toggle('active', c.dataset.m === m));
|
||||
}
|
||||
function autoGrow(t){ t.style.height='auto'; t.style.height=Math.min(t.scrollHeight,120)+'px'; }
|
||||
function onKey(e){ if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();} }
|
||||
|
||||
function addMsg(text, cls){
|
||||
const empty = document.getElementById('chat-empty');
|
||||
if(empty) empty.remove();
|
||||
|
|
@ -555,7 +549,6 @@ function addMsg(text, cls){
|
|||
body.scrollTop = body.scrollHeight;
|
||||
return el;
|
||||
}
|
||||
|
||||
async function sendMsg(){
|
||||
if(busy) return;
|
||||
const input = document.getElementById('chat-input');
|
||||
|
|
@ -565,8 +558,7 @@ async function sendMsg(){
|
|||
addMsg(text, 'user');
|
||||
busy = true;
|
||||
document.getElementById('chat-send').disabled = true;
|
||||
const typing = addMsg('agenten tenker…', 'typing');
|
||||
|
||||
const typing = addMsg('Jason tenker…', 'typing');
|
||||
try{
|
||||
const r = await fetch('/run',{
|
||||
method:'POST',
|
||||
|
|
@ -592,19 +584,18 @@ async function sendMsg(){
|
|||
}
|
||||
}
|
||||
|
||||
/* ── Active nav highlight on scroll ───────────────────────────────────── */
|
||||
const navLinks = document.querySelectorAll('.nav-item[href^="#"]');
|
||||
window.addEventListener('scroll', () => {
|
||||
let cur = '';
|
||||
document.querySelectorAll('section[id]').forEach(s => {
|
||||
if(window.scrollY >= s.offsetTop - 120) cur = s.id;
|
||||
});
|
||||
document.querySelectorAll('section[id]').forEach(s => { if(window.scrollY >= s.offsetTop - 120) cur = s.id; });
|
||||
navLinks.forEach(a => a.classList.toggle('active', a.getAttribute('href') === '#' + cur));
|
||||
});
|
||||
document.addEventListener('keydown', e => { if(e.key==='Escape') closeChat(); });
|
||||
|
||||
loadStatus();
|
||||
loadBuildStatus();
|
||||
setInterval(loadStatus, 30000);
|
||||
setInterval(loadBuildStatus, 60000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user