@perses-dev/dashboards 0.44.0 → 0.45.0-rc1
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 +2 -2
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +3 -3
- package/dist/cjs/components/DownloadButton/DownloadButton.js +1 -2
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +1 -2
- package/dist/cjs/components/GridLayout/GridItemContent.js +1 -2
- package/dist/cjs/components/GridLayout/GridLayout.js +1 -1
- package/dist/cjs/components/GridLayout/GridTitle.js +0 -1
- package/dist/cjs/components/Panel/Panel.js +1 -0
- package/dist/cjs/components/Panel/PanelHeader.js +5 -1
- package/dist/cjs/components/Panel/PanelLinks.js +137 -0
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +32 -8
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -2
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/user-interface-text.js +0 -2
- package/dist/cjs/context/DatasourceStoreProvider.js +3 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/validation/panel.js +12 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +1 -2
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +1 -2
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +1 -2
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +1 -1
- 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 +0 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +1 -0
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +5 -3
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +8 -4
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +5 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +124 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +34 -10
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +1 -2
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +1 -0
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +0 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +0 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +3 -1
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/validation/panel.d.ts +51 -3
- package/dist/validation/panel.d.ts.map +1 -1
- package/dist/validation/panel.js +12 -2
- package/dist/validation/panel.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -216
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -13
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -192
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js +0 -15
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -23
- package/dist/utils/time.js.map +0 -1
|
@@ -25,8 +25,8 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _PinOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOutline"));
|
|
27
27
|
const _PinOffOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOffOutline"));
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
29
|
const _Variables = require("../Variables");
|
|
29
|
-
const _TimeRangeControls = require("../TimeRangeControls");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
@@ -101,7 +101,7 @@ function DashboardStickyToolbar(props) {
|
|
|
101
101
|
ml: isBiggerThanMd ? 1.5 : 'auto',
|
|
102
102
|
direction: "row",
|
|
103
103
|
justifyContent: "end",
|
|
104
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
104
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeControls, {})
|
|
105
105
|
})
|
|
106
106
|
]
|
|
107
107
|
})
|
|
@@ -23,11 +23,11 @@ Object.defineProperty(exports, "DashboardToolbar", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
27
|
const _context = require("../../context");
|
|
27
28
|
const _AddPanelButton = require("../AddPanelButton");
|
|
28
29
|
const _AddGroupButton = require("../AddGroupButton");
|
|
29
30
|
const _DownloadButton = require("../DownloadButton");
|
|
30
|
-
const _TimeRangeControls = require("../TimeRangeControls");
|
|
31
31
|
const _Variables = require("../Variables");
|
|
32
32
|
const _Datasources = require("../Datasources");
|
|
33
33
|
const _EditButton = require("../EditButton");
|
|
@@ -63,7 +63,7 @@ const DashboardToolbar = (props)=>{
|
|
|
63
63
|
ml: "auto",
|
|
64
64
|
children: [
|
|
65
65
|
isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
|
|
66
|
-
severity:
|
|
66
|
+
severity: "warning",
|
|
67
67
|
sx: {
|
|
68
68
|
backgroundColor: 'transparent',
|
|
69
69
|
padding: 0
|
|
@@ -138,7 +138,7 @@ const DashboardToolbar = (props)=>{
|
|
|
138
138
|
mt: 1,
|
|
139
139
|
ml: 1,
|
|
140
140
|
children: [
|
|
141
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
141
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeControls, {}),
|
|
142
142
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DownloadButton.DownloadButton, {}),
|
|
143
143
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_EditJsonButton.EditJsonButton, {
|
|
144
144
|
isReadonly: !isEditMode
|
|
@@ -26,7 +26,6 @@ const _DownloadOutline = /*#__PURE__*/ _interop_require_default(require("mdi-mat
|
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
27
|
const _constants = require("../../constants");
|
|
28
28
|
const _context = require("../../context");
|
|
29
|
-
const _ToolbarIconButton = require("../ToolbarIconButton");
|
|
30
29
|
function _interop_require_default(obj) {
|
|
31
30
|
return obj && obj.__esModule ? obj : {
|
|
32
31
|
default: obj
|
|
@@ -54,7 +53,7 @@ function DownloadButton({ heightPx }) {
|
|
|
54
53
|
children: [
|
|
55
54
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
56
55
|
description: _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
57
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
58
57
|
"aria-label": _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
59
58
|
onClick: onDownloadButtonClick,
|
|
60
59
|
sx: {
|
|
@@ -24,7 +24,6 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _CodeBraces = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/CodeBraces"));
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
26
|
const _constants = require("../../constants");
|
|
27
|
-
const _ToolbarIconButton = require("../ToolbarIconButton");
|
|
28
27
|
const _context = require("../../context");
|
|
29
28
|
function _interop_require_default(obj) {
|
|
30
29
|
return obj && obj.__esModule ? obj : {
|
|
@@ -37,7 +36,7 @@ const EditJsonButton = (props)=>{
|
|
|
37
36
|
const info = isReadonly ? _constants.TOOLTIP_TEXT.viewJson : _constants.TOOLTIP_TEXT.editJson;
|
|
38
37
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
39
38
|
description: info,
|
|
40
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
39
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
41
40
|
"aria-label": info,
|
|
42
41
|
variant: "outlined",
|
|
43
42
|
onClick: ()=>openEditJsonDialog(),
|
|
@@ -25,7 +25,6 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _reactintersectionobserver = require("react-intersection-observer");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _context = require("../../context");
|
|
28
|
-
const _utils = require("../../utils");
|
|
29
28
|
const _Panel = require("../Panel/Panel");
|
|
30
29
|
function GridItemContent(props) {
|
|
31
30
|
const { panelGroupItemId, width } = props;
|
|
@@ -48,7 +47,7 @@ function GridItemContent(props) {
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
51
|
-
const suggestedStepMs = (0,
|
|
50
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
52
51
|
const queryDefinitions = queries !== null && queries !== void 0 ? queries : [];
|
|
53
52
|
const definitions = queryDefinitions.map((query)=>{
|
|
54
53
|
return {
|
|
@@ -84,6 +84,7 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
84
84
|
title: definition.spec.display.name,
|
|
85
85
|
description: definition.spec.display.description,
|
|
86
86
|
editHandlers: editHandlers,
|
|
87
|
+
links: definition.spec.links,
|
|
87
88
|
sx: {
|
|
88
89
|
paddingX: `${chartsTheme.container.padding.default}px`
|
|
89
90
|
}
|
|
@@ -30,12 +30,13 @@ const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-materi
|
|
|
30
30
|
const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
|
|
31
31
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
32
32
|
const _constants = require("../../constants");
|
|
33
|
+
const _PanelLinks = require("./PanelLinks");
|
|
33
34
|
function _interop_require_default(obj) {
|
|
34
35
|
return obj && obj.__esModule ? obj : {
|
|
35
36
|
default: obj
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
function PanelHeader({ id, title: rawTitle, description: rawDescription, editHandlers, sx, extra, ...rest }) {
|
|
39
|
+
function PanelHeader({ id, title: rawTitle, description: rawDescription, links, editHandlers, sx, extra, ...rest }) {
|
|
39
40
|
const titleElementId = `${id}-title`;
|
|
40
41
|
const descriptionTooltipId = `${id}-description`;
|
|
41
42
|
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
@@ -139,6 +140,9 @@ function PanelHeader({ id, title: rawTitle, description: rawDescription, editHan
|
|
|
139
140
|
}
|
|
140
141
|
})
|
|
141
142
|
})
|
|
143
|
+
}),
|
|
144
|
+
links !== undefined && links.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelLinks.PanelLinks, {
|
|
145
|
+
links: links
|
|
142
146
|
})
|
|
143
147
|
]
|
|
144
148
|
}),
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
Object.defineProperty(exports, "PanelLinks", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelLinks;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _Launch = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Launch"));
|
|
26
|
+
const _react = require("react");
|
|
27
|
+
const _components = require("@perses-dev/components");
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
29
|
+
function _interop_require_default(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function PanelLinks({ links }) {
|
|
35
|
+
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
36
|
+
const isMenuOpened = Boolean(anchorEl);
|
|
37
|
+
const handleOpenMenu = (event)=>{
|
|
38
|
+
setAnchorEl(event.currentTarget);
|
|
39
|
+
};
|
|
40
|
+
const handleClose = ()=>{
|
|
41
|
+
setAnchorEl(null);
|
|
42
|
+
};
|
|
43
|
+
// If there is only one link, show it directly
|
|
44
|
+
if (links.length === 1 && links[0]) {
|
|
45
|
+
const link = links[0];
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkButton, {
|
|
47
|
+
link: link
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Else we show a menu with a list of all links
|
|
51
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
54
|
+
description: `${links.length} links`,
|
|
55
|
+
enterDelay: 100,
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
57
|
+
"aria-label": "Panel links",
|
|
58
|
+
size: "small",
|
|
59
|
+
onClick: handleOpenMenu,
|
|
60
|
+
sx: (theme)=>({
|
|
61
|
+
borderRadius: theme.shape.borderRadius,
|
|
62
|
+
padding: '4px'
|
|
63
|
+
}),
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
|
|
65
|
+
"aria-describedby": "links-icon",
|
|
66
|
+
fontSize: "inherit",
|
|
67
|
+
sx: {
|
|
68
|
+
color: (theme)=>theme.palette.text.secondary
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
|
|
74
|
+
anchorEl: anchorEl,
|
|
75
|
+
open: isMenuOpened,
|
|
76
|
+
onClose: handleClose,
|
|
77
|
+
MenuListProps: {
|
|
78
|
+
'aria-labelledby': 'panel-links'
|
|
79
|
+
},
|
|
80
|
+
children: links.map((link)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkMenuItem, {
|
|
81
|
+
link: link
|
|
82
|
+
}, link.url))
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function LinkButton({ link }) {
|
|
88
|
+
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
89
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
90
|
+
description: tooltip !== null && tooltip !== void 0 ? tooltip : url,
|
|
91
|
+
enterDelay: 100,
|
|
92
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
93
|
+
"aria-label": name !== null && name !== void 0 ? name : url,
|
|
94
|
+
size: "small",
|
|
95
|
+
href: url,
|
|
96
|
+
target: targetBlank ? '_blank' : '_self',
|
|
97
|
+
sx: (theme)=>({
|
|
98
|
+
borderRadius: theme.shape.borderRadius,
|
|
99
|
+
padding: '4px'
|
|
100
|
+
}),
|
|
101
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
|
|
102
|
+
fontSize: "inherit",
|
|
103
|
+
sx: {
|
|
104
|
+
color: (theme)=>theme.palette.text.secondary
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function LinkMenuItem({ link }) {
|
|
111
|
+
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
112
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
113
|
+
description: tooltip !== null && tooltip !== void 0 ? tooltip : url,
|
|
114
|
+
enterDelay: 100,
|
|
115
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
116
|
+
component: _material.Link,
|
|
117
|
+
href: url,
|
|
118
|
+
target: targetBlank ? '_blank' : '_self',
|
|
119
|
+
children: name !== null && name !== void 0 ? name : url
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function useLink(link) {
|
|
124
|
+
var _useReplaceVariablesInString;
|
|
125
|
+
const url = (_useReplaceVariablesInString = (0, _pluginsystem.useReplaceVariablesInString)(link.url)) !== null && _useReplaceVariablesInString !== void 0 ? _useReplaceVariablesInString : link.url;
|
|
126
|
+
const name = (0, _pluginsystem.useReplaceVariablesInString)(link.name);
|
|
127
|
+
const tooltip = (0, _pluginsystem.useReplaceVariablesInString)(link.tooltip);
|
|
128
|
+
if (link.renderVariables === false) {
|
|
129
|
+
return link;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
...link,
|
|
133
|
+
url,
|
|
134
|
+
name,
|
|
135
|
+
tooltip
|
|
136
|
+
};
|
|
137
|
+
}
|
|
@@ -43,18 +43,26 @@ function PanelEditorForm(props) {
|
|
|
43
43
|
const { initialValues: { panelDefinition: initialPanelDef, groupId: initialGroupId }, initialAction, onSave, onClose } = props;
|
|
44
44
|
const panelGroups = (0, _context.useListPanelGroups)();
|
|
45
45
|
const [groupId, setGroupId] = (0, _react.useState)(initialGroupId);
|
|
46
|
-
const { panelDefinition, setName, setDescription, setQueries, setPlugin, setPanelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialPanelDef);
|
|
46
|
+
const { panelDefinition, setName, setDescription, setLinks, setQueries, setPlugin, setPanelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialPanelDef);
|
|
47
47
|
const { plugin } = panelDefinition.spec;
|
|
48
48
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
49
49
|
// Use common plugin editor logic even though we've split the inputs up in this form
|
|
50
50
|
const pluginEditor = (0, _pluginsystem.usePluginEditor)({
|
|
51
|
-
|
|
51
|
+
pluginTypes: [
|
|
52
|
+
'Panel'
|
|
53
|
+
],
|
|
52
54
|
value: {
|
|
53
|
-
|
|
55
|
+
selection: {
|
|
56
|
+
kind: plugin.kind,
|
|
57
|
+
type: 'Panel'
|
|
58
|
+
},
|
|
54
59
|
spec: plugin.spec
|
|
55
60
|
},
|
|
56
61
|
onChange: (plugin)=>{
|
|
57
|
-
setPlugin(
|
|
62
|
+
setPlugin({
|
|
63
|
+
kind: plugin.selection.kind,
|
|
64
|
+
spec: plugin.spec
|
|
65
|
+
});
|
|
58
66
|
},
|
|
59
67
|
onHideQueryEditorChange: (isHidden)=>{
|
|
60
68
|
setQueries(undefined, isHidden);
|
|
@@ -69,9 +77,23 @@ function PanelEditorForm(props) {
|
|
|
69
77
|
name: initialPanelDef.spec.display.name,
|
|
70
78
|
groupId: initialGroupId,
|
|
71
79
|
description: initialPanelDef.spec.display.description,
|
|
72
|
-
|
|
80
|
+
selection: pluginEditor.pendingSelection ? pluginEditor.pendingSelection : {
|
|
81
|
+
type: 'Panel',
|
|
82
|
+
kind: plugin.kind
|
|
83
|
+
},
|
|
84
|
+
links: initialPanelDef.spec.links
|
|
73
85
|
}
|
|
74
86
|
});
|
|
87
|
+
const links = (0, _reacthookform.useWatch)({
|
|
88
|
+
control: form.control,
|
|
89
|
+
name: 'links'
|
|
90
|
+
});
|
|
91
|
+
(0, _react.useEffect)(()=>{
|
|
92
|
+
setLinks(links);
|
|
93
|
+
}, [
|
|
94
|
+
setLinks,
|
|
95
|
+
links
|
|
96
|
+
]);
|
|
75
97
|
const processForm = ()=>{
|
|
76
98
|
const values = {
|
|
77
99
|
groupId,
|
|
@@ -232,13 +254,15 @@ function PanelEditorForm(props) {
|
|
|
232
254
|
item: true,
|
|
233
255
|
xs: 4,
|
|
234
256
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
235
|
-
name: "
|
|
257
|
+
name: "selection",
|
|
236
258
|
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
237
259
|
var _pluginEditor_error, _fieldState_error;
|
|
238
260
|
var _pluginEditor_error_message;
|
|
239
261
|
return (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
240
262
|
...field,
|
|
241
|
-
|
|
263
|
+
pluginTypes: [
|
|
264
|
+
'Panel'
|
|
265
|
+
],
|
|
242
266
|
required: true,
|
|
243
267
|
fullWidth: true,
|
|
244
268
|
label: "Type",
|
|
@@ -247,7 +271,7 @@ function PanelEditorForm(props) {
|
|
|
247
271
|
helperText: (_pluginEditor_error_message = (_pluginEditor_error = pluginEditor.error) === null || _pluginEditor_error === void 0 ? void 0 : _pluginEditor_error.message) !== null && _pluginEditor_error_message !== void 0 ? _pluginEditor_error_message : (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
248
272
|
onChange: (event)=>{
|
|
249
273
|
field.onChange(event);
|
|
250
|
-
pluginEditor.
|
|
274
|
+
pluginEditor.onSelectionChange(event);
|
|
251
275
|
}
|
|
252
276
|
});
|
|
253
277
|
}
|
|
@@ -25,7 +25,6 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _Panel = require("../Panel");
|
|
28
|
-
const _utils = require("../../utils");
|
|
29
28
|
const PANEL_PREVIEW_HEIGHT = 300;
|
|
30
29
|
const PANEL_PREVIEW_DEFAULT_WIDTH = 840;
|
|
31
30
|
function PanelPreview({ panelDefinition }) {
|
|
@@ -34,7 +33,7 @@ function PanelPreview({ panelDefinition }) {
|
|
|
34
33
|
if (boxRef.current !== null) {
|
|
35
34
|
width = boxRef.current.getBoundingClientRect().width;
|
|
36
35
|
}
|
|
37
|
-
const suggestedStepMs = (0,
|
|
36
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
38
37
|
if (panelDefinition.spec.plugin.kind === '') {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
@@ -22,9 +22,10 @@ Object.defineProperty(exports, "usePanelEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _react = require("react");
|
|
24
24
|
const usePanelEditor = (panelDefinition)=>{
|
|
25
|
-
const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;
|
|
25
|
+
const { display, plugin: pluginDefinition, queries: initialQueries, links: initialLinks } = panelDefinition.spec;
|
|
26
26
|
const [name, setName] = (0, _react.useState)(display.name);
|
|
27
27
|
const [description, setDescription] = (0, _react.useState)(display.description);
|
|
28
|
+
const [links, setLinks] = (0, _react.useState)(initialLinks);
|
|
28
29
|
const [plugin, setPlugin] = (0, _react.useState)(pluginDefinition);
|
|
29
30
|
// need to keep track of prevQueries if switching from a panel with no queries (ex: markdown) to one with queries
|
|
30
31
|
const [prevQueries, setPrevQueries] = (0, _react.useState)(initialQueries);
|
|
@@ -47,14 +48,16 @@ const usePanelEditor = (panelDefinition)=>{
|
|
|
47
48
|
]);
|
|
48
49
|
// reset panel definition
|
|
49
50
|
const setPanelDefinition = (0, _react.useCallback)((panelDefinition)=>{
|
|
50
|
-
const { display, plugin, queries } = panelDefinition.spec;
|
|
51
|
+
const { display, plugin, queries, links } = panelDefinition.spec;
|
|
51
52
|
setName(display.name);
|
|
52
53
|
setDescription(display.description);
|
|
54
|
+
setLinks(links);
|
|
53
55
|
setPlugin(plugin);
|
|
54
56
|
setQueries(queries);
|
|
55
57
|
}, [
|
|
56
58
|
setName,
|
|
57
59
|
setDescription,
|
|
60
|
+
setLinks,
|
|
58
61
|
setPlugin,
|
|
59
62
|
setQueries
|
|
60
63
|
]);
|
|
@@ -67,23 +70,23 @@ const usePanelEditor = (panelDefinition)=>{
|
|
|
67
70
|
description
|
|
68
71
|
},
|
|
69
72
|
plugin,
|
|
70
|
-
queries: currentQueries
|
|
73
|
+
queries: currentQueries,
|
|
74
|
+
links
|
|
71
75
|
}
|
|
72
76
|
},
|
|
73
77
|
setName,
|
|
74
78
|
setDescription,
|
|
79
|
+
setLinks,
|
|
75
80
|
setQueries,
|
|
76
81
|
setPlugin,
|
|
77
82
|
setPanelDefinition
|
|
78
83
|
}), [
|
|
79
84
|
name,
|
|
80
85
|
description,
|
|
86
|
+
links,
|
|
81
87
|
plugin,
|
|
82
88
|
currentQueries,
|
|
83
|
-
setName,
|
|
84
|
-
setDescription,
|
|
85
89
|
setQueries,
|
|
86
|
-
setPlugin,
|
|
87
90
|
setPanelDefinition
|
|
88
91
|
]);
|
|
89
92
|
};
|
|
@@ -34,8 +34,6 @@ _export_star(require("./PanelGroupDialog"), exports);
|
|
|
34
34
|
_export_star(require("./QuerySummaryTable"), exports);
|
|
35
35
|
_export_star(require("./SaveChangesConfirmationDialog"), exports);
|
|
36
36
|
_export_star(require("./SaveDashboardButton"), exports);
|
|
37
|
-
_export_star(require("./TimeRangeControls"), exports);
|
|
38
|
-
_export_star(require("./ToolbarIconButton"), exports);
|
|
39
37
|
_export_star(require("./Variables"), exports);
|
|
40
38
|
function _export_star(from, to) {
|
|
41
39
|
Object.keys(from).forEach(function(k) {
|
|
@@ -36,8 +36,6 @@ const TOOLTIP_TEXT = {
|
|
|
36
36
|
editDatasources: 'Edit datasources',
|
|
37
37
|
editJson: 'Edit JSON',
|
|
38
38
|
editVariables: 'Edit variables',
|
|
39
|
-
refreshDashboard: 'Refresh dashboard',
|
|
40
|
-
refreshDashboardInterval: 'Auto refresh interval',
|
|
41
39
|
viewJson: 'View JSON',
|
|
42
40
|
// Group buttons
|
|
43
41
|
addPanelToGroup: 'Add panel to group',
|
|
@@ -101,7 +101,9 @@ function DatasourceStoreProvider(props) {
|
|
|
101
101
|
]);
|
|
102
102
|
const listDatasourceSelectItems = (0, _core.useEvent)(async (datasourcePluginKind)=>{
|
|
103
103
|
const [pluginMetadata, datasources, globalDatasources] = await Promise.all([
|
|
104
|
-
listPluginMetadata(
|
|
104
|
+
listPluginMetadata([
|
|
105
|
+
'Datasource'
|
|
106
|
+
]),
|
|
105
107
|
project ? datasourceApi.listDatasources(project, datasourcePluginKind) : [],
|
|
106
108
|
datasourceApi.listGlobalDatasources(datasourcePluginKind)
|
|
107
109
|
]);
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./panelUtils"), exports);
|
|
18
|
-
_export_star(require("./time"), exports);
|
|
19
18
|
function _export_star(from, to) {
|
|
20
19
|
Object.keys(from).forEach(function(k) {
|
|
21
20
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -22,8 +22,18 @@ Object.defineProperty(exports, "panelEditorValidationSchema", {
|
|
|
22
22
|
});
|
|
23
23
|
const _zod = require("zod");
|
|
24
24
|
const panelEditorValidationSchema = _zod.z.object({
|
|
25
|
-
name: _zod.z.string().
|
|
25
|
+
name: _zod.z.string().min(1, 'Required'),
|
|
26
26
|
groupId: _zod.z.number(),
|
|
27
27
|
description: _zod.z.string().optional(),
|
|
28
|
-
|
|
28
|
+
selection: _zod.z.object({
|
|
29
|
+
type: _zod.z.string(),
|
|
30
|
+
kind: _zod.z.string()
|
|
31
|
+
}),
|
|
32
|
+
links: _zod.z.array(_zod.z.object({
|
|
33
|
+
name: _zod.z.string().optional(),
|
|
34
|
+
url: _zod.z.string().min(1, 'Required'),
|
|
35
|
+
tooltip: _zod.z.string().optional(),
|
|
36
|
+
renderVariables: _zod.z.boolean().optional(),
|
|
37
|
+
targetBlank: _zod.z.boolean().optional()
|
|
38
|
+
})).optional()
|
|
29
39
|
});
|
|
@@ -15,8 +15,8 @@ import { useState } from 'react';
|
|
|
15
15
|
import { AppBar, Box, IconButton, Stack, useMediaQuery, useScrollTrigger, useTheme } from '@mui/material';
|
|
16
16
|
import PinOutline from 'mdi-material-ui/PinOutline';
|
|
17
17
|
import PinOffOutline from 'mdi-material-ui/PinOffOutline';
|
|
18
|
+
import { TimeRangeControls } from '@perses-dev/plugin-system';
|
|
18
19
|
import { TemplateVariableList } from '../Variables';
|
|
19
|
-
import { TimeRangeControls } from '../TimeRangeControls';
|
|
20
20
|
export function DashboardStickyToolbar(props) {
|
|
21
21
|
const [isPin, setIsPin] = useState(props.initialVariableIsSticky);
|
|
22
22
|
const scrollTrigger = useScrollTrigger({
|
|
@@ -1 +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 {\n AppBar,\n Box,\n IconButton,\n Stack,\n SxProps,\n Theme,\n useMediaQuery,\n useScrollTrigger,\n useTheme,\n} from '@mui/material';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport PinOffOutline from 'mdi-material-ui/PinOffOutline';\nimport {
|
|
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 {\n AppBar,\n Box,\n IconButton,\n Stack,\n SxProps,\n Theme,\n useMediaQuery,\n useScrollTrigger,\n useTheme,\n} from '@mui/material';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport PinOffOutline from 'mdi-material-ui/PinOffOutline';\nimport { TimeRangeControls } from '@perses-dev/plugin-system';\nimport { TemplateVariableList } from '../Variables';\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 const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));\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\n display=\"flex\"\n justifyContent=\"space-between\"\n sx={{\n flexDirection: isBiggerThanMd ? 'row' : 'column',\n }}\n >\n <Box\n display=\"flex\"\n flexWrap={!isSticky && isBiggerThanMd ? 'wrap' : 'nowrap'}\n maxWidth={isSticky || !isBiggerThanMd ? '100vw' : '100%'}\n maxHeight=\"150px\" // Limit the vertical space used to ~3 rows of variables\n pt={1}\n pl={isSticky ? 1 : 0}\n mt={isSticky && isBiggerThanMd ? 0.5 : 0}\n ml={isSticky && isBiggerThanMd ? 0.5 : 0}\n sx={{\n overflowX: !isSticky && isBiggerThanMd ? 'hidden' : 'auto',\n // Firefox:\n scrollbarWidth: 'thin',\n // Safari and Chrome:\n '&::-webkit-scrollbar': {\n height: '8px',\n backgroundColor: (theme) => theme.palette.grey['300'],\n },\n '&::-webkit-scrollbar-thumb': {\n background: (theme) => theme.palette.grey['600'],\n },\n }}\n gap={1}\n >\n <TemplateVariableList />\n {props.initialVariableIsSticky && (\n <IconButton style={{ width: 'fit-content', height: 'fit-content' }} onClick={() => setIsPin(!isPin)}>\n {isPin ? <PinOutline /> : <PinOffOutline />}\n </IconButton>\n )}\n </Box>\n {isSticky && (\n <Stack\n m={isBiggerThanMd ? 1.5 : 1}\n mt={isBiggerThanMd ? 1.5 : 0}\n ml={isBiggerThanMd ? 1.5 : 'auto'}\n direction=\"row\"\n justifyContent=\"end\"\n >\n <TimeRangeControls></TimeRangeControls>\n </Stack>\n )}\n </Box>\n </AppBar>\n </Box>\n );\n}\n"],"names":["useState","AppBar","Box","IconButton","Stack","useMediaQuery","useScrollTrigger","useTheme","PinOutline","PinOffOutline","TimeRangeControls","TemplateVariableList","DashboardStickyToolbar","props","isPin","setIsPin","initialVariableIsSticky","scrollTrigger","disableHysteresis","isSticky","isBiggerThanMd","breakpoints","up","marginBottom","data-testid","color","position","elevation","sx","backgroundColor","display","justifyContent","flexDirection","flexWrap","maxWidth","maxHeight","pt","pl","mt","ml","overflowX","scrollbarWidth","height","theme","palette","grey","background","gap","style","width","onClick","m","direction"],"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,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SACEC,MAAM,EACNC,GAAG,EACHC,UAAU,EACVC,KAAK,EAGLC,aAAa,EACbC,gBAAgB,EAChBC,QAAQ,QACH,gBAAgB;AACvB,OAAOC,gBAAgB,6BAA6B;AACpD,OAAOC,mBAAmB,gCAAgC;AAC1D,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,oBAAoB,QAAQ,eAAe;AAOpD,OAAO,SAASC,uBAAuBC,KAAkC;IACvE,MAAM,CAACC,OAAOC,SAAS,GAAGf,SAASa,MAAMG,uBAAuB;IAEhE,MAAMC,gBAAgBX,iBAAiB;QAAEY,mBAAmB;IAAK;IACjE,MAAMC,WAAWF,iBAAiBJ,MAAMG,uBAAuB,IAAIF;IAEnE,MAAMM,iBAAiBf,cAAcE,WAAWc,WAAW,CAACC,EAAE,CAAC;IAE/D,OACE,8EAA8E;IAC9E,oHAAoH;kBACpH,KAACpB;QAAIqB,cAAc,CAAC;QAAGC,eAAY;kBACjC,cAAA,KAACvB;YACCwB,OAAM;YACNC,UAAUP,WAAW,UAAU;YAC/BQ,WAAWR,WAAW,IAAI;YAC1BS,IAAI;gBAAEC,iBAAiB;gBAAW,GAAGhB,MAAMe,EAAE;YAAC;sBAE9C,cAAA,MAAC1B;gBACC4B,SAAQ;gBACRC,gBAAe;gBACfH,IAAI;oBACFI,eAAeZ,iBAAiB,QAAQ;gBAC1C;;kCAEA,MAAClB;wBACC4B,SAAQ;wBACRG,UAAU,CAACd,YAAYC,iBAAiB,SAAS;wBACjDc,UAAUf,YAAY,CAACC,iBAAiB,UAAU;wBAClDe,WAAU,QAAQ,wDAAwD;;wBAC1EC,IAAI;wBACJC,IAAIlB,WAAW,IAAI;wBACnBmB,IAAInB,YAAYC,iBAAiB,MAAM;wBACvCmB,IAAIpB,YAAYC,iBAAiB,MAAM;wBACvCQ,IAAI;4BACFY,WAAW,CAACrB,YAAYC,iBAAiB,WAAW;4BACpD,WAAW;4BACXqB,gBAAgB;4BAChB,qBAAqB;4BACrB,wBAAwB;gCACtBC,QAAQ;gCACRb,iBAAiB,CAACc,QAAUA,MAAMC,OAAO,CAACC,IAAI,CAAC,MAAM;4BACvD;4BACA,8BAA8B;gCAC5BC,YAAY,CAACH,QAAUA,MAAMC,OAAO,CAACC,IAAI,CAAC,MAAM;4BAClD;wBACF;wBACAE,KAAK;;0CAEL,KAACpC;4BACAE,MAAMG,uBAAuB,kBAC5B,KAACb;gCAAW6C,OAAO;oCAAEC,OAAO;oCAAeP,QAAQ;gCAAc;gCAAGQ,SAAS,IAAMnC,SAAS,CAACD;0CAC1FA,sBAAQ,KAACN,gCAAgB,KAACC;;;;oBAIhCU,0BACC,KAACf;wBACC+C,GAAG/B,iBAAiB,MAAM;wBAC1BkB,IAAIlB,iBAAiB,MAAM;wBAC3BmB,IAAInB,iBAAiB,MAAM;wBAC3BgC,WAAU;wBACVrB,gBAAe;kCAEf,cAAA,KAACrB;;;;;;AAOf"}
|
|
@@ -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":";AAgBA,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,4CA8F5D,CAAC"}
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';
|
|
15
15
|
import { ErrorBoundary, ErrorAlert } from '@perses-dev/components';
|
|
16
|
+
import { TimeRangeControls } from '@perses-dev/plugin-system';
|
|
16
17
|
import { useEditMode } from '../../context';
|
|
17
18
|
import { AddPanelButton } from '../AddPanelButton';
|
|
18
19
|
import { AddGroupButton } from '../AddGroupButton';
|
|
19
20
|
import { DownloadButton } from '../DownloadButton';
|
|
20
|
-
import { TimeRangeControls } from '../TimeRangeControls';
|
|
21
21
|
import { EditVariablesButton } from '../Variables';
|
|
22
22
|
import { EditDatasourcesButton } from '../Datasources';
|
|
23
23
|
import { EditButton } from '../EditButton';
|
|
@@ -53,7 +53,7 @@ export const DashboardToolbar = (props)=>{
|
|
|
53
53
|
ml: "auto",
|
|
54
54
|
children: [
|
|
55
55
|
isReadonly && /*#__PURE__*/ _jsx(Alert, {
|
|
56
|
-
severity:
|
|
56
|
+
severity: "warning",
|
|
57
57
|
sx: {
|
|
58
58
|
backgroundColor: 'transparent',
|
|
59
59
|
padding: 0
|