MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

HubPages

MMO\admin\monitoring · 1 symbole · générée le 27 Oct 2026

class

HubPages

HubPages.php:21

What the pages of a monitoring hub are made of ({MMO\admin}/monitoring/pages/hub.phtml): mmo.client's design system -- .widgets of tiles, article.card, table.data, .status-tag -- its <mmo-chart> for the curves, and mmo.admin's own elements for what a page does: <mmo-hub-bar> (collect now, reload), <mmo-hub-ack> (acknowledge an incident), <mmo-hub-tools> (the read-only tools).

class MMO\admin\monitoring\HubPages
Espace de noms
MMO\admin\monitoring
Every page is drawn on the server from what the last collection kept ([`Hub`](https://mmoframework.fr/fr/documentation/mmo.admin/php/monitoring/HubPages.md#hubpages-hub), [`MonitorStore`](https://mmoframework.fr/fr/documentation/mmo.admin/php/monitoring/MonitorStore.md#monitorstore)): nothing is asked of a server to draw one. Every value is escaped here; mmo-chart prints its labels as html, and they are the hub's.
<?php use MMO\admin\monitoring\HubPages as P; if (!($hub = P::Guard())) {return;} ?> <?= P::Header($hub, P::T('Overview')) ?>

Index

RANGESthe ranges a page's curves can show: seconds => label
SITE_PROBESthe probes of a site, in the order a page shows them
TONESa reading's status => the design system's tone
charts static
hub static
styled static
Ago($time) static
Api() static
Bars($rows, $label, $value, $format, $link, $note) static
CanCollect() static
Card($title, $body, $note, $class) static
Chart($series, $metrics, $unit, $type, $height, $width) staticCurves of a subject, drawn by mmo-chart.
Deployments($deployments, $site) static
Duration($seconds) static
Empty($message) static
Errors($hub) static
Facts($facts, $keys, $labels) static
Fill($values) static
Gauge($label, $value, $warning, $critical, $text, $fill) static
Gauges($m) static
Guard() staticThe hub, or a callout saying why there is none: a page shows nothing else then.
H($value) static
Header($hub, $title, $subtitle, $ranges) static
Host($url) static
Hub() static
Incidents($incidents, $empty) static
Level($value, $warning, $critical, $below) static
Mb($value) static
Ms($value) static
Number($value, $decimals) static
Percent($value) static
ProbeTags($target) static
Query($key) static
Range() static
Ranges() static
ReadingCard($probe, $reading) static
ServerCard($server, $targets) static
SetHub($hub) staticUse another hub (a test).
Setting($name) static
SitesTable($targets) static
Spark($lines, $max) staticA small curve, no axis: a card's or a row's last day.
Status($status, $label, $title) static
Strip($statuses) static
Styles() staticThe few styles the design system has no class for: the gauges, the strip, the bars, the dots.
SubjectUrl($id) static
T($message, $context) static
Table($headers, $rows, $empty, $links) static
Tag($text, $tone, $title) static
Tiles($tiles) static
Tools($subject, $tools) static
Url($page, $query) static

Constantes3

RANGES

the ranges a page's curves can show: seconds => label

const RANGES = […4 items]

SITE_PROBES

the probes of a site, in the order a page shows them

const SITE_PROBES = ['http', 'release', 'database', 'logs', 'application']

TONES

a reading's status => the design system's tone

const TONES = […4 items]

Propriétés3

charts

static
protected static int $charts = 0
Type
int

hub

static
protected static ?MMO\admin\monitoring\Hub $hub = null
Type
null | Hub

styled

static
protected static bool $styled = false
Type
bool

Méthodes45

Api()

staticHubPages.php:67
static function Api(): string
retournestringHubController's api, for the elements: .../api/hub

Bars($rows, $label, $value, $format, $link, $note)

staticHubPages.php:517
static function Bars( array $rows, string $label, string $value, callable $format, ?callable $link = null, string $note = '' ): string
$rowsarray
$labelstring
$valuestring
$formatcallable
$link = nullnull | callable
$note = ''string
retournestringbars of a value per row: the largest collections, the sites' databases

CanCollect()

staticHubPages.php:70
static function CanCollect(): bool
retourneboolwhether the page may reach the servers (HubController's canCollect)

Card($title, $body, $note, $class)

staticHubPages.php:218
static function Card(string $title, string $body, string $note = '', string $class = ''): string
$titlestring
$bodystring
$note = ''string
$class = ''string
retournestringa card: a title (escaped), a body (html), an optional note (escaped)

Chart($series, $metrics, $unit, $type, $height, $width)

staticHubPages.php:324

Curves of a subject, drawn by mmo-chart.

static function Chart( array $series, array $metrics, string $unit = '', string $type = 'line', int $height = 260, int $width = 640 ): stringmmo-chart draws a missing value as 0, so the curves start where the first of them does, and a gap between two readings is filled by the line between them: readings further apart than the buckets (every 5 minutes, a week in 90 points is not) are not holes.
$seriesarraywhat MonitorStore::series returned
$metricsarray
$unit = ''stringa suffix for every value (%, ms)
$type = 'line'stringline or area
$height = 260int
$width = 640int
retournestring

Deployments($deployments, $site)

staticHubPages.php:492
static function Deployments(array $deployments, bool $site = true): string
$deploymentsarray
$site = truebool
retournestringthe deployments, newest first

Duration($seconds)

staticHubPages.php:139
static function Duration(int $seconds): string
$secondsint
retournestringa length of time, in words

Empty($message)

staticHubPages.php:224
static function Empty(string $message): string
$messagestring
retournestringthe design system's empty table text

Errors($hub)

staticHubPages.php:191
static function Errors(MMO\admin\monitoring\Hub $hub): string
$hubHub
retournestringwhat the hub could not read, and a hint when nothing was ever collected

Facts($facts, $keys, $labels)

staticHubPages.php:250
static function Facts(array $facts, ?array $keys = null, array $labels = []): string
$factsarray
$keys = nullnull | array
$labels = []array
retournestringfacts as a definition list, the empty ones left out

Fill($values)

staticHubPages.php:368
static function Fill(array $values): array
$valuesarraynumbers, null where there is none
retournearraythe gaps filled: between two values, the line joining them; before the first, the first; after the last, the last

Gauge($label, $value, $warning, $critical, $text, $fill)

staticHubPages.php:260
static function Gauge( string $label, int|float|null $value, float $warning, float $critical, string $text, ?float $fill = null ): string
$labelstring
$valueint | float | null
$warningfloat
$criticalfloat
$textstring
$fill = nullnull | float
retournestringa value on a bar, in the tone its limits give it

Gauges($m)

staticHubPages.php:268
static function Gauges(array $m): string
$marray
retournestringthe four gauges of a server: cpu, memory, its fullest disk, its load

Guard()

staticHubPages.php:52

The hub, or a callout saying why there is none: a page shows nothing else then.

static function Guard(): ?MMO\admin\monitoring\Hub
retournenull | Hub

Header($hub, $title, $subtitle, $ranges)

staticHubPages.php:172
static function Header( MMO\admin\monitoring\Hub $hub, string $title, string $subtitle = '', bool $ranges = false ): string
$hubHub
$titlestring
$subtitle = ''string
$ranges = falsebool
retournestringthe page's title, what it is about, and the hub's bar

Hub()

staticHubPages.php:38
static function Hub(): MMO\admin\monitoring\Hub
retourneHubthe hub HubController is configured with (its hub), read once

Incidents($incidents, $empty)

staticHubPages.php:455
static function Incidents(array $incidents, string $empty): string
$incidentsarray
$emptystring
retournestringincidents, each with what it is, since when, and its acknowledgement

Level($value, $warning, $critical, $below)

staticHubPages.php:159
static function Level( int|float|null $value, float $warning, float $critical, bool $below = false ): string
$valueint | float | null
$warningfloat
$criticalfloat
$below = falsebool
retournestringthe tone of a value against two limits: success, warning or error

Number($value, $decimals)

staticHubPages.php:110
static function Number(mixed $value, int $decimals = 1): string
$valuemixed
$decimals = 1int
retournestringa number the way a person reads it: no decimals past 100

ProbeTags($target)

staticHubPages.php:418
static function ProbeTags(array $target): string
$targetarray
retournestringeach probe of a site, as a tag of its status

Range()

staticHubPages.php:91
static function Range(): int
retourneintseconds of curves the page shows: ?range=, a day by default

Ranges()

staticHubPages.php:180
static function Ranges(): string
retournestringthe links to the other ranges of the curves

ReadingCard($probe, $reading)

staticHubPages.php:478
static function ReadingCard(string $probe, ?array $reading): string
$probestring
$readingnull | array
retournestringa probe's latest reading: its status, what it says, its numbers

ServerCard($server, $targets)

staticHubPages.php:391
static function ServerCard(array $server, array $targets): string
$serverarray
$targetsarray
retournestringa server's card: its status, address, gauges, last day and sites

SetHub($hub)

staticHubPages.php:46

Use another hub (a test).

static function SetHub(?MMO\admin\monitoring\Hub $hub): void
$hubnull | Hub
retournevoid

Setting($name)

staticHubPages.php:73
static function Setting(string $name): mixed
$namestring
retournemixedone of HubController's settings: the configuration's, else its default

SitesTable($targets)

staticHubPages.php:428
static function SitesTable(array $targets): string
$targetsarray
retournestringthe sites, one row each: their status, each probe's, the main numbers

Spark($lines, $max)

staticHubPages.php:282

A small curve, no axis: a card's or a row's last day.

static function Spark(array $lines, ?float $max = null): string
$linesarraythe curves' values, null where there is none
$max = nullnull | floatthe top of the drawing (100 for percentages); null: the highest value
retournestring

Status($status, $label, $title)

staticHubPages.php:153
static function Status(string $status, ?string $label = null, string $title = ''): string
$statusstring
$label = nullnull | string
$title = ''string
retournestringa status as the design system's tag: its word, or $label

Strip($statuses)

staticHubPages.php:303
static function Strip(array $statuses): string
$statusesarray
retournestringthe worst status of each bucket of a period, as a strip

Styles()

staticHubPages.php:533

The few styles the design system has no class for: the gauges, the strip, the bars, the dots. Once a page.

static function Styles(): string
retournestring

SubjectUrl($id)

staticHubPages.php:85
static function SubjectUrl(string $id): string
$idstring
retournestringthe url of a server's or a site's page

T($message, $context)

staticHubPages.php:107
static function T(string $message, array $context = []): string
$messagestring
$context = []array
retournestringa sentence of the hub, translated and escaped

Table($headers, $rows, $empty, $links)

staticHubPages.php:232
static function Table(array $headers, array $rows, string $empty = '', array $links = []): string
$headersarrayhtml, > first for a right-aligned column
$rowsarrayhtml cells
$empty = ''string
$links = []arraythe url of each row, or ''
retournestringa table of the design system

Tag($text, $tone, $title)

staticHubPages.php:167
static function Tag(string $text, string $tone, string $title = ''): string
$textstring
$tonestring
$title = ''string
retournestringa value as a tag in its tone

Tools($subject, $tools)

staticHubPages.php:511
static function Tools(string $subject, array $tools): string
$subjectstring
$toolsarray
retournestringthe read-only tools of a subject

Url($page, $query)

staticHubPages.php:80
static function Url(string $page, array $query = []): string
$pagestring
$query = []array
retournestringthe url of a page of the hub: server, ['name' => 'ovh1'] (mmo.client's PageController serves it)