@gravitee/gamma-lib-observability 4.0.1 → 4.0.2-feat-obs-107-send-host-module-dashboards.f37bcbe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INTEGRATION.md +46 -12
- package/USAGE_GUIDE.md +14 -2
- package/dist/dashboard-access-provider.js +1 -0
- package/dist/data-sources/dashboard-persistence.d.ts +13 -0
- package/dist/data-sources/dashboard-persistence.d.ts.map +1 -1
- package/dist/data-sources/dashboard-wire.d.ts +7 -0
- package/dist/data-sources/dashboard-wire.d.ts.map +1 -1
- package/dist/data-sources/http-dashboard-persistence.d.ts +12 -0
- package/dist/data-sources/http-dashboard-persistence.d.ts.map +1 -1
- package/dist/data-sources/with-grid-migration.d.ts +1 -0
- package/dist/data-sources/with-grid-migration.d.ts.map +1 -1
- package/dist/hooks/query-keys.d.ts +16 -2
- package/dist/hooks/query-keys.d.ts.map +1 -1
- package/dist/hooks/use-custom-dashboards.d.ts.map +1 -1
- package/dist/index.js +153 -130
- package/dist/logs/detail/presets/connection-log-preset.d.ts +6 -11
- package/dist/logs/detail/presets/connection-log-preset.d.ts.map +1 -1
- package/dist/logs/detail/presets/message-log-preset.d.ts +5 -10
- package/dist/logs/detail/presets/message-log-preset.d.ts.map +1 -1
- package/dist/logs/detail/presets/webhook-log-preset.d.ts +4 -9
- package/dist/logs/detail/presets/webhook-log-preset.d.ts.map +1 -1
- package/dist/logs/detail/testing/mock-log-detail-fixtures.d.ts.map +1 -1
- package/dist/logs/testing/mock-log-fixtures.d.ts.map +1 -1
- package/dist/persistence/local-storage-dashboard-persistence.d.ts +10 -0
- package/dist/persistence/local-storage-dashboard-persistence.d.ts.map +1 -1
- package/dist/routing/ObservabilityRoutes.d.ts.map +1 -1
- package/dist/routing/types.d.ts +12 -5
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/types/connection-log.d.ts +5 -10
- package/dist/types/connection-log.d.ts.map +1 -1
- package/dist/types/domain.d.ts +8 -0
- package/dist/types/domain.d.ts.map +1 -1
- package/package.json +1 -1
package/INTEGRATION.md
CHANGED
|
@@ -171,6 +171,7 @@ import { defineObservabilityFeatures } from '@gravitee/gamma-lib-observability';
|
|
|
171
171
|
import { myTemplates } from './dashboard-templates';
|
|
172
172
|
|
|
173
173
|
export const observability = defineObservabilityFeatures({
|
|
174
|
+
module: 'aim', // your Gamma module id, required when dashboards are enabled
|
|
174
175
|
features: {
|
|
175
176
|
dashboards: {
|
|
176
177
|
enabled: true,
|
|
@@ -221,6 +222,7 @@ That's it — you now have a working dashboards section. The library handles dat
|
|
|
221
222
|
|
|
222
223
|
The lib is a **contributor**: it ships routes, nav and route metadata; the host owns the shell. Use this as a quick reference of everything the host must wire — most of it is derivable from data the lib already exposes, so prefer the provided helpers over hand-rolled parsing.
|
|
223
224
|
|
|
225
|
+
- [ ] **Module id** — set `module` in `defineObservabilityFeatures` when dashboards are enabled (see [Dashboards are scoped by module](#dashboards-are-scoped-by-module)). The routes refuse to mount without it.
|
|
224
226
|
- [ ] **CSS** — import `@gravitee/gamma-lib-observability/styles` in the exposed entry (see [CSS](#css)).
|
|
225
227
|
- [ ] **Query client** — wrap the app in a single `QueryClientProvider` (shared singleton under Module Federation).
|
|
226
228
|
- [ ] **Authenticated HTTP** — pass the `http` prop (or an `HttpProvider`) once so every internal source is authenticated (see [Authenticated HTTP](#authenticated-http-http-prop)).
|
|
@@ -274,6 +276,30 @@ The `http` config is applied to **every** internally-built source. Resolution or
|
|
|
274
276
|
|
|
275
277
|
## Feature: Dashboards
|
|
276
278
|
|
|
279
|
+
### Dashboards are scoped by module
|
|
280
|
+
|
|
281
|
+
A custom dashboard belongs to the Gamma module that created it. A dashboard created in AIM is not listed in APIM, and the other way round. Declare your module so the section knows which one it is:
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
export const observability = defineObservabilityFeatures({
|
|
285
|
+
module: 'aim', // GammaModuleId, the same id the trace filters use
|
|
286
|
+
features: { dashboards: { enabled: true, templates } },
|
|
287
|
+
nav: { label: 'Observability' },
|
|
288
|
+
});
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
`module` is **required** when `features.dashboards` is enabled: `observability.Routes` throws on its first render without it. A missing module would create every dashboard in no module and list them all everywhere, so the section fails loudly instead.
|
|
292
|
+
|
|
293
|
+
What the section does with it:
|
|
294
|
+
|
|
295
|
+
- **List and open** send `?module=<id>`. The API returns that module's dashboards only, and opening another module's dashboard by URL shows "not found".
|
|
296
|
+
- **Create** puts `module` in the body. The module is always the host's, never copied from a dashboard: _Duplicate_ and a JSON pasted from another module both create the dashboard in the current module.
|
|
297
|
+
- **Update** never sends it. A dashboard keeps its module for life.
|
|
298
|
+
- The JSON tab does not show it, like `id`, `createdAt` and `updatedAt`.
|
|
299
|
+
- The cache is keyed per module, so two modules sharing a `QueryClient` never see each other's lists.
|
|
300
|
+
|
|
301
|
+
At API level, listing **without** `module` returns the dashboards of every module. That is what a future cross-module screen would use; the lib's own screens always send it. The scope organises what each module shows. It is not a permission: access stays governed by `ENVIRONMENT_DASHBOARD` permissions.
|
|
302
|
+
|
|
277
303
|
### Dashboard templates
|
|
278
304
|
|
|
279
305
|
Each module defines its own preset dashboards using `defineDashboardTemplate`:
|
|
@@ -847,8 +873,9 @@ export const observability = defineObservabilityFeatures({
|
|
|
847
873
|
});
|
|
848
874
|
```
|
|
849
875
|
|
|
850
|
-
Omit `module` and only the cross-module filters are served
|
|
851
|
-
|
|
876
|
+
Omit `module` and only the cross-module filters are served, the pre-existing behaviour. A host that
|
|
877
|
+
enables dashboards must set it anyway (see [Dashboards are scoped by module](#dashboards-are-scoped-by-module)),
|
|
878
|
+
and the same id then scopes both. Filter definitions belong to a module, not to one API: the same palette is served
|
|
852
879
|
for every API the tracing screen can select.
|
|
853
880
|
|
|
854
881
|
### tracesBaseUrl
|
|
@@ -1171,10 +1198,11 @@ The provider wraps the persistence it is given so that every dashboard reaches t
|
|
|
1171
1198
|
|
|
1172
1199
|
Options of the built-in adapter, `createHttpDashboardPersistence(baseUrl, options?)`:
|
|
1173
1200
|
|
|
1174
|
-
| Option | Purpose
|
|
1175
|
-
| --------------------------------- |
|
|
1176
|
-
| `fetch`, `headers`, `credentials` | Same as the other HTTP adapters, see [Authenticated HTTP](#authenticated-http-http-prop)
|
|
1177
|
-
| `dashboardsPath` | Path appended to `baseUrl`. Defaults to `'/observability/dashboards'`
|
|
1201
|
+
| Option | Purpose |
|
|
1202
|
+
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1203
|
+
| `fetch`, `headers`, `credentials` | Same as the other HTTP adapters, see [Authenticated HTTP](#authenticated-http-http-prop) |
|
|
1204
|
+
| `dashboardsPath` | Path appended to `baseUrl`. Defaults to `'/observability/dashboards'` |
|
|
1205
|
+
| `module` | Module the adapter is scoped to. `ObservabilityRoutes` passes `config.module`. Omitted, the adapter sees every module and creates dashboards with none, as the API does |
|
|
1178
1206
|
|
|
1179
1207
|
To store dashboards elsewhere, mount your own implementation instead. The browser-local one shipped with the library is the shortest example:
|
|
1180
1208
|
|
|
@@ -1186,8 +1214,10 @@ import {
|
|
|
1186
1214
|
|
|
1187
1215
|
// Scope the key per environment: localStorage is origin-wide, so an unscoped
|
|
1188
1216
|
// key leaks dashboards across environments served from the same console origin.
|
|
1217
|
+
// `module` scopes it per module within that key, like the API.
|
|
1189
1218
|
const persistence = createLocalStorageDashboardPersistence({
|
|
1190
1219
|
storageKey: `observability.dashboards.${environmentId}`,
|
|
1220
|
+
module: 'aim',
|
|
1191
1221
|
});
|
|
1192
1222
|
|
|
1193
1223
|
<DashboardPersistenceProvider persistence={persistence}>
|
|
@@ -1199,6 +1229,8 @@ A custom store implements:
|
|
|
1199
1229
|
|
|
1200
1230
|
```ts
|
|
1201
1231
|
interface DashboardPersistence {
|
|
1232
|
+
/** The module this store is scoped to, absent for a store that sees every module. */
|
|
1233
|
+
readonly module?: string;
|
|
1202
1234
|
fetchDashboard(id: string, signal?: AbortSignal): Promise<Dashboard>;
|
|
1203
1235
|
fetchDashboards(signal?: AbortSignal): Promise<Dashboard[]>;
|
|
1204
1236
|
createDashboard(dashboard: Dashboard, signal?: AbortSignal): Promise<Dashboard>;
|
|
@@ -1212,14 +1244,16 @@ interface DashboardPersistence {
|
|
|
1212
1244
|
|
|
1213
1245
|
Creation and update are separate operations rather than one `save`: the caller always knows which it means, and a server-backed store maps them to endpoints guarded by different permissions. Implementations own `createdAt` and `updatedAt` and stamp them themselves.
|
|
1214
1246
|
|
|
1247
|
+
A store scoped to a module declares it in `module`, lists and reads only that module's dashboards (another module's reads as not found), stamps it on every create whatever the dashboard handed in says, and keeps it on update. The screens key their cache on `module`, so a store that scopes by module without declaring it shares its cache entries with every other module.
|
|
1248
|
+
|
|
1215
1249
|
**Failures are typed**, so a screen can tell one outcome from another. The screens read the `status` carried by the error rather than testing classes, so an error that is structurally one of these (a `status: 404` or `status: 403` field) works across bundling boundaries; a store that throws plain `Error`s opts out of all of it and lands every failure on the generic error toast. The same predicates the screens use, `isDashboardGone(error)` and `isDashboardForbidden(error)`, are exported for hosts composing their own screens from the hooks — prefer them over `instanceof` on the classes, which fails when two copies of the library end up on one disk.
|
|
1216
1250
|
|
|
1217
|
-
| Thrown | Meaning
|
|
1218
|
-
| --------------------------- |
|
|
1219
|
-
| `DashboardConflictError` | The dashboard moved since it was read
|
|
1220
|
-
| `DashboardNotFoundError` | No such dashboard in this environment | On a load, the "may have been deleted" panel with "Try again". On a write to an existing dashboard, the editor's deleted step |
|
|
1221
|
-
| `DashboardForbiddenError` | The caller may not perform this verb
|
|
1222
|
-
| `DashboardPersistenceError` | Anything else
|
|
1251
|
+
| Thrown | Meaning | What the UI does with it |
|
|
1252
|
+
| --------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1253
|
+
| `DashboardConflictError` | The dashboard moved since it was read | Opens the conflict dialog on the editor's save |
|
|
1254
|
+
| `DashboardNotFoundError` | No such dashboard in this environment and module | On a load, the "may have been deleted" panel with "Try again". On a write to an existing dashboard, the editor's deleted step |
|
|
1255
|
+
| `DashboardForbiddenError` | The caller may not perform this verb | Degrades the screen instead of erroring — see [Backend refusals](#backend-refusals-403) |
|
|
1256
|
+
| `DashboardPersistenceError` | Anything else | Error toast on writes; the editor's failed first load offers "Try again". The listing has no error state today: custom rows are absent, templates stay |
|
|
1223
1257
|
|
|
1224
1258
|
### Backend refusals (403)
|
|
1225
1259
|
|
package/USAGE_GUIDE.md
CHANGED
|
@@ -32,6 +32,7 @@ import { defineObservabilityFeatures } from '@gravitee/gamma-lib-observability';
|
|
|
32
32
|
import { myDashboardTemplates } from './templates';
|
|
33
33
|
|
|
34
34
|
export const observability = defineObservabilityFeatures({
|
|
35
|
+
module: 'aim',
|
|
35
36
|
scopeApiTypes: ['MCP', 'LLM'],
|
|
36
37
|
features: {
|
|
37
38
|
dashboards: { enabled: true, templates: myDashboardTemplates },
|
|
@@ -42,6 +43,8 @@ export const observability = defineObservabilityFeatures({
|
|
|
42
43
|
});
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
`module` is your Gamma module id. It is **required** when dashboards are enabled: custom dashboards are created in, and listed for, that module only. See the [API reference](#defineobservabilityfeatures--api-reference).
|
|
47
|
+
|
|
45
48
|
`scopeApiTypes` generates `API_TYPE` context filters and scoped filter providers for all features. Override per-feature when needed (e.g. logs scoped to `['MCP']` only while dashboards sees `['MCP', 'LLM']`).
|
|
46
49
|
|
|
47
50
|
### 2. Mount routes
|
|
@@ -154,6 +157,8 @@ import { observabilityQueryKeys } from '@gravitee/gamma-lib-observability';
|
|
|
154
157
|
|
|
155
158
|
queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.all });
|
|
156
159
|
queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.dashboard('dash-123') });
|
|
160
|
+
// Custom dashboards are keyed per module: pass the module your section declares.
|
|
161
|
+
queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.customDashboards('aim') });
|
|
157
162
|
```
|
|
158
163
|
|
|
159
164
|
---
|
|
@@ -736,7 +741,14 @@ Template properties:
|
|
|
736
741
|
|
|
737
742
|
### `defineObservabilityFeatures` — API reference
|
|
738
743
|
|
|
739
|
-
`defineObservabilityFeatures` is the entry point shown in [Quick start](#quick-start) step 1.
|
|
744
|
+
`defineObservabilityFeatures` is the entry point shown in [Quick start](#quick-start) step 1.
|
|
745
|
+
|
|
746
|
+
Its `module` option (`GammaModuleId`: `'aim'`, `'apim'`, `'esm'`) says which Gamma module mounts the section. It does two things:
|
|
747
|
+
|
|
748
|
+
- **Dashboards.** Custom dashboards belong to the module that created them. The section lists and opens only this module's dashboards, and creates new ones (duplicates and pasted JSON included) in this module. Required when `features.dashboards` is enabled: `Routes` throws on its first render without it.
|
|
749
|
+
- **Tracing.** Sent as the `module` query param of the trace filter endpoints, so the palette includes this module's filters on top of the cross-module ones. Optional when only tracing is enabled.
|
|
750
|
+
|
|
751
|
+
It returns an `ObservabilityFeatures` object with the following members:
|
|
740
752
|
|
|
741
753
|
| Member | Type | Description |
|
|
742
754
|
| -------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
@@ -1082,7 +1094,7 @@ function LogsPage() {
|
|
|
1082
1094
|
<>
|
|
1083
1095
|
<LogTable
|
|
1084
1096
|
onRowClick={(row) => {
|
|
1085
|
-
setSelectedLogId(row.
|
|
1097
|
+
setSelectedLogId(row.requestId);
|
|
1086
1098
|
setSelectedApiId(row.apiId);
|
|
1087
1099
|
}}
|
|
1088
1100
|
/>
|
|
@@ -122,6 +122,7 @@ function T(e) {
|
|
|
122
122
|
function E(e) {
|
|
123
123
|
let t = (e) => Promise.resolve(e).then(v, D);
|
|
124
124
|
return {
|
|
125
|
+
...e.module !== void 0 && { module: e.module },
|
|
125
126
|
fetchDashboard: (t, n) => Promise.resolve(e.fetchDashboard(t, n)).then(v),
|
|
126
127
|
fetchDashboards: (t) => Promise.resolve(e.fetchDashboards(t)).then((e) => Array.isArray(e) ? e.map(v) : e),
|
|
127
128
|
createDashboard: (n, r) => t(e.createDashboard(n, r)),
|
|
@@ -44,6 +44,19 @@ export interface UpdateDashboardOptions {
|
|
|
44
44
|
* is deliberately out of scope here.
|
|
45
45
|
*/
|
|
46
46
|
export interface DashboardPersistence {
|
|
47
|
+
/**
|
|
48
|
+
* The Gamma module this store is scoped to, or absent for a store that sees
|
|
49
|
+
* every module's dashboards.
|
|
50
|
+
*
|
|
51
|
+
* A scoped store lists and reads only that module's dashboards (a dashboard
|
|
52
|
+
* of another module is not found), and stamps it on every dashboard it
|
|
53
|
+
* creates, whatever the dashboard handed in says. Update never changes it.
|
|
54
|
+
*
|
|
55
|
+
* The screens key their cache on it, so two stores scoped to different
|
|
56
|
+
* modules never share cached dashboards. A store that scopes by module must
|
|
57
|
+
* declare it here for that reason.
|
|
58
|
+
*/
|
|
59
|
+
readonly module?: string;
|
|
47
60
|
/**
|
|
48
61
|
* Reads one dashboard.
|
|
49
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-persistence.d.ts","sourceRoot":"","sources":["../../src/data-sources/dashboard-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACrE,eAAe,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAA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;;OAQG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}
|
|
@@ -41,6 +41,8 @@ export interface WireDashboard {
|
|
|
41
41
|
version?: number | null;
|
|
42
42
|
createdAt?: number | null;
|
|
43
43
|
updatedAt?: number | null;
|
|
44
|
+
/** Set once, on create. Null for a dashboard stored before modules existed. */
|
|
45
|
+
module?: string | null;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Body of `POST` and `PUT`. Server-owned fields (`version`, `createdAt`,
|
|
@@ -55,6 +57,11 @@ export interface WireSaveDashboardRequest {
|
|
|
55
57
|
filters: WireDashboardFilter[];
|
|
56
58
|
timeRange: WireTimeRange;
|
|
57
59
|
widgets: readonly Widget[];
|
|
60
|
+
/**
|
|
61
|
+
* The module the dashboard is created in, read on `POST` only: the API keeps
|
|
62
|
+
* it immutable, so a `PUT` never carries it.
|
|
63
|
+
*/
|
|
64
|
+
module?: string;
|
|
58
65
|
}
|
|
59
66
|
export interface WirePagination {
|
|
60
67
|
totalCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-wire.d.ts","sourceRoot":"","sources":["../../src/data-sources/dashboard-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAkC,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA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C7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACpC;AAED,iFAAiF;AACjF,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAClC;AAwBD,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,mBAAmB,CAYzE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CASzE;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,CAInE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAcnF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAmBhE;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACvC,wBAAwB,CAS1B"}
|
|
@@ -8,6 +8,18 @@ export interface HttpDashboardPersistenceOptions extends HttpOptions {
|
|
|
8
8
|
* @default '/observability/dashboards'
|
|
9
9
|
*/
|
|
10
10
|
readonly dashboardsPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The Gamma module this adapter is scoped to. Sent as `?module=` on the list
|
|
13
|
+
* and on get by id, so only that module's dashboards are seen, and in the
|
|
14
|
+
* body of every create, so the new dashboard belongs to it. Never taken from
|
|
15
|
+
* the dashboard being created, and never sent on update: the API keeps a
|
|
16
|
+
* dashboard's module for life.
|
|
17
|
+
*
|
|
18
|
+
* Omitted, the adapter sees every module's dashboards and creates dashboards
|
|
19
|
+
* with no module, which is what the API does without the param.
|
|
20
|
+
* `ObservabilityRoutes` always passes the host's `config.module`.
|
|
21
|
+
*/
|
|
22
|
+
readonly module?: string;
|
|
11
23
|
/**
|
|
12
24
|
* Where this adapter remembers which revision each dashboard is being edited
|
|
13
25
|
* from. Pass one in to give that memory a lifetime longer than the adapter's,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-dashboard-persistence.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-dashboard-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAkBvG,MAAM,WAAW,+BAAgC,SAAQ,WAAW;IAClE;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI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EACf,OAAO,CAAC,EAAE,+BAA+B,GACxC,wBAAwB,CAoR1B"}
|
|
@@ -8,6 +8,7 @@ import { DashboardPersistence } from './dashboard-persistence';
|
|
|
8
8
|
* dropped without a word, since leaving one off an object type-checks.
|
|
9
9
|
*/
|
|
10
10
|
export declare const FORWARDED_PERSISTENCE_MEMBERS: {
|
|
11
|
+
readonly module: true;
|
|
11
12
|
readonly fetchDashboard: true;
|
|
12
13
|
readonly fetchDashboards: true;
|
|
13
14
|
readonly createDashboard: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-grid-migration.d.ts","sourceRoot":"","sources":["../../src/data-sources/with-grid-migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"with-grid-migration.d.ts","sourceRoot":"","sources":["../../src/data-sources/with-grid-migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;CASmB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,oBAAoB,CAsBzF"}
|
|
@@ -57,8 +57,22 @@ export declare const observabilityQueryKeys: {
|
|
|
57
57
|
readonly module: string | undefined;
|
|
58
58
|
}];
|
|
59
59
|
readonly dashboard: (id: string) => readonly ["observability", "dashboard", string];
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Custom dashboards are keyed on the module their store is scoped to, so two
|
|
62
|
+
* modules sharing a `QueryClient` never read each other's cached lists.
|
|
63
|
+
* `module` is the persistence's own (`DashboardPersistence.module`), absent
|
|
64
|
+
* for an unscoped store.
|
|
65
|
+
*/
|
|
66
|
+
readonly customDashboards: (module?: string) => readonly ["observability", "custom-dashboards", {
|
|
67
|
+
readonly module: string | undefined;
|
|
68
|
+
}];
|
|
69
|
+
/**
|
|
70
|
+
* Nested under {@link customDashboards} for the same module, so invalidating
|
|
71
|
+
* that list also refreshes every dashboard of the module that is open.
|
|
72
|
+
*/
|
|
73
|
+
readonly customDashboard: (id: string, module?: string) => readonly ["observability", "custom-dashboards", {
|
|
74
|
+
readonly module: string | undefined;
|
|
75
|
+
}, string];
|
|
62
76
|
readonly filterLabels: (key: string) => readonly ["observability", "filterLabels", string];
|
|
63
77
|
};
|
|
64
78
|
//# sourceMappingURL=query-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/hooks/query-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAmB3E,eAAO,MAAM,sBAAsB;;mCAItB,SAAS,kBAAkB,EAAE,aAC3B,SAAS,YACV,MAAM,YACN,eAAe,EAAE,OACtB,SAAS,MAAM,EAAE,UACd,MAAM,WACL,SAAS,YAAY,EAAE;;;;;;;;;0BAS5B,SAAS,MAAM,EAAE,aACV,SAAS,YACV,eAAe,EAAE,YACjB;QACR,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;QACxC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;;;;;;;;;iCAgBiB,SAAS,aAAa,EAAE,aAAa,SAAS,YAAY,eAAe,EAAE;;;;;+BAO7E,SAAS,YAAY,eAAe,EAAE;;;;6BAGxC,MAAM,SAAS,MAAM;+BAEnB,MAAM,SAAS,MAAM;6BAEvB,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|
1
|
-
{"version":3,"file":"use-custom-dashboards.d.ts","sourceRoot":"","sources":["../../src/hooks/use-custom-dashboards.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqBjD;;;;GAIG;AACH,wBAAgB,wBAAwB,gFAiBvC;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,6EAuB7D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,4FAEzC;AAED,wBAAgB,0BAA0B,4FAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,4FAI5C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"use-custom-dashboards.d.ts","sourceRoot":"","sources":["../../src/hooks/use-custom-dashboards.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqBjD;;;;GAIG;AACH,wBAAgB,wBAAwB,gFAiBvC;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,6EAuB7D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,4FAEzC;AAED,wBAAgB,0BAA0B,4FAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,4FAI5C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAkBxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAS5E;AAgCD,wBAAgB,0BAA0B,oFAuBzC"}
|