ViewConfigs

The only checks the server makes of a view's config: it is an object, its kind is a view kind, it is no larger than MAX_CONFIG_BYTES, and the paths the store queries hold what a store can index (requireReferences). The engine admits its meaning when it opens it.

Properties

Link copied to clipboard
const val KIND: String
Link copied to clipboard

The largest config, in UTF-8 bytes of its JSON. Below the request body a WebFlux server buffers by default (spring.codec.max-in-memory-size, 256 KB), with room for the rest of a create, so a config past it meets this refusal (ViewStoreException.invalid) rather than the codec's IllegalState.

Link copied to clipboard
const val MAX_ID_LENGTH: Int = 256

The longest definition id and panel reference: every store indexes them whole as exact values, and an index term has a size limit (Elasticsearch refuses a whole document whose keyword passes 32766 bytes).

Link copied to clipboard
const val MAX_PANELS: Int = 1000

The most PANELS a config holds. Each panel is a nested document of the view's snapshot in Elasticsearch, which refuses a document of more than 10000 (index.mapping.nested_objects.limit). The engine's own limit (maxDashboardPanels, 24 by default) is a host setting; this bound leaves it room.

Link copied to clipboard
const val MAX_TITLE_LENGTH: Int = 120
Link copied to clipboard

Where a dashboard panel (an element of PANELS) references a saved view, in the engine's DashboardPanel: the view it shows (instanceId), the view 「在工作台中打开」 opens (opens), and the view or dashboard a press opens (click.instanceId). A board's tabs hold no panels, and a view it owns (owned) is not a reference.

Link copied to clipboard
const val PANELS: String

A dashboard's panels, the array of config that references saved views.

Functions

Link copied to clipboard
fun requireDefinitionId(definitionId: String): String
Link copied to clipboard

title without surrounding blanks, after checking it is neither empty nor too long.

Link copied to clipboard
fun requireValid(config: JsonNode?): ViewKind

The kind of config, after checking its shape and size.