@perses-dev/dashboards 0.14.0 → 0.16.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/DashboardToolbar/DashboardToolbar.js +9 -3
- package/dist/cjs/components/DownloadButton/DownloadButton.js +109 -0
- package/dist/cjs/{utils → components/DownloadButton}/index.js +1 -1
- package/dist/cjs/{css/styles.js → components/GridLayout/GridContainer.js} +66 -39
- package/dist/cjs/components/GridLayout/GridLayout.js +51 -64
- package/dist/cjs/components/GridLayout/GridTitle.js +11 -14
- package/dist/cjs/components/Panel/Panel.js +4 -2
- package/dist/cjs/components/Panel/PanelHeader.js +52 -48
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +23 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +15 -54
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +27 -11
- package/dist/cjs/components/Variables/Variable.js +16 -4
- package/dist/cjs/components/Variables/VariableEditor.js +21 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +63 -7
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +3 -3
- package/dist/cjs/components/Variables/VariableList.js +81 -17
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +2 -1
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +68 -39
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +40 -15
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +5 -9
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -1
- package/dist/cjs/context/{TimeRangeProvider.js → TimeRangeProvider/TimeRangeProvider.js} +4 -4
- package/dist/cjs/{utils/component-ids.js → context/TimeRangeProvider/index.js} +12 -14
- package/dist/cjs/{utils/time-range-params.js → context/TimeRangeProvider/query-params.js} +11 -5
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/test/testDashboard.js +1 -1
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +2 -1
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +6 -7
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +16 -22
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +9 -3
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +3 -0
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.js +60 -0
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -0
- package/dist/components/DownloadButton/index.d.ts +2 -0
- package/dist/components/DownloadButton/index.d.ts.map +1 -0
- package/dist/{utils → components/DownloadButton}/index.js +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -0
- package/dist/components/GridLayout/GridContainer.d.ts +6 -0
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -0
- package/dist/{css/styles.js → components/GridLayout/GridContainer.js} +65 -38
- package/dist/components/GridLayout/GridContainer.js.map +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +53 -66
- 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 +12 -15
- 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 +4 -2
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +52 -48
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js +23 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +19 -58
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +28 -12
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -1
- package/dist/components/Variables/Variable.js +16 -4
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +23 -3
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +25 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +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 +3 -3
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +5 -1
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +43 -18
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +2 -1
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +70 -41
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +40 -15
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +5 -9
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +9 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +17 -0
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/{TimeRangeProvider.d.ts → TimeRangeProvider/TimeRangeProvider.d.ts} +2 -2
- package/dist/context/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -0
- package/dist/context/{TimeRangeProvider.js → TimeRangeProvider/TimeRangeProvider.js} +4 -4
- package/dist/context/TimeRangeProvider/TimeRangeProvider.js.map +1 -0
- package/dist/context/TimeRangeProvider/index.d.ts +3 -0
- package/dist/context/TimeRangeProvider/index.d.ts.map +1 -0
- package/dist/{utils/component-ids.js → context/TimeRangeProvider/index.js} +3 -14
- package/dist/context/TimeRangeProvider/index.js.map +1 -0
- package/dist/{utils/time-range-params.d.ts → context/TimeRangeProvider/query-params.d.ts} +3 -3
- package/dist/context/TimeRangeProvider/query-params.d.ts.map +1 -0
- package/dist/{utils/time-range-params.js → context/TimeRangeProvider/query-params.js} +13 -7
- package/dist/context/TimeRangeProvider/query-params.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/test/testDashboard.js +1 -1
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +2 -1
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +6 -7
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +16 -22
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -1
- package/package.json +4 -4
- package/dist/context/TimeRangeProvider.d.ts.map +0 -1
- package/dist/context/TimeRangeProvider.js.map +0 -1
- package/dist/css/styles.d.ts +0 -172
- package/dist/css/styles.d.ts.map +0 -1
- package/dist/css/styles.js.map +0 -1
- package/dist/utils/component-ids.d.ts +0 -8
- package/dist/utils/component-ids.d.ts.map +0 -1
- package/dist/utils/component-ids.js.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/time-range-params.d.ts.map +0 -1
- package/dist/utils/time-range-params.js.map +0 -1
|
@@ -19,10 +19,12 @@ Object.defineProperty(exports, "TemplateVariableList", {
|
|
|
19
19
|
get: ()=>TemplateVariableList
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _react = require("react");
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
23
|
const _material = require("@mui/material");
|
|
24
24
|
const _eye = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Eye"));
|
|
25
25
|
const _pencil = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Pencil"));
|
|
26
|
+
const _pinOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOutline"));
|
|
27
|
+
const _pinOffOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOffOutline"));
|
|
26
28
|
const _context = require("../../context");
|
|
27
29
|
const _variable = require("./Variable");
|
|
28
30
|
const _variableEditor = require("./VariableEditor");
|
|
@@ -31,18 +33,67 @@ function _interopRequireDefault(obj) {
|
|
|
31
33
|
default: obj
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
function
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
37
|
+
if (typeof WeakMap !== "function") return null;
|
|
38
|
+
var cacheBabelInterop = new WeakMap();
|
|
39
|
+
var cacheNodeInterop = new WeakMap();
|
|
40
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
+
})(nodeInterop);
|
|
43
|
+
}
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
45
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
+
return {
|
|
50
|
+
default: obj
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
+
if (cache && cache.has(obj)) {
|
|
55
|
+
return cache.get(obj);
|
|
56
|
+
}
|
|
57
|
+
var newObj = {};
|
|
58
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
|
+
for(var key in obj){
|
|
60
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
61
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
62
|
+
if (desc && (desc.get || desc.set)) {
|
|
63
|
+
Object.defineProperty(newObj, key, desc);
|
|
64
|
+
} else {
|
|
65
|
+
newObj[key] = obj[key];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
newObj.default = obj;
|
|
70
|
+
if (cache) {
|
|
71
|
+
cache.set(obj, newObj);
|
|
72
|
+
}
|
|
73
|
+
return newObj;
|
|
74
|
+
}
|
|
75
|
+
function TemplateVariableList(props) {
|
|
35
76
|
const [isEditing, setIsEditing] = (0, _react.useState)(false);
|
|
77
|
+
const [isPin, setIsPin] = (0, _react.useState)(props.initialVariableIsSticky);
|
|
36
78
|
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
37
79
|
const { isEditMode } = (0, _context.useEditMode)();
|
|
38
80
|
const [showVariablesInEditMode, setShowVariablesInEditMode] = (0, _react.useState)(true);
|
|
39
81
|
const showVariables = isEditMode ? showVariablesInEditMode : true;
|
|
40
82
|
const { setVariableDefinitions } = (0, _context.useTemplateVariableActions)();
|
|
83
|
+
const scrollTrigger = (0, _material.useScrollTrigger)({
|
|
84
|
+
disableHysteresis: true
|
|
85
|
+
});
|
|
86
|
+
const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
|
|
41
87
|
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
42
88
|
children: [
|
|
43
89
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Drawer, {
|
|
44
90
|
anchor: 'right',
|
|
45
91
|
open: isEditing,
|
|
92
|
+
PaperProps: {
|
|
93
|
+
sx: {
|
|
94
|
+
width: '50%'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
46
97
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variableEditor.VariableEditor, {
|
|
47
98
|
onCancel: ()=>{
|
|
48
99
|
setIsEditing(false);
|
|
@@ -72,21 +123,34 @@ function TemplateVariableList() {
|
|
|
72
123
|
})
|
|
73
124
|
]
|
|
74
125
|
}),
|
|
75
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
126
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.AppBar, {
|
|
127
|
+
color: 'inherit',
|
|
128
|
+
position: isSticky ? 'fixed' : 'static',
|
|
129
|
+
elevation: isSticky ? 4 : 0,
|
|
130
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
131
|
+
display: 'flex',
|
|
132
|
+
justifyContent: "space-between",
|
|
133
|
+
my: isSticky ? 2 : 0,
|
|
134
|
+
ml: isSticky ? 2 : 0,
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
|
|
137
|
+
direction: 'row',
|
|
138
|
+
spacing: 2,
|
|
139
|
+
children: showVariables && variableDefinitions.map((v)=>{
|
|
140
|
+
var ref;
|
|
141
|
+
/*#__PURE__*/ return (0, _jsxRuntime.jsx)(_material.Box, {
|
|
142
|
+
display: ((ref = v.spec.display) === null || ref === void 0 ? void 0 : ref.hidden) ? 'none' : undefined,
|
|
143
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variable.TemplateVariable, {
|
|
144
|
+
name: v.spec.name
|
|
145
|
+
}, v.spec.name)
|
|
146
|
+
}, v.spec.name);
|
|
147
|
+
})
|
|
148
|
+
}),
|
|
149
|
+
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
150
|
+
onClick: ()=>setIsPin(!isPin),
|
|
151
|
+
children: isPin ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOutline.default, {}) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOffOutline.default, {})
|
|
152
|
+
})
|
|
153
|
+
]
|
|
90
154
|
})
|
|
91
155
|
})
|
|
92
156
|
]
|
|
@@ -18,6 +18,7 @@ _exportStar(require("./Dashboard"), exports);
|
|
|
18
18
|
_exportStar(require("./DashboardToolbar"), exports);
|
|
19
19
|
_exportStar(require("./DeletePanelDialog"), exports);
|
|
20
20
|
_exportStar(require("./DeletePanelGroupDialog"), exports);
|
|
21
|
+
_exportStar(require("./DownloadButton"), exports);
|
|
21
22
|
_exportStar(require("./GridLayout"), exports);
|
|
22
23
|
_exportStar(require("./Panel"), exports);
|
|
23
24
|
_exportStar(require("./PanelDrawer"), exports);
|
|
@@ -80,8 +80,9 @@ function initStore(props) {
|
|
|
80
80
|
setEditMode: (isEditMode)=>set({
|
|
81
81
|
isEditMode
|
|
82
82
|
}),
|
|
83
|
-
setDashboard: ({ spec: { panels , layouts } })=>{
|
|
83
|
+
setDashboard: ({ metadata , spec: { panels , layouts } })=>{
|
|
84
84
|
set((state)=>{
|
|
85
|
+
state.metadata = metadata;
|
|
85
86
|
const { panelGroups , panelGroupOrder } = (0, _panelGroupSlice.convertLayoutsToPanelGroups)(layouts);
|
|
86
87
|
state.panels = panels;
|
|
87
88
|
state.panelGroups = panelGroups;
|
|
@@ -37,28 +37,34 @@ _export(exports, {
|
|
|
37
37
|
});
|
|
38
38
|
const _react = require("react");
|
|
39
39
|
const _dashboardProvider = require("./DashboardProvider");
|
|
40
|
+
const selectEditMode = ({ isEditMode , setEditMode })=>({
|
|
41
|
+
isEditMode,
|
|
42
|
+
setEditMode
|
|
43
|
+
});
|
|
40
44
|
function useEditMode() {
|
|
41
|
-
return (0, _dashboardProvider.useDashboardStore)(
|
|
42
|
-
isEditMode,
|
|
43
|
-
setEditMode
|
|
44
|
-
}));
|
|
45
|
+
return (0, _dashboardProvider.useDashboardStore)(selectEditMode);
|
|
45
46
|
}
|
|
47
|
+
const selectDashboardActions = ({ setDashboard , openAddPanelGroup , openAddPanel })=>({
|
|
48
|
+
setDashboard,
|
|
49
|
+
openAddPanelGroup,
|
|
50
|
+
openAddPanel
|
|
51
|
+
});
|
|
46
52
|
function useDashboardActions() {
|
|
47
|
-
const setDashboard = (0, _dashboardProvider.useDashboardStore)(
|
|
48
|
-
const openAddPanelGroup = (0, _dashboardProvider.useDashboardStore)((store)=>store.openAddPanelGroup);
|
|
49
|
-
const openAddPanel = (0, _dashboardProvider.useDashboardStore)((store)=>store.openAddPanel);
|
|
53
|
+
const { setDashboard , openAddPanelGroup , openAddPanel } = (0, _dashboardProvider.useDashboardStore)(selectDashboardActions);
|
|
50
54
|
return {
|
|
51
55
|
setDashboard,
|
|
52
|
-
openAddPanelGroup,
|
|
53
|
-
openAddPanel: ()=>openAddPanel(
|
|
56
|
+
openAddPanelGroup: ()=>openAddPanelGroup(),
|
|
57
|
+
openAddPanel: ()=>openAddPanel()
|
|
54
58
|
};
|
|
55
59
|
}
|
|
60
|
+
const selectPanelGroupOrder = (state)=>state.panelGroupOrder;
|
|
56
61
|
function usePanelGroupIds() {
|
|
57
|
-
return (0, _dashboardProvider.useDashboardStore)(
|
|
62
|
+
return (0, _dashboardProvider.useDashboardStore)(selectPanelGroupOrder);
|
|
58
63
|
}
|
|
64
|
+
const selectPanelGroups = (state)=>state.panelGroups;
|
|
59
65
|
function useListPanelGroups() {
|
|
60
66
|
const panelGroupIds = usePanelGroupIds();
|
|
61
|
-
const panelGroups = (0, _dashboardProvider.useDashboardStore)(
|
|
67
|
+
const panelGroups = (0, _dashboardProvider.useDashboardStore)(selectPanelGroups);
|
|
62
68
|
return (0, _react.useMemo)(()=>{
|
|
63
69
|
return panelGroupIds.map((id)=>{
|
|
64
70
|
const group = panelGroups[id];
|
|
@@ -73,18 +79,23 @@ function useListPanelGroups() {
|
|
|
73
79
|
]);
|
|
74
80
|
}
|
|
75
81
|
function usePanelGroup(panelGroupId) {
|
|
76
|
-
const panelGroup = (0, _dashboardProvider.useDashboardStore)((
|
|
82
|
+
const panelGroup = (0, _dashboardProvider.useDashboardStore)((0, _react.useCallback)((state)=>state.panelGroups[panelGroupId], [
|
|
83
|
+
panelGroupId
|
|
84
|
+
]));
|
|
77
85
|
if (panelGroup === undefined) {
|
|
78
86
|
throw new Error(`Panel group with Id ${panelGroupId} was not found`);
|
|
79
87
|
}
|
|
80
88
|
return panelGroup;
|
|
81
89
|
}
|
|
90
|
+
const selectPanelGroupActions = ({ openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts })=>({
|
|
91
|
+
openEditPanelGroup,
|
|
92
|
+
deletePanelGroup,
|
|
93
|
+
openAddPanel,
|
|
94
|
+
updatePanelGroupLayouts
|
|
95
|
+
});
|
|
82
96
|
function usePanelGroupActions(panelGroupId) {
|
|
83
97
|
const { moveUp , moveDown } = useMovePanelGroup(panelGroupId);
|
|
84
|
-
const openEditPanelGroup = (0, _dashboardProvider.useDashboardStore)(
|
|
85
|
-
const deletePanelGroup = (0, _dashboardProvider.useDashboardStore)((store)=>store.openDeletePanelGroupDialog);
|
|
86
|
-
const openAddPanel = (0, _dashboardProvider.useDashboardStore)((store)=>store.openAddPanel);
|
|
87
|
-
const updatePanelGroupLayouts = (0, _dashboardProvider.useDashboardStore)((store)=>store.updatePanelGroupLayouts);
|
|
98
|
+
const { openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts } = (0, _dashboardProvider.useDashboardStore)(selectPanelGroupActions);
|
|
88
99
|
return {
|
|
89
100
|
openEditPanelGroup: ()=>openEditPanelGroup(panelGroupId),
|
|
90
101
|
deletePanelGroup: ()=>deletePanelGroup(panelGroupId),
|
|
@@ -94,13 +105,17 @@ function usePanelGroupActions(panelGroupId) {
|
|
|
94
105
|
updatePanelGroupLayouts: (itemLayouts)=>updatePanelGroupLayouts(panelGroupId, itemLayouts)
|
|
95
106
|
};
|
|
96
107
|
}
|
|
108
|
+
const selectSwapPanelGroups = (state)=>state.swapPanelGroups;
|
|
109
|
+
const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
|
|
97
110
|
/**
|
|
98
111
|
* Returns functions for moving a panel group up or down. A function will be undefined if the panel group can't be
|
|
99
112
|
* moved in that direction.
|
|
100
113
|
*/ function useMovePanelGroup(panelGroupId) {
|
|
101
|
-
const currentIndex = (0, _dashboardProvider.useDashboardStore)((store)=>store.panelGroupOrder.findIndex((id)=>id === panelGroupId)
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
const currentIndex = (0, _dashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>store.panelGroupOrder.findIndex((id)=>id === panelGroupId), [
|
|
115
|
+
panelGroupId
|
|
116
|
+
]));
|
|
117
|
+
const panelGroupsLength = (0, _dashboardProvider.useDashboardStore)(selectPanelGroupsLength);
|
|
118
|
+
const swapPanelGroups = (0, _dashboardProvider.useDashboardStore)(selectSwapPanelGroups);
|
|
104
119
|
if (currentIndex < 0) {
|
|
105
120
|
throw new Error(`Could not find panel group with Id ${panelGroupId} in order array`);
|
|
106
121
|
}
|
|
@@ -111,52 +126,66 @@ function usePanelGroupActions(panelGroupId) {
|
|
|
111
126
|
moveDown: currentIndex < panelGroupsLength - 1 ? moveDown : undefined
|
|
112
127
|
};
|
|
113
128
|
}
|
|
129
|
+
const selectPanelGroupEditor = (state)=>state.panelGroupEditor;
|
|
114
130
|
function usePanelGroupEditor() {
|
|
115
|
-
return (0, _dashboardProvider.useDashboardStore)(
|
|
131
|
+
return (0, _dashboardProvider.useDashboardStore)(selectPanelGroupEditor);
|
|
116
132
|
}
|
|
133
|
+
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup })=>({
|
|
134
|
+
deletePanelGroupDialog,
|
|
135
|
+
openDeletePanelGroupDialog,
|
|
136
|
+
closeDeletePanelGroupDialog,
|
|
137
|
+
deletePanelGroup
|
|
138
|
+
});
|
|
117
139
|
function useDeletePanelGroupDialog() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
const { deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = (0, _dashboardProvider.useDashboardStore)(selectDeletePanelGroupDialog);
|
|
141
|
+
return {
|
|
142
|
+
deletePanelGroupDialog,
|
|
143
|
+
deletePanelGroup,
|
|
144
|
+
openDeletePanelGroupDialog,
|
|
145
|
+
closeDeletePanelGroupDialog: ()=>closeDeletePanelGroupDialog()
|
|
146
|
+
};
|
|
124
147
|
}
|
|
125
148
|
function usePanel(panelGroupItemId) {
|
|
126
149
|
const { panelGroupId , panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
127
|
-
const panel = (0, _dashboardProvider.useDashboardStore)((store)=>{
|
|
150
|
+
const panel = (0, _dashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>{
|
|
128
151
|
var ref;
|
|
129
152
|
const panelKey = (ref = store.panelGroups[panelGroupId]) === null || ref === void 0 ? void 0 : ref.itemPanelKeys[panelGroupLayoutId];
|
|
130
153
|
if (panelKey === undefined) return;
|
|
131
154
|
return store.panels[panelKey];
|
|
132
|
-
}
|
|
155
|
+
}, [
|
|
156
|
+
panelGroupId,
|
|
157
|
+
panelGroupLayoutId
|
|
158
|
+
]));
|
|
133
159
|
if (panel === undefined) {
|
|
134
160
|
throw new Error(`Could not find panel for Id ${panelGroupItemId}`);
|
|
135
161
|
}
|
|
136
162
|
return panel;
|
|
137
163
|
}
|
|
164
|
+
const selectPanelActions = ({ openEditPanel , openDeletePanelDialog })=>({
|
|
165
|
+
openEditPanel,
|
|
166
|
+
openDeletePanelDialog
|
|
167
|
+
});
|
|
138
168
|
function usePanelActions(panelGroupItemId) {
|
|
139
|
-
const openEditPanel = (0, _dashboardProvider.useDashboardStore)(
|
|
140
|
-
const openDeletePanelDialog = (0, _dashboardProvider.useDashboardStore)((store)=>store.openDeletePanelDialog);
|
|
169
|
+
const { openEditPanel , openDeletePanelDialog } = (0, _dashboardProvider.useDashboardStore)(selectPanelActions);
|
|
141
170
|
return {
|
|
142
171
|
openEditPanel: ()=>openEditPanel(panelGroupItemId),
|
|
143
172
|
openDeletePanelDialog: ()=>openDeletePanelDialog(panelGroupItemId)
|
|
144
173
|
};
|
|
145
174
|
}
|
|
175
|
+
const selectPanelEditor = (state)=>state.panelEditor;
|
|
146
176
|
function usePanelEditor() {
|
|
147
|
-
return (0, _dashboardProvider.useDashboardStore)(
|
|
177
|
+
return (0, _dashboardProvider.useDashboardStore)(selectPanelEditor);
|
|
148
178
|
}
|
|
149
|
-
|
|
150
|
-
const deletePanelDialog = (0, _dashboardProvider.useDashboardStore)((store)=>store.deletePanelDialog);
|
|
151
|
-
// TODO: Refactor similar to other dialogs/editors so these are on the editor state itself
|
|
152
|
-
const deletePanel = (0, _dashboardProvider.useDashboardStore)((store)=>store.deletePanel);
|
|
153
|
-
const closeDeletePanelDialog = (0, _dashboardProvider.useDashboardStore)((store)=>store.closeDeletePanelDialog);
|
|
154
|
-
return {
|
|
179
|
+
const selectDeletePanelDialog = ({ deletePanelDialog , deletePanel , closeDeletePanelDialog })=>({
|
|
155
180
|
deletePanelDialog,
|
|
156
181
|
deletePanel,
|
|
157
182
|
closeDeletePanelDialog
|
|
158
|
-
};
|
|
183
|
+
});
|
|
184
|
+
function useDeletePanelDialog() {
|
|
185
|
+
// TODO: Refactor similar to other dialogs/editors so these are on the editor state itself
|
|
186
|
+
return (0, _dashboardProvider.useDashboardStore)(selectDeletePanelDialog);
|
|
159
187
|
}
|
|
188
|
+
const selectDefaultTimeRange = (state)=>state.defaultTimeRange;
|
|
160
189
|
function useDefaultTimeRange() {
|
|
161
|
-
return (0, _dashboardProvider.useDashboardStore)(
|
|
190
|
+
return (0, _dashboardProvider.useDashboardStore)(selectDefaultTimeRange);
|
|
162
191
|
}
|
|
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "createPanelEditorSlice", {
|
|
|
20
20
|
});
|
|
21
21
|
const _functions = require("../../utils/functions");
|
|
22
22
|
const _common = require("./common");
|
|
23
|
+
const _panelGroupSlice = require("./panel-group-slice");
|
|
23
24
|
function createPanelEditorSlice() {
|
|
24
25
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
25
26
|
return (set, get)=>{
|
|
@@ -51,14 +52,14 @@ function createPanelEditorSlice() {
|
|
|
51
52
|
},
|
|
52
53
|
applyChanges: (next)=>{
|
|
53
54
|
const panelDefinititon = createPanelDefinitionFromEditorValues(next);
|
|
54
|
-
set((
|
|
55
|
-
|
|
55
|
+
set((state)=>{
|
|
56
|
+
state.panels[panelKey] = panelDefinititon;
|
|
56
57
|
// If the panel didn't change groups, nothing else to do
|
|
57
58
|
if (next.groupId === panelGroupId) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
// Move panel to the new group
|
|
61
|
-
const existingGroup =
|
|
62
|
+
const existingGroup = state.panelGroups[panelGroupId];
|
|
62
63
|
if (existingGroup === undefined) {
|
|
63
64
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
64
65
|
}
|
|
@@ -72,7 +73,7 @@ function createPanelEditorSlice() {
|
|
|
72
73
|
existingGroup.itemLayouts.splice(existingLayoutIdx, 1);
|
|
73
74
|
delete existingGroup.itemPanelKeys[panelGroupLayoutId];
|
|
74
75
|
// Add item to the end of the new group
|
|
75
|
-
const newGroup =
|
|
76
|
+
const newGroup = state.panelGroups[next.groupId];
|
|
76
77
|
if (newGroup === undefined) {
|
|
77
78
|
throw new Error(`Could not find new group ${next.groupId}`);
|
|
78
79
|
}
|
|
@@ -98,13 +99,13 @@ function createPanelEditorSlice() {
|
|
|
98
99
|
});
|
|
99
100
|
},
|
|
100
101
|
openAddPanel (panelGroupId) {
|
|
101
|
-
// If a panel group isn't supplied, add to the first group
|
|
102
|
+
// If a panel group isn't supplied, add to the first group or create a group if there aren't any
|
|
103
|
+
let newGroup = undefined;
|
|
104
|
+
panelGroupId !== null && panelGroupId !== void 0 ? panelGroupId : panelGroupId = get().panelGroupOrder[0];
|
|
102
105
|
if (panelGroupId === undefined) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
panelGroupId = firstGroupId;
|
|
106
|
+
newGroup = (0, _panelGroupSlice.createEmptyPanelGroup)();
|
|
107
|
+
newGroup.title = 'Panel Group';
|
|
108
|
+
panelGroupId = newGroup.id;
|
|
108
109
|
}
|
|
109
110
|
const editorState = {
|
|
110
111
|
mode: 'Add',
|
|
@@ -119,12 +120,17 @@ function createPanelEditorSlice() {
|
|
|
119
120
|
},
|
|
120
121
|
applyChanges: (next)=>{
|
|
121
122
|
const panelDef = createPanelDefinitionFromEditorValues(next);
|
|
122
|
-
const
|
|
123
|
-
|
|
123
|
+
const uniquePanelKeys = getUniquePanelKeys(get().panels);
|
|
124
|
+
let panelKey = (0, _functions.removeWhiteSpacesAndSpecialCharacters)(next.name);
|
|
125
|
+
// append count if panel key already exists
|
|
126
|
+
if (uniquePanelKeys[panelKey]) {
|
|
127
|
+
panelKey += `-${uniquePanelKeys[panelKey]}`;
|
|
128
|
+
}
|
|
129
|
+
set((state)=>{
|
|
124
130
|
// Add a panel
|
|
125
|
-
|
|
131
|
+
state.panels[panelKey] = panelDef;
|
|
126
132
|
// Also add a panel group item referencing the panel
|
|
127
|
-
const group =
|
|
133
|
+
const group = state.panelGroups[next.groupId];
|
|
128
134
|
if (group === undefined) {
|
|
129
135
|
throw new Error(`Missing panel group ${next.groupId}`);
|
|
130
136
|
}
|
|
@@ -145,8 +151,12 @@ function createPanelEditorSlice() {
|
|
|
145
151
|
});
|
|
146
152
|
}
|
|
147
153
|
};
|
|
148
|
-
// Open the editor with the new state
|
|
149
154
|
set((state)=>{
|
|
155
|
+
// Add the new panel group if one was created for the panel
|
|
156
|
+
if (newGroup !== undefined) {
|
|
157
|
+
(0, _panelGroupSlice.addPanelGroup)(state, newGroup);
|
|
158
|
+
}
|
|
159
|
+
// Open the editor with the new state
|
|
150
160
|
state.panelEditor = editorState;
|
|
151
161
|
});
|
|
152
162
|
}
|
|
@@ -180,3 +190,18 @@ function getYForNewRow(group) {
|
|
|
180
190
|
}
|
|
181
191
|
return newRowY;
|
|
182
192
|
}
|
|
193
|
+
// Find all the unique panel keys
|
|
194
|
+
// ex: cpu, cpu-1, cpu-2 count as the same panel key since these panels have the same name
|
|
195
|
+
function getUniquePanelKeys(panels) {
|
|
196
|
+
const uniquePanelKeys = {};
|
|
197
|
+
Object.keys(panels).forEach((panelKey)=>{
|
|
198
|
+
const key = panelKey.replace(/-([0-9]+)/, '');
|
|
199
|
+
const count = uniquePanelKeys[key];
|
|
200
|
+
if (count) {
|
|
201
|
+
uniquePanelKeys[key] = count + 1;
|
|
202
|
+
} else {
|
|
203
|
+
uniquePanelKeys[key] = 1;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return uniquePanelKeys;
|
|
207
|
+
}
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "createPanelGroupEditorSlice", {
|
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: ()=>createPanelGroupEditorSlice
|
|
20
20
|
});
|
|
21
|
-
const
|
|
21
|
+
const _panelGroupSlice = require("./panel-group-slice");
|
|
22
22
|
const createPanelGroupEditorSlice = (set, get)=>({
|
|
23
23
|
panelGroupEditor: undefined,
|
|
24
24
|
openAddPanelGroup: ()=>{
|
|
@@ -30,15 +30,11 @@ const createPanelGroupEditorSlice = (set, get)=>({
|
|
|
30
30
|
isCollapsed: false
|
|
31
31
|
},
|
|
32
32
|
applyChanges (next) {
|
|
33
|
-
const newGroup =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
itemPanelKeys: {},
|
|
37
|
-
...next
|
|
38
|
-
};
|
|
33
|
+
const newGroup = (0, _panelGroupSlice.createEmptyPanelGroup)();
|
|
34
|
+
newGroup.title = next.title;
|
|
35
|
+
newGroup.isCollapsed = next.isCollapsed;
|
|
39
36
|
set((draft)=>{
|
|
40
|
-
draft
|
|
41
|
-
draft.panelGroupOrder.unshift(newGroup.id);
|
|
37
|
+
(0, _panelGroupSlice.addPanelGroup)(draft, newGroup);
|
|
42
38
|
});
|
|
43
39
|
},
|
|
44
40
|
close () {
|
|
@@ -22,7 +22,9 @@ function _export(target, all) {
|
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
24
|
createPanelGroupSlice: ()=>createPanelGroupSlice,
|
|
25
|
-
convertLayoutsToPanelGroups: ()=>convertLayoutsToPanelGroups
|
|
25
|
+
convertLayoutsToPanelGroups: ()=>convertLayoutsToPanelGroups,
|
|
26
|
+
createEmptyPanelGroup: ()=>createEmptyPanelGroup,
|
|
27
|
+
addPanelGroup: ()=>addPanelGroup
|
|
26
28
|
});
|
|
27
29
|
const _core = require("@perses-dev/core");
|
|
28
30
|
const _common = require("./common");
|
|
@@ -96,3 +98,16 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
96
98
|
panelGroupOrder: panelGroupIdOrder
|
|
97
99
|
};
|
|
98
100
|
}
|
|
101
|
+
function createEmptyPanelGroup() {
|
|
102
|
+
return {
|
|
103
|
+
id: (0, _common.generateId)(),
|
|
104
|
+
title: undefined,
|
|
105
|
+
isCollapsed: false,
|
|
106
|
+
itemLayouts: [],
|
|
107
|
+
itemPanelKeys: {}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function addPanelGroup(draft, newGroup) {
|
|
111
|
+
draft.panelGroups[newGroup.id] = newGroup;
|
|
112
|
+
draft.panelGroupOrder.unshift(newGroup.id);
|
|
113
|
+
}
|
|
@@ -27,6 +27,7 @@ _export(exports, {
|
|
|
27
27
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
28
28
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
29
29
|
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
30
|
+
const _queryParams = require("./query-params");
|
|
30
31
|
function _getRequireWildcardCache(nodeInterop) {
|
|
31
32
|
if (typeof WeakMap !== "function") return null;
|
|
32
33
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -67,12 +68,11 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
67
68
|
return newObj;
|
|
68
69
|
}
|
|
69
70
|
function TimeRangeProvider(props) {
|
|
70
|
-
const {
|
|
71
|
-
|
|
71
|
+
const { initialTimeRange , enabledURLParams , children } = props;
|
|
72
|
+
const { timeRange , setTimeRange } = (0, _queryParams.useSetTimeRangeParams)(initialTimeRange, enabledURLParams);
|
|
72
73
|
const ctx = (0, _react.useMemo)(()=>({
|
|
73
74
|
timeRange,
|
|
74
|
-
setTimeRange
|
|
75
|
-
/* no-op */ }
|
|
75
|
+
setTimeRange
|
|
76
76
|
}), [
|
|
77
77
|
timeRange,
|
|
78
78
|
setTimeRange
|
|
@@ -14,18 +14,16 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
return id.current;
|
|
17
|
+
_exportStar(require("./TimeRangeProvider"), exports);
|
|
18
|
+
_exportStar(require("./query-params"), exports);
|
|
19
|
+
function _exportStar(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return from;
|
|
31
29
|
}
|
|
@@ -106,23 +106,29 @@ function useInitialTimeRange(dashboardDuration) {
|
|
|
106
106
|
dashboardDuration
|
|
107
107
|
]);
|
|
108
108
|
}
|
|
109
|
-
function useSetTimeRangeParams(initialTimeRange,
|
|
109
|
+
function useSetTimeRangeParams(initialTimeRange, enabledURLParams = true) {
|
|
110
110
|
const [query, setQuery] = (0, _useQueryParams.useQueryParams)(timeRangeQueryConfig);
|
|
111
|
-
//
|
|
111
|
+
// determine whether initial param had previously been populated to fix back btn
|
|
112
|
+
const [paramsLoaded, setParamsLoaded] = (0, _react.useState)(false);
|
|
113
|
+
// optional fallback when app does not want query string as source of truth
|
|
114
|
+
// this occurs when enabledURLParams is set to false on TimeRangeProvider
|
|
112
115
|
const [timeRangeState, setTimeRangeState] = (0, _react.useState)(initialTimeRange);
|
|
113
116
|
const { start } = query;
|
|
114
117
|
(0, _react.useEffect)(()=>{
|
|
115
|
-
|
|
118
|
+
// when dashboard loaded with no params, default to dashboard duration
|
|
119
|
+
if (enabledURLParams && !paramsLoaded && !start) {
|
|
116
120
|
if ((0, _core.isRelativeTimeRange)(initialTimeRange)) {
|
|
117
121
|
setQuery({
|
|
118
122
|
start: initialTimeRange.pastDuration,
|
|
119
123
|
end: undefined
|
|
120
124
|
});
|
|
125
|
+
setParamsLoaded(true);
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
}, [
|
|
124
129
|
initialTimeRange,
|
|
125
|
-
|
|
130
|
+
enabledURLParams,
|
|
131
|
+
paramsLoaded,
|
|
126
132
|
start,
|
|
127
133
|
setQuery
|
|
128
134
|
]);
|
|
@@ -138,7 +144,7 @@ function useSetTimeRangeParams(initialTimeRange, paramsEnabled = true) {
|
|
|
138
144
|
}, [
|
|
139
145
|
setQuery
|
|
140
146
|
]);
|
|
141
|
-
if (!
|
|
147
|
+
if (!enabledURLParams) {
|
|
142
148
|
return {
|
|
143
149
|
timeRange: timeRangeState,
|
|
144
150
|
setTimeRange: setTimeRangeState
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
_exportStar(require("./components"), exports);
|
|
18
18
|
_exportStar(require("./context"), exports);
|
|
19
|
-
_exportStar(require("./utils"), exports);
|
|
20
19
|
_exportStar(require("./views"), exports);
|
|
21
20
|
function _exportStar(from, to) {
|
|
22
21
|
Object.keys(from).forEach(function(k) {
|
|
@@ -25,7 +25,7 @@ const _components = require("@perses-dev/components");
|
|
|
25
25
|
const _components1 = require("../../components");
|
|
26
26
|
const _context = require("../../context");
|
|
27
27
|
const DashboardApp = (props)=>{
|
|
28
|
-
const { dashboardResource , dashboardTitleComponent } = props;
|
|
28
|
+
const { dashboardResource , dashboardTitleComponent , initialVariableIsSticky } = props;
|
|
29
29
|
const { setEditMode } = (0, _context.useEditMode)();
|
|
30
30
|
const { dashboard , setDashboard } = (0, _context.useDashboard)();
|
|
31
31
|
const [originalDashboard, setOriginalDashboard] = (0, _react.useState)(undefined);
|
|
@@ -66,6 +66,7 @@ const DashboardApp = (props)=>{
|
|
|
66
66
|
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DashboardToolbar, {
|
|
67
67
|
dashboardName: dashboardResource.metadata.name,
|
|
68
68
|
dashboardTitleComponent: dashboardTitleComponent,
|
|
69
|
+
initialVariableIsSticky: initialVariableIsSticky,
|
|
69
70
|
onEditButtonClick: onEditButtonClick,
|
|
70
71
|
onCancelButtonClick: onCancelButtonClick
|
|
71
72
|
}),
|