@perses-dev/dashboards 0.37.2 → 0.38.0
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/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +12 -52
- package/dist/cjs/components/Variables/TemplateVariable.js +2 -2
- package/dist/cjs/components/Variables/VariableEditor.js +17 -6
- package/dist/cjs/components/Variables/index.js +0 -2
- package/dist/cjs/context/DatasourceStoreProvider.js +22 -18
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +11 -46
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +1 -1
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +15 -4
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/index.d.ts +0 -2
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +0 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +4 -3
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +22 -18
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +2 -2
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -399
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -178
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -29
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -91
- package/dist/cjs/components/Variables/variable-model.js +0 -117
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +0 -10
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +0 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -354
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +0 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +0 -16
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +0 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +0 -122
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +0 -1
- package/dist/components/Variables/VariableEditorForm/index.d.ts +0 -3
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +0 -1
- package/dist/components/Variables/VariableEditorForm/index.js +0 -16
- package/dist/components/Variables/VariableEditorForm/index.js.map +0 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +0 -23
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +0 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -79
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +0 -1
- package/dist/components/Variables/variable-model.d.ts +0 -16
- package/dist/components/Variables/variable-model.d.ts.map +0 -1
- package/dist/components/Variables/variable-model.js +0 -105
- package/dist/components/Variables/variable-model.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/index.tsx"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/index.tsx"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
export * from './EditVariablesButton';
|
|
14
14
|
export * from './TemplateVariable';
|
|
15
15
|
export * from './VariableEditor';
|
|
16
|
-
export * from './VariableEditorForm';
|
|
17
16
|
export * from './VariableList';
|
|
18
|
-
export * from './variable-model';
|
|
19
17
|
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Variables/index.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './EditVariablesButton';\nexport * from './TemplateVariable';\nexport * from './VariableEditor';\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Variables/index.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './EditVariablesButton';\nexport * from './TemplateVariable';\nexport * from './VariableEditor';\nexport * from './VariableList';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { DashboardResource, Datasource, DatasourceSelector, GlobalDatasource } from '@perses-dev/core';
|
|
3
3
|
import { DatasourceClient } from '@perses-dev/plugin-system';
|
|
4
4
|
export interface DatasourceStoreProviderProps {
|
|
5
|
-
dashboardResource
|
|
5
|
+
dashboardResource?: DashboardResource;
|
|
6
|
+
projectName?: string;
|
|
6
7
|
datasourceApi: DatasourceApi;
|
|
7
|
-
children?:
|
|
8
|
+
children?: ReactNode;
|
|
8
9
|
onCreate?: (client: DatasourceClient) => DatasourceClient;
|
|
9
10
|
}
|
|
10
11
|
export interface DatasourceApi {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasourceStoreProvider.d.ts","sourceRoot":"","sources":["../../src/context/DatasourceStoreProvider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DatasourceStoreProvider.d.ts","sourceRoot":"","sources":["../../src/context/DatasourceStoreProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AACxD,OAAO,EACL,iBAAiB,EAEjB,UAAU,EACV,kBAAkB,EAElB,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;CAC3D;AAGD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,kBAAkB,KACzB,OAAO,CAAC;QAAE,QAAQ,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;IAErE,mBAAmB,EAAE,CACnB,QAAQ,EAAE,kBAAkB,KACzB,OAAO,CAAC;QAAE,QAAQ,EAAE,gBAAgB,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;IAE3E,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEjF,qBAAqB,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,eA4G1E"}
|
|
@@ -17,26 +17,30 @@ import { DatasourceStoreContext, usePluginRegistry } from '@perses-dev/plugin-sy
|
|
|
17
17
|
/**
|
|
18
18
|
* A `DatasourceContext` provider that uses an external API to resolve datasource selectors.
|
|
19
19
|
*/ export function DatasourceStoreProvider(props) {
|
|
20
|
-
const { dashboardResource , datasourceApi , onCreate , children } = props;
|
|
21
|
-
const
|
|
20
|
+
const { dashboardResource , projectName , datasourceApi , onCreate , children } = props;
|
|
21
|
+
const project = projectName !== null && projectName !== void 0 ? projectName : dashboardResource === null || dashboardResource === void 0 ? void 0 : dashboardResource.metadata.project;
|
|
22
22
|
const { getPlugin , listPluginMetadata } = usePluginRegistry();
|
|
23
23
|
const findDatasource = useEvent(async (selector)=>{
|
|
24
24
|
// Try to find it in dashboard spec
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
if (dashboardResource) {
|
|
26
|
+
const { datasources } = dashboardResource.spec;
|
|
27
|
+
const dashboardDatasource = findDashboardDatasource(datasources, selector);
|
|
28
|
+
if (dashboardDatasource !== undefined) {
|
|
29
|
+
return {
|
|
30
|
+
spec: dashboardDatasource,
|
|
31
|
+
proxyUrl: undefined
|
|
32
|
+
};
|
|
33
|
+
}
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
if (project) {
|
|
36
|
+
// Try to find it at the project level as a Datasource resource
|
|
37
|
+
const datasource = await datasourceApi.getDatasource(project, selector);
|
|
38
|
+
if (datasource !== undefined) {
|
|
39
|
+
return {
|
|
40
|
+
spec: datasource.resource.spec,
|
|
41
|
+
proxyUrl: datasource.proxyUrl
|
|
42
|
+
};
|
|
43
|
+
}
|
|
40
44
|
}
|
|
41
45
|
// Try to find it at the global level as a GlobalDatasource resource
|
|
42
46
|
const globalDatasource = await datasourceApi.getGlobalDatasource(selector);
|
|
@@ -78,7 +82,7 @@ import { DatasourceStoreContext, usePluginRegistry } from '@perses-dev/plugin-sy
|
|
|
78
82
|
const listDatasourceMetadata = useEvent(async (datasourcePluginKind)=>{
|
|
79
83
|
const [pluginMetadata, datasources, globalDatasources] = await Promise.all([
|
|
80
84
|
listPluginMetadata('Datasource'),
|
|
81
|
-
datasourceApi.listDatasources(project, datasourcePluginKind),
|
|
85
|
+
project ? datasourceApi.listDatasources(project, datasourcePluginKind) : [],
|
|
82
86
|
datasourceApi.listGlobalDatasources(datasourcePluginKind)
|
|
83
87
|
]);
|
|
84
88
|
// Find the metadata for the plugin type they asked for so we can use it for the name of the default datasource
|
|
@@ -89,7 +93,7 @@ import { DatasourceStoreContext, usePluginRegistry } from '@perses-dev/plugin-sy
|
|
|
89
93
|
// Get helper for de-duping results properly
|
|
90
94
|
const { results , addResult } = buildListDatasourceMetadataResults(datasourcePluginMetadata.display.name);
|
|
91
95
|
// Start with dashboard datasources that have highest precedence
|
|
92
|
-
if (dashboardResource.spec.datasources
|
|
96
|
+
if (dashboardResource === null || dashboardResource === void 0 ? void 0 : dashboardResource.spec.datasources) {
|
|
93
97
|
for(const selectorName in dashboardResource.spec.datasources){
|
|
94
98
|
const spec = dashboardResource.spec.datasources[selectorName];
|
|
95
99
|
if (spec === undefined || spec.plugin.kind !== datasourcePluginKind) continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/DatasourceStoreProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useMemo } from 'react';\nimport {\n DashboardResource,\n DashboardSpec,\n Datasource,\n DatasourceSelector,\n DatasourceSpec,\n GlobalDatasource,\n useEvent,\n} from '@perses-dev/core';\nimport {\n DatasourceStoreContext,\n DatasourceStore,\n usePluginRegistry,\n DatasourceMetadata,\n DatasourceClient,\n} from '@perses-dev/plugin-system';\n\nexport interface DatasourceStoreProviderProps {\n dashboardResource: DashboardResource;\n datasourceApi: DatasourceApi;\n children?: React.ReactNode;\n onCreate?: (client: DatasourceClient) => DatasourceClient;\n}\n\n// The external API for fetching datasource resources\nexport interface DatasourceApi {\n getDatasource: (\n project: string,\n selector: DatasourceSelector\n ) => Promise<{ resource: Datasource; proxyUrl: string } | undefined>;\n\n getGlobalDatasource: (\n selector: DatasourceSelector\n ) => Promise<{ resource: GlobalDatasource; proxyUrl: string } | undefined>;\n\n listDatasources: (project: string, pluginKind?: string) => Promise<Datasource[]>;\n\n listGlobalDatasources: (pluginKind?: string) => Promise<GlobalDatasource[]>;\n}\n\n/**\n * A `DatasourceContext` provider that uses an external API to resolve datasource selectors.\n */\nexport function DatasourceStoreProvider(props: DatasourceStoreProviderProps) {\n const { dashboardResource, datasourceApi, onCreate, children } = props;\n const { project } = dashboardResource.metadata;\n\n const { getPlugin, listPluginMetadata } = usePluginRegistry();\n\n const findDatasource = useEvent(async (selector: DatasourceSelector) => {\n // Try to find it in dashboard spec\n const { datasources } = dashboardResource.spec;\n const dashboardDatasource = findDashboardDatasource(datasources, selector);\n if (dashboardDatasource !== undefined) {\n return { spec: dashboardDatasource, proxyUrl: undefined };\n }\n\n // Try to find it at the project level as a Datasource resource\n const datasource = await datasourceApi.getDatasource(project, selector);\n if (datasource !== undefined) {\n return { spec: datasource.resource.spec, proxyUrl: datasource.proxyUrl };\n }\n\n // Try to find it at the global level as a GlobalDatasource resource\n const globalDatasource = await datasourceApi.getGlobalDatasource(selector);\n if (globalDatasource !== undefined) {\n return { spec: globalDatasource.resource.spec, proxyUrl: globalDatasource.proxyUrl };\n }\n\n throw new Error(`No datasource found for kind '${selector.kind}' and name '${selector.name}'`);\n });\n\n // Gets a datasource spec for a given selector\n const getDatasource = useCallback(\n async (selector: DatasourceSelector): Promise<DatasourceSpec> => {\n const { spec } = await findDatasource(selector);\n return spec;\n },\n [findDatasource]\n );\n\n // Given a Datasource selector, finds the spec for it and then uses its corresponding plugin the create a client\n const getDatasourceClient = useCallback(\n async function getClient<Client extends DatasourceClient>(selector: DatasourceSelector): Promise<Client> {\n const { kind } = selector;\n const [{ spec, proxyUrl }, plugin] = await Promise.all([findDatasource(selector), getPlugin('Datasource', kind)]);\n\n // allows extending client\n const client = plugin.createClient(spec.plugin.spec, { proxyUrl }) as Client;\n if (onCreate !== undefined) {\n return onCreate(client) as Client;\n }\n return client;\n },\n [findDatasource, getPlugin, onCreate]\n );\n\n const listDatasourceMetadata = useEvent(async (datasourcePluginKind: string): Promise<DatasourceMetadata[]> => {\n const [pluginMetadata, datasources, globalDatasources] = await Promise.all([\n listPluginMetadata('Datasource'),\n datasourceApi.listDatasources(project, datasourcePluginKind),\n datasourceApi.listGlobalDatasources(datasourcePluginKind),\n ]);\n\n // Find the metadata for the plugin type they asked for so we can use it for the name of the default datasource\n const datasourcePluginMetadata = pluginMetadata.find((metadata) => metadata.kind === datasourcePluginKind);\n if (datasourcePluginMetadata === undefined) {\n throw new Error(`Could not find a Datasource plugin with kind '${datasourcePluginKind}'`);\n }\n\n // Get helper for de-duping results properly\n const { results, addResult } = buildListDatasourceMetadataResults(datasourcePluginMetadata.display.name);\n\n // Start with dashboard datasources that have highest precedence\n if (dashboardResource.spec.datasources !== undefined) {\n for (const selectorName in dashboardResource.spec.datasources) {\n const spec = dashboardResource.spec.datasources[selectorName];\n if (spec === undefined || spec.plugin.kind !== datasourcePluginKind) continue;\n addResult(spec, selectorName);\n }\n }\n\n // Now look at project-level datasources\n for (const datasource of datasources) {\n const selectorName = datasource.metadata.name;\n addResult(datasource.spec, selectorName);\n }\n\n // And finally global datasources\n for (const globalDatasource of globalDatasources) {\n const selectorName = globalDatasource.metadata.name;\n addResult(globalDatasource.spec, selectorName);\n }\n\n return results;\n });\n\n const ctxValue: DatasourceStore = useMemo(\n () => ({\n getDatasource,\n getDatasourceClient,\n listDatasourceMetadata,\n }),\n [getDatasource, getDatasourceClient, listDatasourceMetadata]\n );\n\n return <DatasourceStoreContext.Provider value={ctxValue}>{children}</DatasourceStoreContext.Provider>;\n}\n\n// Helper to find a datasource in the list embedded in a dashboard spec\nfunction findDashboardDatasource(dashboardDatasources: DashboardSpec['datasources'], selector: DatasourceSelector) {\n if (dashboardDatasources === undefined) return undefined;\n\n // If using a name in the selector...\n if (selector.name !== undefined) {\n const named = dashboardDatasources[selector.name];\n if (named === undefined) return undefined;\n return named.plugin.kind === selector.kind ? named : undefined;\n }\n\n // If only using a kind, try to find one with that kind that is the default\n return Object.values(dashboardDatasources).find((ds) => ds.plugin.kind === selector.kind && ds.default === true);\n}\n\n// Helper for building a list of DatasourceMetadata results that will take care of de-duping already used selectors\nfunction buildListDatasourceMetadataResults(pluginDisplayName: string) {\n const results: DatasourceMetadata[] = [];\n const usedNames = new Set<string>();\n let defaultAdded = false;\n const addResult = (spec: DatasourceSpec, selectorName: string) => {\n // If we haven't added a default yet and this is a default, add default option to the beginning of the results\n if (spec.default && defaultAdded === false) {\n results.unshift({\n name: `Default ${pluginDisplayName}`,\n selector: {\n kind: spec.plugin.kind,\n },\n });\n defaultAdded = true;\n }\n\n // If we already have a datasource with this selector name, ignore it, otherwise add to end of list\n if (usedNames.has(selectorName)) return;\n\n results.push({\n name: spec.display?.name ?? selectorName,\n selector: {\n kind: spec.plugin.kind,\n name: selectorName,\n },\n });\n usedNames.add(selectorName);\n };\n\n return { results, addResult };\n}\n"],"names":["useCallback","useMemo","useEvent","DatasourceStoreContext","usePluginRegistry","DatasourceStoreProvider","props","dashboardResource","datasourceApi","onCreate","children","project","metadata","getPlugin","listPluginMetadata","findDatasource","selector","datasources","spec","dashboardDatasource","findDashboardDatasource","undefined","proxyUrl","datasource","getDatasource","resource","globalDatasource","getGlobalDatasource","Error","kind","name","getDatasourceClient","getClient","plugin","Promise","all","client","createClient","listDatasourceMetadata","datasourcePluginKind","pluginMetadata","globalDatasources","listDatasources","listGlobalDatasources","datasourcePluginMetadata","find","results","addResult","buildListDatasourceMetadataResults","display","selectorName","ctxValue","Provider","value","dashboardDatasources","named","Object","values","ds","default","pluginDisplayName","usedNames","Set","defaultAdded","unshift","has","push","add"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,i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BC,IAAI,EAAEoB,YAAY;aACnB;SACF,CAAC,CAAC;QACHW,SAAS,CAACM,GAAG,CAACjB,YAAY,CAAC,CAAC;IAC9B,CAAC,AAAC;IAEF,OAAO;QAAEJ,OAAO;QAAEC,SAAS;KAAE,CAAC;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/context/DatasourceStoreProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactNode, useCallback, useMemo } from 'react';\nimport {\n DashboardResource,\n DashboardSpec,\n Datasource,\n DatasourceSelector,\n DatasourceSpec,\n GlobalDatasource,\n useEvent,\n} from '@perses-dev/core';\nimport {\n DatasourceStoreContext,\n DatasourceStore,\n usePluginRegistry,\n DatasourceMetadata,\n DatasourceClient,\n} from '@perses-dev/plugin-system';\n\nexport interface DatasourceStoreProviderProps {\n dashboardResource?: DashboardResource;\n projectName?: string;\n datasourceApi: DatasourceApi;\n children?: ReactNode;\n onCreate?: (client: DatasourceClient) => DatasourceClient;\n}\n\n// The external API for fetching datasource resources\nexport interface DatasourceApi {\n getDatasource: (\n project: string,\n selector: DatasourceSelector\n ) => Promise<{ resource: Datasource; proxyUrl: string } | undefined>;\n\n getGlobalDatasource: (\n selector: DatasourceSelector\n ) => Promise<{ resource: GlobalDatasource; proxyUrl: string } | undefined>;\n\n listDatasources: (project: string, pluginKind?: string) => Promise<Datasource[]>;\n\n listGlobalDatasources: (pluginKind?: string) => Promise<GlobalDatasource[]>;\n}\n\n/**\n * A `DatasourceContext` provider that uses an external API to resolve datasource selectors.\n */\nexport function DatasourceStoreProvider(props: DatasourceStoreProviderProps) {\n const { dashboardResource, projectName, datasourceApi, onCreate, children } = props;\n const project = projectName ?? dashboardResource?.metadata.project;\n\n const { getPlugin, listPluginMetadata } = usePluginRegistry();\n\n const findDatasource = useEvent(async (selector: DatasourceSelector) => {\n // Try to find it in dashboard spec\n if (dashboardResource) {\n const { datasources } = dashboardResource.spec;\n const dashboardDatasource = findDashboardDatasource(datasources, selector);\n if (dashboardDatasource !== undefined) {\n return { spec: dashboardDatasource, proxyUrl: undefined };\n }\n }\n\n if (project) {\n // Try to find it at the project level as a Datasource resource\n const datasource = await datasourceApi.getDatasource(project, selector);\n if (datasource !== undefined) {\n return { spec: datasource.resource.spec, proxyUrl: datasource.proxyUrl };\n }\n }\n\n // Try to find it at the global level as a GlobalDatasource resource\n const globalDatasource = await datasourceApi.getGlobalDatasource(selector);\n if (globalDatasource !== undefined) {\n return { spec: globalDatasource.resource.spec, proxyUrl: globalDatasource.proxyUrl };\n }\n\n throw new Error(`No datasource found for kind '${selector.kind}' and name '${selector.name}'`);\n });\n\n // Gets a datasource spec for a given selector\n const getDatasource = useCallback(\n async (selector: DatasourceSelector): Promise<DatasourceSpec> => {\n const { spec } = await findDatasource(selector);\n return spec;\n },\n [findDatasource]\n );\n\n // Given a Datasource selector, finds the spec for it and then uses its corresponding plugin the create a client\n const getDatasourceClient = useCallback(\n async function getClient<Client extends DatasourceClient>(selector: DatasourceSelector): Promise<Client> {\n const { kind } = selector;\n const [{ spec, proxyUrl }, plugin] = await Promise.all([findDatasource(selector), getPlugin('Datasource', kind)]);\n\n // allows extending client\n const client = plugin.createClient(spec.plugin.spec, { proxyUrl }) as Client;\n if (onCreate !== undefined) {\n return onCreate(client) as Client;\n }\n return client;\n },\n [findDatasource, getPlugin, onCreate]\n );\n\n const listDatasourceMetadata = useEvent(async (datasourcePluginKind: string): Promise<DatasourceMetadata[]> => {\n const [pluginMetadata, datasources, globalDatasources] = await Promise.all([\n listPluginMetadata('Datasource'),\n project ? datasourceApi.listDatasources(project, datasourcePluginKind) : [],\n datasourceApi.listGlobalDatasources(datasourcePluginKind),\n ]);\n\n // Find the metadata for the plugin type they asked for so we can use it for the name of the default datasource\n const datasourcePluginMetadata = pluginMetadata.find((metadata) => metadata.kind === datasourcePluginKind);\n if (datasourcePluginMetadata === undefined) {\n throw new Error(`Could not find a Datasource plugin with kind '${datasourcePluginKind}'`);\n }\n\n // Get helper for de-duping results properly\n const { results, addResult } = buildListDatasourceMetadataResults(datasourcePluginMetadata.display.name);\n\n // Start with dashboard datasources that have highest precedence\n if (dashboardResource?.spec.datasources) {\n for (const selectorName in dashboardResource.spec.datasources) {\n const spec = dashboardResource.spec.datasources[selectorName];\n if (spec === undefined || spec.plugin.kind !== datasourcePluginKind) continue;\n addResult(spec, selectorName);\n }\n }\n\n // Now look at project-level datasources\n for (const datasource of datasources) {\n const selectorName = datasource.metadata.name;\n addResult(datasource.spec, selectorName);\n }\n\n // And finally global datasources\n for (const globalDatasource of globalDatasources) {\n const selectorName = globalDatasource.metadata.name;\n addResult(globalDatasource.spec, selectorName);\n }\n\n return results;\n });\n\n const ctxValue: DatasourceStore = useMemo(\n () => ({\n getDatasource,\n getDatasourceClient,\n listDatasourceMetadata,\n }),\n [getDatasource, getDatasourceClient, listDatasourceMetadata]\n );\n\n return <DatasourceStoreContext.Provider value={ctxValue}>{children}</DatasourceStoreContext.Provider>;\n}\n\n// Helper to find a datasource in the list embedded in a dashboard spec\nfunction findDashboardDatasource(dashboardDatasources: DashboardSpec['datasources'], selector: DatasourceSelector) {\n if (dashboardDatasources === undefined) return undefined;\n\n // If using a name in the selector...\n if (selector.name !== undefined) {\n const named = dashboardDatasources[selector.name];\n if (named === undefined) return undefined;\n return named.plugin.kind === selector.kind ? named : undefined;\n }\n\n // If only using a kind, try to find one with that kind that is the default\n return Object.values(dashboardDatasources).find((ds) => ds.plugin.kind === selector.kind && ds.default === true);\n}\n\n// Helper for building a list of DatasourceMetadata results that will take care of de-duping already used selectors\nfunction buildListDatasourceMetadataResults(pluginDisplayName: string) {\n const results: DatasourceMetadata[] = [];\n const usedNames = new Set<string>();\n let defaultAdded = false;\n const addResult = (spec: DatasourceSpec, selectorName: string) => {\n // If we haven't added a default yet and this is a default, add default option to the beginning of the results\n if (spec.default && defaultAdded === false) {\n results.unshift({\n name: `Default ${pluginDisplayName}`,\n selector: {\n kind: spec.plugin.kind,\n },\n });\n defaultAdded = true;\n }\n\n // If we already have a datasource with this selector name, ignore it, otherwise add to end of list\n if (usedNames.has(selectorName)) return;\n\n results.push({\n name: spec.display?.name ?? selectorName,\n selector: {\n kind: spec.plugin.kind,\n name: selectorName,\n },\n });\n usedNames.add(selectorName);\n };\n\n return { results, addResult };\n}\n"],"names":["useCallback","useMemo","useEvent","DatasourceStoreContext","usePluginRegistry","DatasourceStoreProvider","props","dashboardResource","projectName","datasourceApi","onCreate","children","project","metadata","getPlugin","listPluginMetadata","findDatasource","selector","datasources","spec","dashboardDatasource","findDashboardDatasource","undefined","proxyUrl","datasource","getDatasource","resource","globalDatasource","getGlobalDatasource","Error","kind","name","getDatasourceClient","getClient","plugin","Promise","all","client","createClient","listDatasourceMetadata","datasourcePluginKind","pluginMetadata","globalDatasources","listDatasources","listGlobalDatasources","datasourcePluginMetadata","find","results","addResult","buildListDatasourceMetadataResults","display","selectorName","ctxValue","Provider","value","dashboardDatasources","named","Object","values","ds","default","pluginDisplayName","usedNames","Set","defaultAdded","unshift","has","push","add"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAAoBA,WAAW,EAAEC,OAAO,QAAQ,OAAO,CAAC;AACxD,SAOEC,QAAQ,QACH,kBAAkB,CAAC;AAC1B,SACEC,sBAAsB,EAEtBC,iBAAiB,QAGZ,2BAA2B,CAAC;AA0BnC;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AAkB,GAAIgC,YAAY;YACxClC,QAAQ,EAAE;gBACRa,IAAI,EAAEX,IAAI,CAACe,MAAM,CAACJ,IAAI;gBACtBC,IAAI,EAAEoB,YAAY;aACnB;SACF,CAAC,CAAC;QACHW,SAAS,CAACM,GAAG,CAACjB,YAAY,CAAC,CAAC;IAC9B,CAAC,AAAC;IAEF,OAAO;QAAEJ,OAAO;QAAEC,SAAS;KAAE,CAAC;AAChC,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { useState } from 'react';
|
|
15
15
|
import { Box } from '@mui/material';
|
|
16
16
|
import { ErrorAlert, ErrorBoundary } from '@perses-dev/components';
|
|
17
|
-
import { PanelDrawer, Dashboard, PanelGroupDialog, DeletePanelGroupDialog,
|
|
17
|
+
import { PanelDrawer, Dashboard, PanelGroupDialog, DeletePanelGroupDialog, DashboardDiscardChangesConfirmationDialog, DashboardToolbar, DeletePanelDialog, EditJsonDialog, SaveChangesConfirmationDialog } from '../../components';
|
|
18
18
|
import { useDashboard, useDiscardChangesConfirmationDialog, useEditMode } from '../../context';
|
|
19
19
|
export const DashboardApp = (props)=>{
|
|
20
20
|
const { dashboardResource , dashboardTitleComponent , emptyDashboardProps , onSave , onDiscard , initialVariableIsSticky , isReadonly , } = props;
|
|
@@ -89,7 +89,7 @@ export const DashboardApp = (props)=>{
|
|
|
89
89
|
/*#__PURE__*/ _jsx(PanelGroupDialog, {}),
|
|
90
90
|
/*#__PURE__*/ _jsx(DeletePanelGroupDialog, {}),
|
|
91
91
|
/*#__PURE__*/ _jsx(DeletePanelDialog, {}),
|
|
92
|
-
/*#__PURE__*/ _jsx(
|
|
92
|
+
/*#__PURE__*/ _jsx(DashboardDiscardChangesConfirmationDialog, {}),
|
|
93
93
|
/*#__PURE__*/ _jsx(EditJsonDialog, {}),
|
|
94
94
|
/*#__PURE__*/ _jsx(SaveChangesConfirmationDialog, {})
|
|
95
95
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/ViewDashboard/DashboardApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Box } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport {\n PanelDrawer,\n Dashboard,\n PanelGroupDialog,\n DeletePanelGroupDialog,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/views/ViewDashboard/DashboardApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Box } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport {\n PanelDrawer,\n Dashboard,\n PanelGroupDialog,\n DeletePanelGroupDialog,\n DashboardDiscardChangesConfirmationDialog,\n DashboardToolbar,\n DeletePanelDialog,\n EmptyDashboardProps,\n EditJsonDialog,\n SaveChangesConfirmationDialog,\n} from '../../components';\nimport { OnSaveDashboard, useDashboard, useDiscardChangesConfirmationDialog, useEditMode } from '../../context';\n\nexport interface DashboardAppProps {\n emptyDashboardProps?: Partial<EmptyDashboardProps>;\n dashboardResource: DashboardResource;\n dashboardTitleComponent?: JSX.Element;\n onSave?: OnSaveDashboard;\n onDiscard?: (entity: DashboardResource) => void;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n}\n\nexport const DashboardApp = (props: DashboardAppProps) => {\n const {\n dashboardResource,\n dashboardTitleComponent,\n emptyDashboardProps,\n onSave,\n onDiscard,\n initialVariableIsSticky,\n isReadonly,\n } = props;\n const { setEditMode } = useEditMode();\n const { dashboard, setDashboard } = useDashboard();\n const [originalDashboard, setOriginalDashboard] = useState<DashboardResource | undefined>(undefined);\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleDiscardChanges = () => {\n // Reset to the original spec and exit edit mode\n if (originalDashboard) {\n setDashboard(originalDashboard);\n }\n setEditMode(false);\n closeDiscardChangesConfirmationDialog();\n if (onDiscard) {\n onDiscard(dashboard);\n }\n };\n\n const onEditButtonClick = () => {\n setEditMode(true);\n setOriginalDashboard(dashboard);\n };\n\n const onCancelButtonClick = () => {\n // check if dashboard has been modified\n if (JSON.stringify(dashboard) === JSON.stringify(originalDashboard)) {\n setEditMode(false);\n } else {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n handleDiscardChanges();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n });\n }\n };\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <DashboardToolbar\n dashboardName={dashboardResource.metadata.name}\n dashboardTitleComponent={dashboardTitleComponent}\n initialVariableIsSticky={initialVariableIsSticky}\n onSave={onSave}\n isReadonly={isReadonly}\n onEditButtonClick={onEditButtonClick}\n onCancelButtonClick={onCancelButtonClick}\n />\n <Box sx={{ padding: (theme) => theme.spacing(2), height: '100%' }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <Dashboard\n emptyDashboardProps={{\n onEditButtonClick,\n ...emptyDashboardProps,\n }}\n />\n </ErrorBoundary>\n <PanelDrawer />\n <PanelGroupDialog />\n <DeletePanelGroupDialog />\n <DeletePanelDialog />\n <DashboardDiscardChangesConfirmationDialog />\n <EditJsonDialog />\n <SaveChangesConfirmationDialog />\n </Box>\n </Box>\n );\n};\n"],"names":["useState","Box","ErrorAlert","ErrorBoundary","PanelDrawer","Dashboard","PanelGroupDialog","DeletePanelGroupDialog","DashboardDiscardChangesConfirmationDialog","DashboardToolbar","DeletePanelDialog","EditJsonDialog","SaveChangesConfirmationDialog","useDashboard","useDiscardChangesConfirmationDialog","useEditMode","DashboardApp","props","dashboardResource","dashboardTitleComponent","emptyDashboardProps","onSave","onDiscard","initialVariableIsSticky","isReadonly","setEditMode","dashboard","setDashboard","originalDashboard","setOriginalDashboard","undefined","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleDiscardChanges","onEditButtonClick","onCancelButtonClick","JSON","stringify","onDiscardChanges","onCancel","sx","flexGrow","overflowX","overflowY","display","flexDirection","dashboardName","metadata","name","padding","theme","spacing","height","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,QAAQ,QAAQ,OAAO,CAAC;AACjC,SAASC,GAAG,QAAQ,eAAe,CAAC;AACpC,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB,CAAC;AAEnE,SACEC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,sBAAsB,EACtBC,yCAAyC,EACzCC,gBAAgB,EAChBC,iBAAiB,EAEjBC,cAAc,EACdC,6BAA6B,QACxB,kBAAkB,CAAC;AAC1B,SAA0BC,YAAY,EAAEC,mCAAmC,EAAEC,WA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dev/dashboards",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "The dashboards feature in Perses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@perses-dev/components": "0.
|
|
33
|
-
"@perses-dev/core": "0.
|
|
34
|
-
"@perses-dev/plugin-system": "0.
|
|
32
|
+
"@perses-dev/components": "0.38.0",
|
|
33
|
+
"@perses-dev/core": "0.38.0",
|
|
34
|
+
"@perses-dev/plugin-system": "0.38.0",
|
|
35
35
|
"@types/react-grid-layout": "^1.3.2",
|
|
36
36
|
"date-fns": "^2.28.0",
|
|
37
37
|
"immer": "^9.0.15",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"zustand": "^4.3.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@perses-dev/internal-utils": "0.
|
|
48
|
-
"@perses-dev/storybook": "0.
|
|
47
|
+
"@perses-dev/internal-utils": "0.38.0",
|
|
48
|
+
"@perses-dev/storybook": "0.38.0",
|
|
49
49
|
"history": "^5.3.0",
|
|
50
50
|
"intersection-observer": "^0.12.2"
|
|
51
51
|
},
|