@perses-dev/dashboards 0.0.0-snapshot-color-palette-gen-test-0ebddd6 → 0.0.0-snapshot-saving-defaults-refinements-1b25cec
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/DashboardStickyToolbar/DashboardStickyToolbar.js +79 -0
- package/dist/cjs/{stories/decorators/WithQueryParams.js → components/DashboardStickyToolbar/index.js} +11 -12
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +8 -24
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +1 -0
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +5 -0
- package/dist/cjs/components/GridLayout/GridItemContent.js +22 -4
- package/dist/cjs/components/GridLayout/GridLayout.js +31 -2
- package/dist/cjs/components/GridLayout/GridTitle.js +30 -9
- package/dist/cjs/components/Panel/Panel.js +2 -2
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +41 -34
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +32 -18
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +87 -0
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +92 -0
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +28 -0
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +81 -0
- package/dist/cjs/components/SaveDashboardButton/index.js +28 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +5 -5
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +124 -198
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +178 -0
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
- package/dist/cjs/components/Variables/VariableList.js +16 -55
- package/dist/cjs/components/Variables/index.js +1 -0
- package/dist/cjs/components/index.js +3 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +9 -8
- package/dist/cjs/context/DashboardProvider/common.js +26 -6
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +13 -4
- package/dist/cjs/context/DashboardProvider/index.js +1 -0
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +8 -32
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +33 -0
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +56 -7
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +2 -0
- package/dist/cjs/context/TemplateVariableProvider/utils.js +44 -0
- package/dist/cjs/context/useDashboard.js +4 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +2 -47
- package/dist/cjs/stories/decorators/index.js +0 -4
- package/dist/cjs/test/datasource-provider.js +70 -0
- package/dist/cjs/test/index.js +1 -0
- package/dist/cjs/test/plugin-registry.js +11 -5
- package/dist/cjs/test/render.js +35 -13
- package/dist/cjs/test/testDashboard.js +79 -79
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/{stories/decorators/WithQueryClient.js → utils/time.js} +9 -11
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +2 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +9 -0
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -0
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +68 -0
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -0
- package/dist/components/DashboardStickyToolbar/index.d.ts +2 -0
- package/dist/components/DashboardStickyToolbar/index.d.ts.map +1 -0
- package/dist/{stories/decorators/WithQueryClient.js → components/DashboardStickyToolbar/index.js} +2 -10
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +10 -26
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +1 -0
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +5 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -0
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +22 -4
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +31 -2
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +30 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +1 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +3 -3
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +42 -35
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +32 -18
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +15 -0
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -0
- package/dist/components/PanelDrawer/usePanelEditor.js +84 -0
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -0
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +3 -0
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -0
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +86 -0
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -0
- package/dist/components/SaveChangesConfirmationDialog/index.d.ts +2 -0
- package/dist/components/SaveChangesConfirmationDialog/index.d.ts.map +1 -0
- package/dist/{stories/decorators/WithQueryParams.js → components/SaveChangesConfirmationDialog/index.js} +2 -10
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -0
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +10 -0
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -0
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +75 -0
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -0
- package/dist/components/SaveDashboardButton/index.d.ts +2 -0
- package/dist/components/SaveDashboardButton/index.d.ts.map +1 -0
- package/dist/components/SaveDashboardButton/index.js +15 -0
- package/dist/components/SaveDashboardButton/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +6 -6
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -2
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +127 -196
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +16 -0
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +122 -0
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +1 -7
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +18 -52
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +4 -3
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +9 -8
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -0
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js +17 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +6 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +11 -3
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/index.d.ts +1 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js +1 -0
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +3 -6
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +9 -33
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.d.ts +15 -0
- package/dist/context/DashboardProvider/save-changes-dialog-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js +27 -0
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +10 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +51 -7
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +2 -0
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts +7 -0
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/utils.js +40 -0
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -0
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +4 -4
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -46
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/index.js +0 -4
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +6 -0
- package/dist/test/datasource-provider.d.ts.map +1 -0
- package/dist/test/datasource-provider.js +60 -0
- package/dist/test/datasource-provider.js.map +1 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -0
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +11 -5
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +35 -13
- package/dist/test/render.js.map +1 -1
- package/dist/test/testDashboard.js +79 -79
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +23 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +3 -2
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/package.json +7 -6
- package/dist/cjs/stories/decorators/WithPluginRegistry.js +0 -91
- package/dist/cjs/stories/decorators/WithTimeRange.js +0 -38
- package/dist/stories/decorators/WithPluginRegistry.js +0 -46
- package/dist/stories/decorators/WithPluginRegistry.js.map +0 -1
- package/dist/stories/decorators/WithQueryClient.js.map +0 -1
- package/dist/stories/decorators/WithQueryParams.js.map +0 -1
- package/dist/stories/decorators/WithTimeRange.js +0 -32
- package/dist/stories/decorators/WithTimeRange.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
prometheusDemoUrl: ()=>prometheusDemoUrl,
|
|
25
|
+
prometheusDemo: ()=>prometheusDemo,
|
|
26
|
+
defaultDatasourceProps: ()=>defaultDatasourceProps
|
|
27
|
+
});
|
|
28
|
+
const _dashboardProvider = require("./dashboard-provider");
|
|
29
|
+
const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';
|
|
30
|
+
const prometheusDemo = {
|
|
31
|
+
kind: 'GlobalDatasource',
|
|
32
|
+
metadata: {
|
|
33
|
+
name: 'PrometheusDemo',
|
|
34
|
+
created_at: '0001-01-01T00:00:00Z',
|
|
35
|
+
updated_at: '0001-01-01T00:00:00Z',
|
|
36
|
+
version: 0
|
|
37
|
+
},
|
|
38
|
+
spec: {
|
|
39
|
+
default: true,
|
|
40
|
+
plugin: {
|
|
41
|
+
kind: 'PrometheusDatasource',
|
|
42
|
+
spec: {
|
|
43
|
+
direct_url: prometheusDemoUrl
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const defaultDatasourceProps = {
|
|
49
|
+
dashboardResource: (0, _dashboardProvider.getTestDashboard)(),
|
|
50
|
+
datasourceApi: {
|
|
51
|
+
getDatasource: ()=>{
|
|
52
|
+
return Promise.resolve(undefined);
|
|
53
|
+
},
|
|
54
|
+
getGlobalDatasource: (selector)=>{
|
|
55
|
+
if (selector.kind === 'PrometheusDatasource') {
|
|
56
|
+
return Promise.resolve({
|
|
57
|
+
resource: prometheusDemo,
|
|
58
|
+
proxyUrl: prometheusDemoUrl
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return Promise.resolve(undefined);
|
|
62
|
+
},
|
|
63
|
+
listDatasources: ()=>{
|
|
64
|
+
return Promise.resolve([]);
|
|
65
|
+
},
|
|
66
|
+
listGlobalDatasources: ()=>{
|
|
67
|
+
return Promise.resolve([]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
package/dist/cjs/test/index.js
CHANGED
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_exportStar(require("./dashboard-provider"), exports);
|
|
18
|
+
_exportStar(require("./datasource-provider"), exports);
|
|
18
19
|
_exportStar(require("./plugin-registry"), exports);
|
|
19
20
|
_exportStar(require("./render"), exports);
|
|
20
21
|
function _exportStar(from, to) {
|
|
@@ -19,17 +19,23 @@ Object.defineProperty(exports, "MOCK_PLUGINS", {
|
|
|
19
19
|
get: ()=>MOCK_PLUGINS
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const FakeTimeSeriesChartOptionEditor = ()=>{
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
24
|
+
children: "TimeSeriesChart options"
|
|
25
|
+
});
|
|
26
|
+
};
|
|
22
27
|
const FakeTimeSeriesPlugin = {
|
|
23
28
|
PanelComponent: ()=>{
|
|
24
29
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
25
30
|
children: "TimeSeriesChart panel"
|
|
26
31
|
});
|
|
27
32
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
panelOptionsEditorComponents: [
|
|
34
|
+
{
|
|
35
|
+
label: 'Settings',
|
|
36
|
+
content: FakeTimeSeriesChartOptionEditor
|
|
37
|
+
}
|
|
38
|
+
],
|
|
33
39
|
createInitialOptions: ()=>({})
|
|
34
40
|
};
|
|
35
41
|
const MOCK_TIME_SERIES_PANEL = {
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -19,7 +19,8 @@ Object.defineProperty(exports, "renderWithContext", {
|
|
|
19
19
|
get: ()=>renderWithContext
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _react = require("
|
|
22
|
+
const _react = require("react");
|
|
23
|
+
const _react1 = require("@testing-library/react");
|
|
23
24
|
const _reactRouterDom = require("react-router-dom");
|
|
24
25
|
const _history = require("history");
|
|
25
26
|
const _useQueryParams = require("use-query-params");
|
|
@@ -28,6 +29,24 @@ const _reactQuery = require("@tanstack/react-query");
|
|
|
28
29
|
const _components = require("@perses-dev/components");
|
|
29
30
|
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
30
31
|
const _pluginRegistry = require("./plugin-registry");
|
|
32
|
+
/*
|
|
33
|
+
* Workaround for React router upgrade type errors.
|
|
34
|
+
* More details: https://stackoverflow.com/a/69948457/17575201
|
|
35
|
+
*/ const CustomRouter = ({ history , children })=>{
|
|
36
|
+
const [state, setState] = (0, _react.useState)({
|
|
37
|
+
action: history.action,
|
|
38
|
+
location: history.location
|
|
39
|
+
});
|
|
40
|
+
(0, _react.useLayoutEffect)(()=>history.listen(setState), [
|
|
41
|
+
history
|
|
42
|
+
]);
|
|
43
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactRouterDom.Router, {
|
|
44
|
+
location: state.location,
|
|
45
|
+
navigationType: state.action,
|
|
46
|
+
navigator: history,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
};
|
|
31
50
|
function renderWithContext(ui, options, history) {
|
|
32
51
|
// Create a new QueryClient for each test to avoid caching issues
|
|
33
52
|
const queryClient = new _reactQuery.QueryClient({
|
|
@@ -38,25 +57,28 @@ function renderWithContext(ui, options, history) {
|
|
|
38
57
|
}
|
|
39
58
|
}
|
|
40
59
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(HistoryRouter, {
|
|
45
|
-
history: history,
|
|
60
|
+
const customHistory = history !== null && history !== void 0 ? history : (0, _history.createMemoryHistory)();
|
|
61
|
+
const BaseRender = ()=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(CustomRouter, {
|
|
62
|
+
history: customHistory,
|
|
46
63
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactQuery.QueryClientProvider, {
|
|
47
64
|
client: queryClient,
|
|
48
65
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_useQueryParams.QueryParamProvider, {
|
|
49
66
|
adapter: _reactRouter6.ReactRouter6Adapter,
|
|
50
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.SnackbarProvider, {
|
|
68
|
+
anchorOrigin: {
|
|
69
|
+
vertical: 'bottom',
|
|
70
|
+
horizontal: 'right'
|
|
71
|
+
},
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ChartsThemeProvider, {
|
|
73
|
+
chartsTheme: _components.testChartsTheme,
|
|
74
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.PluginRegistry, {
|
|
75
|
+
...(0, _pluginSystem.mockPluginRegistry)(..._pluginRegistry.MOCK_PLUGINS),
|
|
76
|
+
children: ui
|
|
77
|
+
})
|
|
55
78
|
})
|
|
56
79
|
})
|
|
57
80
|
})
|
|
58
81
|
})
|
|
59
82
|
});
|
|
60
|
-
};
|
|
61
|
-
return (0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(BaseRender, {}), options);
|
|
83
|
+
return (0, _react1.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(BaseRender, {}), options);
|
|
62
84
|
}
|
|
@@ -62,24 +62,24 @@ const testDashboard = {
|
|
|
62
62
|
plugin: {
|
|
63
63
|
kind: 'TimeSeriesChart',
|
|
64
64
|
spec: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
unit: {
|
|
66
|
+
kind: '%'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
queries: [
|
|
71
|
+
{
|
|
72
|
+
kind: 'TimeSeriesQuery',
|
|
73
|
+
spec: {
|
|
74
|
+
plugin: {
|
|
75
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
68
76
|
spec: {
|
|
69
|
-
|
|
70
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
71
|
-
spec: {
|
|
72
|
-
query: 'avg without (cpu)(rate(node_cpu_seconds_total{job="node",instance="$instance",mode!="idle"}[$interval]))'
|
|
73
|
-
}
|
|
74
|
-
}
|
|
77
|
+
query: 'avg without (cpu)(rate(node_cpu_seconds_total{job="node",instance="$instance",mode!="idle"}[$interval]))'
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
],
|
|
78
|
-
unit: {
|
|
79
|
-
kind: '%'
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
]
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
memory: {
|
|
@@ -91,57 +91,57 @@ const testDashboard = {
|
|
|
91
91
|
plugin: {
|
|
92
92
|
kind: 'TimeSeriesChart',
|
|
93
93
|
spec: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
unit: {
|
|
95
|
+
kind: 'Bytes'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
queries: [
|
|
100
|
+
{
|
|
101
|
+
kind: 'TimeSeriesQuery',
|
|
102
|
+
spec: {
|
|
103
|
+
plugin: {
|
|
104
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
97
105
|
spec: {
|
|
98
|
-
|
|
99
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
100
|
-
spec: {
|
|
101
|
-
query: 'node_memory_MemTotal_bytes{job="node",instance="$instance"} - node_memory_MemFree_bytes{job="node",instance="$instance"} - node_memory_Buffers_bytes{job="node",instance="$instance"} - node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
102
|
-
}
|
|
103
|
-
}
|
|
106
|
+
query: 'node_memory_MemTotal_bytes{job="node",instance="$instance"} - node_memory_MemFree_bytes{job="node",instance="$instance"} - node_memory_Buffers_bytes{job="node",instance="$instance"} - node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
104
107
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
kind: 'TimeSeriesQuery',
|
|
113
|
+
spec: {
|
|
114
|
+
plugin: {
|
|
115
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
108
116
|
spec: {
|
|
109
|
-
|
|
110
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
111
|
-
spec: {
|
|
112
|
-
query: 'node_memory_Buffers_bytes{job="node",instance="$instance"}'
|
|
113
|
-
}
|
|
114
|
-
}
|
|
117
|
+
query: 'node_memory_Buffers_bytes{job="node",instance="$instance"}'
|
|
115
118
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
kind: 'TimeSeriesQuery',
|
|
124
|
+
spec: {
|
|
125
|
+
plugin: {
|
|
126
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
119
127
|
spec: {
|
|
120
|
-
|
|
121
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
122
|
-
spec: {
|
|
123
|
-
query: 'node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
124
|
-
}
|
|
125
|
-
}
|
|
128
|
+
query: 'node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
126
129
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
kind: 'TimeSeriesQuery',
|
|
135
|
+
spec: {
|
|
136
|
+
plugin: {
|
|
137
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
130
138
|
spec: {
|
|
131
|
-
|
|
132
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
133
|
-
spec: {
|
|
134
|
-
query: 'node_memory_MemFree_bytes{job="node",instance="$instance"}'
|
|
135
|
-
}
|
|
136
|
-
}
|
|
139
|
+
query: 'node_memory_MemFree_bytes{job="node",instance="$instance"}'
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
|
-
],
|
|
140
|
-
unit: {
|
|
141
|
-
kind: 'Bytes'
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
]
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
// This panel is referenced in more than one layout below
|
|
@@ -154,24 +154,24 @@ const testDashboard = {
|
|
|
154
154
|
plugin: {
|
|
155
155
|
kind: 'TimeSeriesChart',
|
|
156
156
|
spec: {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
unit: {
|
|
158
|
+
kind: 'Percent'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
queries: [
|
|
163
|
+
{
|
|
164
|
+
kind: 'TimeSeriesQuery',
|
|
165
|
+
spec: {
|
|
166
|
+
plugin: {
|
|
167
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
160
168
|
spec: {
|
|
161
|
-
|
|
162
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
163
|
-
spec: {
|
|
164
|
-
query: 'rate(node_disk_io_time_seconds_total{job="node",instance="$instance",device!~"^(md\\\\d+$|dm-)"}[$interval])'
|
|
165
|
-
}
|
|
166
|
-
}
|
|
169
|
+
query: 'rate(node_disk_io_time_seconds_total{job="node",instance="$instance",device!~"^(md\\\\d+$|dm-)"}[$interval])'
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
],
|
|
170
|
-
unit: {
|
|
171
|
-
kind: 'Percent'
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
]
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
177
|
filesystemFullness: {
|
|
@@ -183,24 +183,24 @@ const testDashboard = {
|
|
|
183
183
|
plugin: {
|
|
184
184
|
kind: 'TimeSeriesChart',
|
|
185
185
|
spec: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
unit: {
|
|
187
|
+
kind: 'Percent'
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
queries: [
|
|
192
|
+
{
|
|
193
|
+
kind: 'TimeSeriesQuery',
|
|
194
|
+
spec: {
|
|
195
|
+
plugin: {
|
|
196
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
189
197
|
spec: {
|
|
190
|
-
|
|
191
|
-
kind: 'PrometheusTimeSeriesQuery',
|
|
192
|
-
spec: {
|
|
193
|
-
query: '1 - node_filesystem_free_bytes{job="node",instance="$instance",fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} / node_filesystem_size_bytes{job="node",instance="$instance"}'
|
|
194
|
-
}
|
|
195
|
-
}
|
|
198
|
+
query: '1 - node_filesystem_free_bytes{job="node",instance="$instance",fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} / node_filesystem_size_bytes{job="node",instance="$instance"}'
|
|
196
199
|
}
|
|
197
200
|
}
|
|
198
|
-
],
|
|
199
|
-
unit: {
|
|
200
|
-
kind: 'Percent'
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
]
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
},
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_exportStar(require("./panelUtils"), exports);
|
|
18
|
+
_exportStar(require("./time"), exports);
|
|
18
19
|
function _exportStar(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
@@ -14,16 +14,14 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "useSuggestedStepMs", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()=>
|
|
19
|
+
get: ()=>useSuggestedStepMs
|
|
20
20
|
});
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
};
|
|
21
|
+
const _core = require("@perses-dev/core");
|
|
22
|
+
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
23
|
+
function useSuggestedStepMs(width) {
|
|
24
|
+
const { absoluteTimeRange } = (0, _pluginSystem.useTimeRange)();
|
|
25
|
+
if (width === undefined) return 0;
|
|
26
|
+
return (0, _core.getSuggestedStepMs)(absoluteTimeRange, width);
|
|
27
|
+
}
|
|
@@ -98,7 +98,8 @@ const DashboardApp = (props)=>{
|
|
|
98
98
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DeletePanelGroupDialog, {}),
|
|
99
99
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DeletePanelDialog, {}),
|
|
100
100
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DiscardChangesConfirmationDialog, {}),
|
|
101
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.EditJsonDialog, {})
|
|
101
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.EditJsonDialog, {}),
|
|
102
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.SaveChangesConfirmationDialog, {})
|
|
102
103
|
]
|
|
103
104
|
})
|
|
104
105
|
]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface DashboardStickyToolbarProps {
|
|
4
|
+
initialVariableIsSticky?: boolean;
|
|
5
|
+
sx?: SxProps<Theme>;
|
|
6
|
+
}
|
|
7
|
+
export declare function DashboardStickyToolbar(props: DashboardStickyToolbarProps): JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=DashboardStickyToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardStickyToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA2B,OAAO,EAAE,KAAK,EAAoB,MAAM,eAAe,CAAC;AAM1F,UAAU,2BAA2B;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,eAgCxE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { AppBar, Box, IconButton, useScrollTrigger } from '@mui/material';
|
|
16
|
+
import PinOutline from 'mdi-material-ui/PinOutline';
|
|
17
|
+
import PinOffOutline from 'mdi-material-ui/PinOffOutline';
|
|
18
|
+
import { TemplateVariableList } from '../Variables';
|
|
19
|
+
import { TimeRangeControls } from '../TimeRangeControls';
|
|
20
|
+
export function DashboardStickyToolbar(props) {
|
|
21
|
+
const [isPin, setIsPin] = useState(props.initialVariableIsSticky);
|
|
22
|
+
const scrollTrigger = useScrollTrigger({
|
|
23
|
+
disableHysteresis: true
|
|
24
|
+
});
|
|
25
|
+
const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
|
|
26
|
+
return(// marginBottom={-1} counteracts the marginBottom={1} on every variable input.
|
|
27
|
+
// The margin on the inputs is for spacing between inputs, but is not meant to add space to bottom of the container.
|
|
28
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
29
|
+
marginBottom: -1,
|
|
30
|
+
"data-testid": "variable-list",
|
|
31
|
+
children: /*#__PURE__*/ _jsx(AppBar, {
|
|
32
|
+
color: "inherit",
|
|
33
|
+
position: isSticky ? 'fixed' : 'static',
|
|
34
|
+
elevation: isSticky ? 4 : 0,
|
|
35
|
+
sx: {
|
|
36
|
+
backgroundColor: 'inherit',
|
|
37
|
+
...props.sx
|
|
38
|
+
},
|
|
39
|
+
children: /*#__PURE__*/ _jsxs(Box, {
|
|
40
|
+
display: "flex",
|
|
41
|
+
justifyContent: "space-between",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexWrap: "wrap",
|
|
46
|
+
alignItems: "start",
|
|
47
|
+
my: isSticky ? 2 : 0,
|
|
48
|
+
ml: isSticky ? 2 : 0,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsx(TemplateVariableList, {}),
|
|
51
|
+
props.initialVariableIsSticky && /*#__PURE__*/ _jsx(IconButton, {
|
|
52
|
+
onClick: ()=>setIsPin(!isPin),
|
|
53
|
+
children: isPin ? /*#__PURE__*/ _jsx(PinOutline, {}) : /*#__PURE__*/ _jsx(PinOffOutline, {})
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
isSticky && /*#__PURE__*/ _jsx(Box, {
|
|
58
|
+
my: 2,
|
|
59
|
+
mr: 2,
|
|
60
|
+
children: /*#__PURE__*/ _jsx(TimeRangeControls, {})
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=DashboardStickyToolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.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 { AppBar, Box, IconButton, SxProps, Theme, useScrollTrigger } from '@mui/material';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport PinOffOutline from 'mdi-material-ui/PinOffOutline';\nimport { TemplateVariableList } from '../Variables';\nimport { TimeRangeControls } from '../TimeRangeControls';\n\ninterface DashboardStickyToolbarProps {\n initialVariableIsSticky?: boolean;\n sx?: SxProps<Theme>;\n}\n\nexport function DashboardStickyToolbar(props: DashboardStickyToolbarProps) {\n const [isPin, setIsPin] = useState(props.initialVariableIsSticky);\n\n const scrollTrigger = useScrollTrigger({ disableHysteresis: true });\n const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;\n\n return (\n // marginBottom={-1} counteracts the marginBottom={1} on every variable input.\n // The margin on the inputs is for spacing between inputs, but is not meant to add space to bottom of the container.\n <Box marginBottom={-1} data-testid=\"variable-list\">\n <AppBar\n color=\"inherit\"\n position={isSticky ? 'fixed' : 'static'}\n elevation={isSticky ? 4 : 0}\n sx={{ backgroundColor: 'inherit', ...props.sx }}\n >\n <Box display=\"flex\" justifyContent=\"space-between\">\n <Box display=\"flex\" flexWrap=\"wrap\" alignItems=\"start\" my={isSticky ? 2 : 0} ml={isSticky ? 2 : 0}>\n <TemplateVariableList></TemplateVariableList>\n {props.initialVariableIsSticky && (\n <IconButton onClick={() => setIsPin(!isPin)}>{isPin ? <PinOutline /> : <PinOffOutline />}</IconButton>\n )}\n </Box>\n {isSticky && (\n <Box my={2} mr={2}>\n <TimeRangeControls></TimeRangeControls>\n </Box>\n )}\n </Box>\n </AppBar>\n </Box>\n );\n}\n"],"names":["useState","AppBar","Box","IconButton","useScrollTrigger","PinOutline","PinOffOutline","TemplateVariableList","TimeRangeControls","DashboardStickyToolbar","props","isPin","setIsPin","initialVariableIsSticky","scrollTrigger","disableHysteresis","isSticky","marginBottom","data-testid","color","position","elevation","sx","backgroundColor","display","justifyContent","flexWrap","alignItems","my","ml","onClick","mr"],"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,MAAM,EAAEC,GAAG,EAAEC,UAAU,EAAkBC,gBAAgB,QAAQ,eAAe,CAAC;AAC1F,OAAOC,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAOC,aAAa,MAAM,+BAA+B,CAAC;AAC1D,SAASC,oBAAoB,QAAQ,cAAc,CAAC;AACpD,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AAOzD,OAAO,SAASC,sBAAsB,CAACC,KAAkC,EAAE;IACzE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAACU,KAAK,CAACG,uBAAuB,CAAC,AAAC;IAElE,MAAMC,aAAa,GAAGV,gBAAgB,CAAC;QAAEW,iBAAiB,EAAE,IAAI;KAAE,CAAC,AAAC;IACpE,MAAMC,QAAQ,GAAGF,aAAa,IAAIJ,KAAK,CAACG,uBAAuB,IAAIF,KAAK,AAAC;IAEzE,OACE,8EAA8E;IAC9E,oHAAoH;kBACpH,KAACT,GAAG;QAACe,YAAY,EAAE,CAAC,CAAC;QAAEC,aAAW,EAAC,eAAe;kBAChD,cAAA,KAACjB,MAAM;YACLkB,KAAK,EAAC,SAAS;YACfC,QAAQ,EAAEJ,QAAQ,GAAG,OAAO,GAAG,QAAQ;YACvCK,SAAS,EAAEL,QAAQ,GAAG,CAAC,GAAG,CAAC;YAC3BM,EAAE,EAAE;gBAAEC,eAAe,EAAE,SAAS;gBAAE,GAAGb,KAAK,CAACY,EAAE;aAAE;sBAE/C,cAAA,MAACpB,GAAG;gBAACsB,OAAO,EAAC,MAAM;gBAACC,cAAc,EAAC,eAAe;;kCAChD,MAACvB,GAAG;wBAACsB,OAAO,EAAC,MAAM;wBAACE,QAAQ,EAAC,MAAM;wBAACC,UAAU,EAAC,OAAO;wBAACC,EAAE,EAAEZ,QAAQ,GAAG,CAAC,GAAG,CAAC;wBAAEa,EAAE,EAAEb,QAAQ,GAAG,CAAC,GAAG,CAAC;;0CAC/F,KAACT,oBAAoB,KAAwB;4BAC5CG,KAAK,CAACG,uBAAuB,kBAC5B,KAACV,UAAU;gCAAC2B,OAAO,EAAE,IAAMlB,QAAQ,CAAC,CAACD,KAAK,CAAC;0CAAGA,KAAK,iBAAG,KAACN,UAAU,KAAG,iBAAG,KAACC,aAAa,KAAG;8BAAc,AACvG;;sBACG;oBACLU,QAAQ,kBACP,KAACd,GAAG;wBAAC0B,EAAE,EAAE,CAAC;wBAAEG,EAAE,EAAE,CAAC;kCACf,cAAA,KAACvB,iBAAiB,KAAqB;sBACnC,AACP;;cACG;UACC;MACL,EACN;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC"}
|
package/dist/{stories/decorators/WithQueryClient.js → components/DashboardStickyToolbar/index.js}
RENAMED
|
@@ -10,14 +10,6 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
|
|
14
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
15
|
-
export const WithQueryClient = (Story)=>{
|
|
16
|
-
const queryClient = new QueryClient({});
|
|
17
|
-
return /*#__PURE__*/ _jsx(QueryClientProvider, {
|
|
18
|
-
client: queryClient,
|
|
19
|
-
children: /*#__PURE__*/ _jsx(Story, {})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
13
|
+
export * from './DashboardStickyToolbar';
|
|
22
14
|
|
|
23
|
-
//# sourceMappingURL=
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DashboardStickyToolbar/index.ts"],"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 './DashboardStickyToolbar';\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,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { OnSaveDashboard } from '../../context';
|
|
3
3
|
export interface DashboardToolbarProps {
|
|
4
4
|
dashboardName: string;
|
|
5
5
|
dashboardTitleComponent?: JSX.Element;
|
|
@@ -7,7 +7,7 @@ export interface DashboardToolbarProps {
|
|
|
7
7
|
isReadonly: boolean;
|
|
8
8
|
onEditButtonClick: () => void;
|
|
9
9
|
onCancelButtonClick: () => void;
|
|
10
|
-
onSave?:
|
|
10
|
+
onSave?: OnSaveDashboard;
|
|
11
11
|
}
|
|
12
12
|
export declare const DashboardToolbar: (props: DashboardToolbarProps) => JSX.Element;
|
|
13
13
|
//# sourceMappingURL=DashboardToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,eAAe,EAAe,MAAM,eAAe,CAAC;AAW7D,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,gBA+G5D,CAAC"}
|