All checks were successful
continuous-integration/drone/push Build is passing
85 lines
3.7 KiB
Plaintext
85 lines
3.7 KiB
Plaintext
package views
|
|
|
|
import (
|
|
"vctp/components/core"
|
|
)
|
|
|
|
type BuildInfo struct {
|
|
BuildTime string
|
|
SHA1Ver string
|
|
GoVersion string
|
|
}
|
|
|
|
templ Index(info BuildInfo) {
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
@core.Header()
|
|
<body class="flex flex-col min-h-screen web2-bg">
|
|
<main class="flex-grow web2-shell space-y-8">
|
|
<section class="web2-header">
|
|
<div class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
|
<div>
|
|
<div class="web2-pill">vCTP Console</div>
|
|
<h1 class="mt-3 text-4xl font-bold">Chargeback Intelligence Dashboard</h1>
|
|
<p class="mt-2 text-sm text-slate-600">Point in time snapshots of consumption.</p>
|
|
</div>
|
|
<div class="web2-button-group">
|
|
<a class="web2-button" href="/snapshots/hourly">Hourly Snapshots</a>
|
|
<a class="web2-button" href="/snapshots/daily">Daily Snapshots</a>
|
|
<a class="web2-button" href="/snapshots/monthly">Monthly Snapshots</a>
|
|
<a class="web2-button" href="/vm/trace">VM Trace</a>
|
|
<a class="web2-button" href="/vcenters">vCenters</a>
|
|
<a class="web2-button" href="/swagger/">Swagger UI</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="grid gap-6 md:grid-cols-3">
|
|
<div class="web2-card">
|
|
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Build Time</p>
|
|
<p class="mt-3 text-xl font-semibold">{info.BuildTime}</p>
|
|
</div>
|
|
<div class="web2-card">
|
|
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">SHA1 Version</p>
|
|
<p class="mt-3 text-xl font-semibold">{info.SHA1Ver}</p>
|
|
</div>
|
|
<div class="web2-card">
|
|
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Go Runtime</p>
|
|
<p class="mt-3 text-xl font-semibold">{info.GoVersion}</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="grid gap-6 lg:grid-cols-3">
|
|
<div class="web2-card">
|
|
<h2 class="text-lg font-semibold">Overview</h2>
|
|
<p class="mt-2 text-sm text-slate-600">
|
|
vCTP is a vSphere Chargeback Tracking Platform.
|
|
</p>
|
|
</div>
|
|
<div class="web2-card">
|
|
<h2 class="text-lg font-semibold">Snapshots and Reports</h2>
|
|
<ul class="mt-3 space-y-2 text-sm text-slate-600 list-disc pl-5">
|
|
<li>Hourly snapshots capture inventory per vCenter (concurrency via `hourly_snapshot_concurrency`).</li>
|
|
<li>Daily summaries aggregate the hourly snapshots for the day; monthly summaries aggregate daily summaries for the month (or hourly snapshots if configured).</li>
|
|
<li>Snapshots are registered in `snapshot_registry` so regeneration via `/api/snapshots/aggregate` can locate the correct tables (fallback scanning is also supported).</li>
|
|
<li>Reports (XLSX with totals/charts) are generated automatically after hourly, daily, and monthly jobs and written to a reports directory.</li>
|
|
</ul>
|
|
</div>
|
|
<div class="web2-card">
|
|
<h2 class="text-lg font-semibold">Prorating and Aggregation</h2>
|
|
<ul class="mt-3 space-y-2 text-sm text-slate-600 list-disc pl-5">
|
|
<li>SamplesPresent is the count of snapshots in which the VM appears; TotalSamples is the count of unique snapshot times for the vCenter.</li>
|
|
<li>AvgIsPresent = SamplesPresent / TotalSamples (0 when TotalSamples is 0).</li>
|
|
<li>Daily AvgVcpuCount/AvgRamGB/AvgProvisionedDisk = sum of per-sample values divided by TotalSamples (time-weighted).</li>
|
|
<li>Daily pool percentages use pool hits divided by SamplesPresent, so they reflect only the time the VM existed.</li>
|
|
<li>Monthly aggregation weights daily averages by daily total samples, then divides by monthly total samples.</li>
|
|
<li>CreationTime is only set when vCenter provides it; otherwise it remains 0.</li>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
@core.Footer()
|
|
</html>
|
|
}
|