{{/* /fleet/architecture (archpage.go): the deployment's map — how a request reaches a process, drawn over the estate the account is carrying. Everything here is server-rendered: the diagram is inline SVG built in Go (archlayout.go's RenderArchSVG) so the picture is deterministic and testable as a whole, and the page works with JS off because there is no JS. Every block below is independently guarded — the inventory, the boxes, the resource tables and the failed-reads footer each appear only when their own read produced something, so one bad read costs its own section and never the page. */}} {{define "architecture"}}{{template "top" .}}

Architecture

{{if .Flash}}{{end}} {{if .FlashErr}}{{end}} {{/* The page's only control, at the top with the inventory timestamp it acts on. It used to sit below every resource table, several thousand pixels from the line telling you the inventory was stale (discussion #9). Outside the {{with .Arch}} below on purpose: a page that could not read an inventory is exactly the page whose refresh button has to still be there. */}}
{{/* A firing alarm, said where the reader already is. The marks ride the nodes they watch, which is right, but that put them off to the right of a drawing wider than the window and left the Alarms table thousands of pixels below — so the page could know something was on fire and show nothing above the fold. Spans both estates: the reader wants to know something is firing, not which half of the page to look in. */}} {{with .Arch}}{{if .Firing}} {{end}}{{end}} {{with .Arch}} {{/* The three missing states are named apart, never collapsed into one "nothing here": never-taken, ungranted and unreadable are three different facts about the deployment and only one of them is normal. */}} {{if .Missing}} {{else}}

Estate {{.Account}} · inventoried {{fmtTime .TakenAt}}

{{end}} {{/* Two estates, one above the other, never one picture with a line through it. The account holds a CARLOS deployment and, very often, whatever was already there — Tito's own account carries a Kubernetes estate CARLOS deliberately sits beside so it can reach the legacy database. Drawn together that is one unreadable graph; drawn apart it is two readable ones. NOTHING IS FILTERED. Every node and every resource on the old single page is still here, under one of the two headings — the split groups, it does not hide (archestate.go). */}}

CARLOS

{{/* One picture per region, stacked down the page. Region is the STRUCTURE here, not a word on a card: a box is the only thing on this diagram that is really in a region, and everything else is drawn in the band of the box it reaches (archregion.go). That is also what keeps each picture inside the 64rem column — a band is at most four nodes wide — so this page scrolls down and never across. */}} {{range .CARLOS.Bands}}

{{.Label}}

{{.SVG}}
{{end}}

Boxes

{{range .Boxes}}

{{.Label}}{{if .Region}} {{.Region}}{{end}}

{{/* Each fact is its own span and the separators are drawn by CSS (.fact + .fact::before), because every one of these is independently absent — a deployment with no rate card entry has no size and no price, and a hand-written separator would leave a dangling middot on the commonest page of all. */}}

{{if .InstanceType}}{{.InstanceType}}{{end}} {{if .State}}{{.State}}{{end}} {{if .Cores}}{{printf "%.0f" .Cores}} cores{{end}} {{if .MemGB}}{{printf "%.0f" .MemGB}} GB{{end}} {{if .DiscoveredDiskGB}}{{printf "%.0f" .DiscoveredDiskGB}} GB disk{{end}} {{if .USDMonth}}${{printf "%.0f" .USDMonth}}/mo{{end}} {{if not .CloudID}}no cloud machine (bring-your-own box){{end}}

Apps: {{if .Apps}}{{range .Apps}}{{.}} {{end}}{{else}}none reported{{end}}

{{/* The counts come from the fleet aggregate and nowhere else, so a box that read never described has NO counts — printing three zeroes here would state a read that never happened, beside an awake/asleep that correctly says it does not know. */}}

{{if .CountsKnown}}static {{.Static}} · resident {{.Resident}} · hibernating {{.Hibernating}} · awake {{intOrDash .Awake}} · asleep {{intOrDash .Asleep}} {{else}}counts unknown{{end}} {{with .Release}}· {{.}}{{end}}

{{if .Stale}}

dark{{if .Dark}} {{.Dark}}{{end}}

{{end}} {{/* Drift is where the rate card and the estate disagree — a fact to watch, not an outage, so it wears chip-stale's bordered warn tone rather than a filled marker. */}} {{range .Drift}}

{{.}}

{{end}}
{{else}} {{/* An empty box list has two causes and they are not the same fact: no box has reported, or the read that would have listed them failed. Saying the first when the second happened is the confident negative claim this page exists to avoid — so the handler carries which one it is. */}} {{if $.ArchBoxesUnread}}

The box list could not be read — this is not a claim that the deployment has no boxes.

{{else}}

No box has reported to this deployment yet.

{{end}} {{end}} {{range .CARLOS.Groups}}

{{.Title}}

{{template "archtable" .}} {{end}} {{/* The second bank is named for what is TRUE of it in every deployment, not for what it happens to be here. This console serves every CARLOS estate; "legacy" describes Tito's Kubernetes cluster and would be wrong, and unexplained, on the next account. */}}

Also in this account

Everything else the account is carrying. The console has no first-hand knowledge of these — it can see them, and it cannot trace a path to any of them from a box it runs or the bucket it deploys from.

{{/* One picture per region, stacked down the page. Region is the STRUCTURE here, not a word on a card: a box is the only thing on this diagram that is really in a region, and everything else is drawn in the band of the box it reaches (archregion.go). That is also what keeps each picture inside the 64rem column — a band is at most four nodes wide — so this page scrolls down and never across. */}} {{range .Rest.Bands}}

{{.Label}}

{{.SVG}}
{{end}} {{range .Rest.Groups}}

{{.Title}}

{{template "archtable" .}} {{end}} {{/* The inventory's own partial-read list: which service or region the estate read could not see. A page that quietly dropped these would be claiming the estate is smaller than it is. */}} {{if .Partial}}

Reads that failed

{{end}} {{end}} {{template "bottom" .}}{{end}} {{/* One resource table, rendered identically in both banks — the two halves of this page differ in what they contain and in nothing else. */}} {{define "archtable"}}
{{range .Rows}}{{end}}
NameTypeRegionDetail
{{.Name}}{{.NativeType}}{{.Region}}{{.Detail}}
{{end}}