package views import ( "strings" "vctp/components/core" ) type BuildInfo struct { BuildTime string SHA1Ver string GoVersion string } func truncateSHA(sha string) string { trimmed := strings.TrimSpace(sha) if len(trimmed) <= 14 { return trimmed } return trimmed[:14] + "..." } templ Index(info BuildInfo) { @core.Header()
vCTP Console

Chargeback Intelligence Dashboard

Point-in-time snapshots of vSphere consumption with LDAP and JWT-protected API access.

When authentication is enabled, obtain a token from POST /api/auth/login and send it as Authorization: Bearer <token>. Role policy: viewer covers read/report APIs, admin covers mutating/admin APIs (and includes viewer). UI pages and /metrics remain public.

Build Time

{ info.BuildTime }

SHA1 Version

{ truncateSHA(info.SHA1Ver) }

Go Runtime

{ info.GoVersion }

Overview

vCTP is a vSphere Chargeback Tracking Platform.

Use fast vCenter totals views (Daily Aggregated and Hourly Detail 45d) and VM Trace views (Hourly Detail and Daily Aggregated) to move between long-range trends and granular timelines.

Use /api/auth/me to inspect active claims and roles during integration and diagnostics.

Prorating and Aggregation

SamplesPresent is the count of snapshots in which the VM appears; TotalSamples is the count of unique snapshot times for that vCenter/day.

AvgIsPresent = SamplesPresent / TotalSamples (0 when TotalSamples is 0).

Daily AvgVcpuCount, AvgRamGB, and AvgProvisionedDisk are per-sample sums divided by TotalSamples (time-weighted).

Daily pool percentages (PoolTinPct/PoolBronzePct/PoolSilverPct/PoolGoldPct) use pool-hit counts divided by SamplesPresent.

Monthly aggregation converts each day into weighted sums using sample volume, then recomputes monthly averages and pool percentages from those weighted totals.

CreationTime is only set when vCenter provides it; otherwise it remains 0.

@core.Footer() }