Skip to main content
zerotal

Documentation


Documentation / @zerotal/admin / index / Cluster

Abstract Class: Cluster

Defined in: admin/src/Cluster.ts:23

Cluster — a named section of the panel that owns a group of resources and pages, giving them a shared URL segment and a single sidebar entry.

A panel with thirty resources spread across three business areas is easier to navigate as three clusters than as one long list. Members declare which cluster they belong to; the panel does the rest:

export class ShopCluster extends Cluster { static override slug = "shop"; static override title = "Shop"; static override navigationIcon = "collection"; }

export class ProductResource extends Resource { static override cluster = ShopCluster; // → /admin/shop/products }

The cluster's own ability gates the whole section: deny it and every member disappears from the sidebar and refuses its route, without each member having to repeat the check.

Constructors

Constructor

new Cluster(): Cluster

Returns

Cluster

Properties

slug

static slug: string

Defined in: admin/src/Cluster.ts:25

URL segment the cluster's members live under.


title

static title: string

Defined in: admin/src/Cluster.ts:27

Heading shown for the cluster in navigation and breadcrumbs.


static optional navigationLabel?: string

Defined in: admin/src/Cluster.ts:29

Sidebar label, when it should differ from the title.


static navigationIcon: string = "layout-grid"

Defined in: admin/src/Cluster.ts:31

Navigation icon key (see ui/icons.ts).


static optional navigationGroup?: string

Defined in: admin/src/Cluster.ts:33

Optional sidebar group the cluster itself sits in.


static navigationSort: number = 0

Defined in: admin/src/Cluster.ts:35

Sort order within the sidebar (lower = higher).


ability?

static optional ability?: string

Defined in: admin/src/Cluster.ts:37

Ability gating the whole cluster, checked for the entry and every route.

Methods

getNavigationLabel()

static getNavigationLabel(): string

Defined in: admin/src/Cluster.ts:39

Returns

string


url()

static url(base): string

Defined in: admin/src/Cluster.ts:44

The cluster's URL prefix under a panel base.

Parameters

base

string

Returns

string