@perses-dev/dashboards 0.23.1 → 0.25.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/AddPanelButton/AddPanelButton.js +9 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +23 -6
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +8 -17
- package/dist/cjs/components/EditButton/EditButton.js +41 -0
- package/dist/cjs/components/EditButton/index.js +28 -0
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +42 -0
- package/dist/cjs/components/EditJsonButton/index.js +28 -0
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +86 -0
- package/dist/cjs/components/EditJsonDialog/index.js +28 -0
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +127 -0
- package/dist/cjs/components/EmptyDashboard/index.js +28 -0
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +185 -0
- package/dist/cjs/components/QuerySummaryTable/index.js +28 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +7 -3
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +6 -3
- package/dist/cjs/components/Variables/EditVariablesButton.js +9 -2
- package/dist/cjs/components/index.js +4 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +12 -6
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +10 -1
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +36 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +9 -3
- package/dist/cjs/stories/decorators/WithDashboard.js +60 -0
- package/dist/cjs/stories/decorators/WithPluginRegistry.js +91 -0
- package/dist/cjs/stories/decorators/WithQueryClient.js +29 -0
- package/dist/cjs/stories/decorators/WithQueryParams.js +29 -0
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +27 -0
- package/dist/cjs/stories/decorators/index.js +32 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +11 -4
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +16 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +9 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +10 -2
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +24 -7
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +8 -12
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +13 -0
- package/dist/components/EditButton/EditButton.d.ts.map +1 -0
- package/dist/components/EditButton/EditButton.js +30 -0
- package/dist/components/EditButton/EditButton.js.map +1 -0
- package/dist/components/EditButton/index.d.ts +2 -0
- package/dist/components/EditButton/index.d.ts.map +1 -0
- package/dist/components/EditButton/index.js +15 -0
- package/dist/components/EditButton/index.js.map +1 -0
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +3 -0
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -0
- package/dist/components/EditJsonButton/EditJsonButton.js +31 -0
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -0
- package/dist/components/EditJsonButton/index.d.ts +2 -0
- package/dist/components/EditJsonButton/index.d.ts.map +1 -0
- package/dist/components/EditJsonButton/index.js +15 -0
- package/dist/components/EditJsonButton/index.js.map +1 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +3 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.js +80 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -0
- package/dist/components/EditJsonDialog/index.d.ts +2 -0
- package/dist/components/EditJsonDialog/index.d.ts.map +1 -0
- package/dist/components/EditJsonDialog/index.js +15 -0
- package/dist/components/EditJsonDialog/index.js.map +1 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +33 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.js +123 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -0
- package/dist/components/EmptyDashboard/index.d.ts +2 -0
- package/dist/components/EmptyDashboard/index.d.ts.map +1 -0
- package/dist/components/EmptyDashboard/index.js +15 -0
- package/dist/components/EmptyDashboard/index.js.map +1 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +11 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +179 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -0
- package/dist/components/QuerySummaryTable/index.d.ts +2 -0
- package/dist/components/QuerySummaryTable/index.d.ts.map +1 -0
- package/dist/components/QuerySummaryTable/index.js +15 -0
- package/dist/components/QuerySummaryTable/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +8 -4
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +6 -3
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +16 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +9 -2
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +1 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +2 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +12 -6
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +8 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +10 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.d.ts +12 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js +30 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +2 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +9 -3
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +48 -0
- package/dist/stories/decorators/WithDashboard.js.map +1 -0
- package/dist/stories/decorators/WithPluginRegistry.js +46 -0
- package/dist/stories/decorators/WithPluginRegistry.js.map +1 -0
- package/dist/stories/decorators/WithQueryClient.js +23 -0
- package/dist/stories/decorators/WithQueryClient.js.map +1 -0
- package/dist/stories/decorators/WithQueryParams.js +23 -0
- package/dist/stories/decorators/WithQueryParams.js.map +1 -0
- package/dist/stories/decorators/WithTemplateVariables.js +21 -0
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +19 -0
- package/dist/stories/decorators/index.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +12 -5
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -8
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +6 -5
- package/dist/cjs/components/Panel/Panel.test.js +0 -137
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +0 -131
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -87
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +0 -95
- package/dist/cjs/components/Variables/variable-model.test.js +0 -106
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +0 -82
- package/dist/cjs/utils/panelUtils.test.js +0 -195
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +0 -110
- package/dist/components/Panel/Panel.test.d.ts +0 -2
- package/dist/components/Panel/Panel.test.d.ts.map +0 -1
- package/dist/components/Panel/Panel.test.js +0 -130
- package/dist/components/Panel/Panel.test.js.map +0 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +0 -2
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +0 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js +0 -124
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +0 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +0 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +0 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -80
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +0 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +0 -88
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +0 -1
- package/dist/components/Variables/variable-model.test.d.ts +0 -2
- package/dist/components/Variables/variable-model.test.d.ts.map +0 -1
- package/dist/components/Variables/variable-model.test.js +0 -104
- package/dist/components/Variables/variable-model.test.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js +0 -80
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +0 -1
- package/dist/utils/panelUtils.test.d.ts +0 -2
- package/dist/utils/panelUtils.test.d.ts.map +0 -1
- package/dist/utils/panelUtils.test.js +0 -193
- package/dist/utils/panelUtils.test.js.map +0 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +0 -2
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +0 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +0 -103
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
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 { Alert, FormControl } from '@mui/material';
|
|
16
|
+
import { Dialog, JSONEditor } from '@perses-dev/components';
|
|
17
|
+
import { useEditJsonDialog } from '../../context/DashboardProvider';
|
|
18
|
+
import { useDashboard } from '../../context/useDashboard';
|
|
19
|
+
export const EditJsonDialog = ()=>{
|
|
20
|
+
const { editJsonDialog , closeEditJsonDialog } = useEditJsonDialog();
|
|
21
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
22
|
+
open: !!(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen),
|
|
23
|
+
scroll: "paper",
|
|
24
|
+
fullWidth: true,
|
|
25
|
+
maxWidth: "lg",
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ _jsx(Dialog.Header, {
|
|
28
|
+
onClose: ()=>closeEditJsonDialog(),
|
|
29
|
+
children: "Edit Dashboard"
|
|
30
|
+
}),
|
|
31
|
+
(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen) && /*#__PURE__*/ _jsx(EditJsonDialogForm, {})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const EditJsonDialogForm = ()=>{
|
|
36
|
+
const { closeEditJsonDialog } = useEditJsonDialog();
|
|
37
|
+
const { dashboard , setDashboard } = useDashboard();
|
|
38
|
+
const [draftDashboard, setDraftDashboard] = useState(dashboard);
|
|
39
|
+
const handleApply = (e)=>{
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
setDashboard(draftDashboard);
|
|
42
|
+
closeEditJsonDialog();
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/ _jsxs(Dialog.Form, {
|
|
45
|
+
onSubmit: handleApply,
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ _jsxs(Dialog.Content, {
|
|
48
|
+
sx: {
|
|
49
|
+
width: '100%'
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ _jsx(Alert, {
|
|
53
|
+
sx: {
|
|
54
|
+
marginBottom: (theme)=>theme.spacing(1)
|
|
55
|
+
},
|
|
56
|
+
severity: "warning",
|
|
57
|
+
children: "Metadata cannot be modified or saved."
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
60
|
+
fullWidth: true,
|
|
61
|
+
children: /*#__PURE__*/ _jsx(JSONEditor, {
|
|
62
|
+
minHeight: "300px",
|
|
63
|
+
maxHeight: "700px",
|
|
64
|
+
value: draftDashboard,
|
|
65
|
+
onChange: (value)=>setDraftDashboard(value)
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ _jsx(Dialog.Actions, {
|
|
71
|
+
children: /*#__PURE__*/ _jsx(Dialog.PrimaryButton, {
|
|
72
|
+
onClick: handleApply,
|
|
73
|
+
children: "Apply"
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=EditJsonDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonDialog/EditJsonDialog.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 { FormEvent, useState } from 'react';\nimport { Alert, FormControl } from '@mui/material';\nimport { Dialog, JSONEditor } from '@perses-dev/components';\nimport { useEditJsonDialog } from '../../context/DashboardProvider';\nimport { useDashboard } from '../../context/useDashboard';\n\nexport const EditJsonDialog = () => {\n const { editJsonDialog, closeEditJsonDialog } = useEditJsonDialog();\n\n return (\n <Dialog open={!!editJsonDialog?.isOpen} scroll=\"paper\" fullWidth maxWidth=\"lg\">\n <Dialog.Header onClose={() => closeEditJsonDialog()}>Edit Dashboard</Dialog.Header>\n {editJsonDialog?.isOpen && <EditJsonDialogForm />}\n </Dialog>\n );\n};\n\nconst EditJsonDialogForm = () => {\n const { closeEditJsonDialog } = useEditJsonDialog();\n const { dashboard, setDashboard } = useDashboard();\n const [draftDashboard, setDraftDashboard] = useState(dashboard);\n\n const handleApply = (e: FormEvent) => {\n e.preventDefault();\n setDashboard(draftDashboard);\n closeEditJsonDialog();\n };\n\n return (\n <Dialog.Form onSubmit={handleApply}>\n <Dialog.Content sx={{ width: '100%' }}>\n <Alert sx={{ marginBottom: (theme) => theme.spacing(1) }} severity=\"warning\">\n Metadata cannot be modified or saved.\n </Alert>\n <FormControl fullWidth>\n <JSONEditor\n minHeight=\"300px\"\n maxHeight=\"700px\"\n value={draftDashboard}\n onChange={(value) => setDraftDashboard(value)}\n />\n </FormControl>\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton onClick={handleApply}>Apply</Dialog.PrimaryButton>\n </Dialog.Actions>\n </Dialog.Form>\n );\n};\n"],"names":["useState","Alert","FormControl","Dialog","JSONEditor","useEditJsonDialog","useDashboard","EditJsonDialog","editJsonDialog","closeEditJsonDialog","open","isOpen","scroll","fullWidth","maxWidth","Header","onClose","EditJsonDialogForm","dashboard","setDashboard","draftDashboard","setDraftDashboard","handleApply","e","preventDefault","Form","onSubmit","Content","sx","width","marginBottom","theme","spacing","severity","minHeight","maxHeight","value","onChange","Actions","PrimaryButton","onClick"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;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AAC,CAAC;QAC7BX,mBAAmB,EAAE,CAAC;IACxB,CAAC,AAAC;IAEF,qBACE,MAACN,MAAM,CAACsB,IAAI;QAACC,QAAQ,EAAEJ,WAAW;;0BAChC,MAACnB,MAAM,CAACwB,OAAO;gBAACC,EAAE,EAAE;oBAAEC,KAAK,EAAE,MAAM;iBAAE;;kCACnC,KAAC5B,KAAK;wBAAC2B,EAAE,EAAE;4BAAEE,YAAY,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;yBAAE;wBAAEC,QAAQ,EAAC,SAAS;kCAAC,uCAE7E;sBAAQ;kCACR,KAAC/B,WAAW;wBAACW,SAAS;kCACpB,cAAA,KAACT,UAAU;4BACT8B,SAAS,EAAC,OAAO;4BACjBC,SAAS,EAAC,OAAO;4BACjBC,KAAK,EAAEhB,cAAc;4BACrBiB,QAAQ,EAAE,CAACD,KAAK,GAAKf,iBAAiB,CAACe,KAAK,CAAC;0BAC7C;sBACU;;cACC;0BACjB,KAACjC,MAAM,CAACmC,OAAO;0BACb,cAAA,KAACnC,MAAM,CAACoC,aAAa;oBAACC,OAAO,EAAElB,WAAW;8BAAE,OAAK;kBAAuB;cACzD;;MACL,CACd;AACJ,CAAC,AAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonDialog/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export * from './EditJsonDialog';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonDialog/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 './EditJsonDialog';\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,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface EmptyDashboardProps {
|
|
3
|
+
/**
|
|
4
|
+
* The title, which should be relatively short text.
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Descriptive text, which can be a bit longer.
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional text that will be displayed at the bottom of the empty state.
|
|
13
|
+
* If not specified, no additional text is shown.
|
|
14
|
+
*/
|
|
15
|
+
additionalText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Components that are placed below the title and description that include
|
|
18
|
+
* actions for the user to take (e.g. buttons or links). If not specified,
|
|
19
|
+
* the default buttons will be displayed. Set to `false` to disable the default
|
|
20
|
+
* buttons.
|
|
21
|
+
*/
|
|
22
|
+
actions?: JSX.Element | boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Handler for clicking the edit button when the dashboard is in "view" mode.
|
|
25
|
+
* Required when using the default empty state.
|
|
26
|
+
*/
|
|
27
|
+
onEditButtonClick?: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Communicate that a dashboard is empty and prompt the user to get started.
|
|
31
|
+
*/
|
|
32
|
+
export declare const EmptyDashboard: ({ title, description, additionalText, actions, onEditButtonClick, }: EmptyDashboardProps) => JSX.Element;
|
|
33
|
+
//# sourceMappingURL=EmptyDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyDashboard/EmptyDashboard.tsx"],"names":[],"mappings":";AAmBA,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;IAEhC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAmDD;;GAEG;AACH,eAAO,MAAM,cAAc,wEAMxB,mBAAmB,gBA0BrB,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Typography, Box } from '@mui/material';
|
|
15
|
+
import { useEditMode } from '../../context';
|
|
16
|
+
import { AddPanelButton } from '../AddPanelButton';
|
|
17
|
+
import { EditVariablesButton } from '../Variables';
|
|
18
|
+
import { EditButton } from '../EditButton';
|
|
19
|
+
const DEFAULT_TITLE = "Let's get started";
|
|
20
|
+
const DEFAULT_DESCRIPTION = {
|
|
21
|
+
edit: 'We currently support time series charts, gauge charts, stat charts and more!',
|
|
22
|
+
view: 'This dashboard is currently empty. Get started by clicking the edit button.'
|
|
23
|
+
};
|
|
24
|
+
// Constants from specifics in designs to make the default messaging look good.
|
|
25
|
+
const CONTAINER_WIDTH = '450px';
|
|
26
|
+
const PRIMARY_CONTENT_WIDTH = '289px';
|
|
27
|
+
const COMMON_BUTTON_PROPS = {
|
|
28
|
+
variant: 'outlined',
|
|
29
|
+
color: 'secondary'
|
|
30
|
+
};
|
|
31
|
+
const EmptyDashboardActions = ({ actions , isEditMode , onEditButtonClick })=>{
|
|
32
|
+
if (actions && typeof actions !== 'boolean') {
|
|
33
|
+
// Custom actions
|
|
34
|
+
return actions;
|
|
35
|
+
}
|
|
36
|
+
if (actions === false) {
|
|
37
|
+
// Disable default actions
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if (isEditMode) {
|
|
41
|
+
// Default edit mode actions
|
|
42
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ _jsx(AddPanelButton, {
|
|
45
|
+
variant: "outlined",
|
|
46
|
+
color: "secondary",
|
|
47
|
+
label: "Add Panel",
|
|
48
|
+
fullWidth: true
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsx(EditVariablesButton, {
|
|
51
|
+
variant: "outlined",
|
|
52
|
+
color: "secondary",
|
|
53
|
+
label: "Add Variables",
|
|
54
|
+
fullWidth: true
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (onEditButtonClick) {
|
|
60
|
+
// Default view mode actions
|
|
61
|
+
return /*#__PURE__*/ _jsx(EditButton, {
|
|
62
|
+
...COMMON_BUTTON_PROPS,
|
|
63
|
+
label: "Edit Dashboard",
|
|
64
|
+
onClick: onEditButtonClick
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Communicate that a dashboard is empty and prompt the user to get started.
|
|
71
|
+
*/ export const EmptyDashboard = ({ title =DEFAULT_TITLE , description , additionalText , actions , onEditButtonClick })=>{
|
|
72
|
+
const { isEditMode } = useEditMode();
|
|
73
|
+
const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;
|
|
74
|
+
const actionsContent = /*#__PURE__*/ _jsx(EmptyDashboardActions, {
|
|
75
|
+
actions: actions,
|
|
76
|
+
onEditButtonClick: onEditButtonClick,
|
|
77
|
+
isEditMode: isEditMode
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
80
|
+
sx: {
|
|
81
|
+
width: CONTAINER_WIDTH,
|
|
82
|
+
textAlign: 'center',
|
|
83
|
+
margin: '0 auto'
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
87
|
+
sx: {
|
|
88
|
+
width: PRIMARY_CONTENT_WIDTH,
|
|
89
|
+
margin: '0 auto'
|
|
90
|
+
},
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
93
|
+
variant: "h2",
|
|
94
|
+
gutterBottom: true,
|
|
95
|
+
children: title
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
98
|
+
variant: "body1",
|
|
99
|
+
children: description !== null && description !== void 0 ? description : defaultDescription
|
|
100
|
+
}),
|
|
101
|
+
actionsContent && /*#__PURE__*/ _jsx(Box, {
|
|
102
|
+
sx: {
|
|
103
|
+
display: 'flex',
|
|
104
|
+
gap: 2,
|
|
105
|
+
marginTop: 1,
|
|
106
|
+
justifyContent: 'center'
|
|
107
|
+
},
|
|
108
|
+
children: actionsContent
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}),
|
|
112
|
+
additionalText && /*#__PURE__*/ _jsx(Typography, {
|
|
113
|
+
variant: "subtitle1",
|
|
114
|
+
sx: {
|
|
115
|
+
marginTop: 12
|
|
116
|
+
},
|
|
117
|
+
children: additionalText
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=EmptyDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EmptyDashboard/EmptyDashboard.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 { Typography, Box } from '@mui/material';\nimport { useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditButton } from '../EditButton';\n\nexport interface EmptyDashboardProps {\n /**\n * The title, which should be relatively short text.\n */\n title?: string;\n\n /**\n * Descriptive text, which can be a bit longer.\n */\n description?: string;\n\n /**\n * Additional text that will be displayed at the bottom of the empty state.\n * If not specified, no additional text is shown.\n */\n additionalText?: string;\n\n /**\n * Components that are placed below the title and description that include\n * actions for the user to take (e.g. buttons or links). If not specified,\n * the default buttons will be displayed. Set to `false` to disable the default\n * buttons.\n */\n actions?: JSX.Element | boolean;\n\n /**\n * Handler for clicking the edit button when the dashboard is in \"view\" mode.\n * Required when using the default empty state.\n */\n onEditButtonClick?: () => void;\n}\n\nconst DEFAULT_TITLE = \"Let's get started\";\n\nconst DEFAULT_DESCRIPTION = {\n edit: 'We currently support time series charts, gauge charts, stat charts and more!',\n view: 'This dashboard is currently empty. Get started by clicking the edit button.',\n};\n\n// Constants from specifics in designs to make the default messaging look good.\nconst CONTAINER_WIDTH = '450px';\nconst PRIMARY_CONTENT_WIDTH = '289px';\n\nconst COMMON_BUTTON_PROPS = {\n variant: 'outlined',\n color: 'secondary',\n} as const;\n\ntype EmptyDashboardActionsProps = Pick<EmptyDashboardProps, 'actions' | 'onEditButtonClick'> & {\n isEditMode: boolean;\n};\n\nconst EmptyDashboardActions = ({ actions, isEditMode, onEditButtonClick }: EmptyDashboardActionsProps) => {\n if (actions && typeof actions !== 'boolean') {\n // Custom actions\n return actions;\n }\n\n if (actions === false) {\n // Disable default actions\n return null;\n }\n\n if (isEditMode) {\n // Default edit mode actions\n return (\n <>\n <AddPanelButton variant=\"outlined\" color=\"secondary\" label=\"Add Panel\" fullWidth />\n <EditVariablesButton variant=\"outlined\" color=\"secondary\" label=\"Add Variables\" fullWidth />\n </>\n );\n }\n\n if (onEditButtonClick) {\n // Default view mode actions\n return <EditButton {...COMMON_BUTTON_PROPS} label=\"Edit Dashboard\" onClick={onEditButtonClick} />;\n }\n\n return null;\n};\n\n/**\n * Communicate that a dashboard is empty and prompt the user to get started.\n */\nexport const EmptyDashboard = ({\n title = DEFAULT_TITLE,\n description,\n additionalText,\n actions,\n onEditButtonClick,\n}: EmptyDashboardProps) => {\n const { isEditMode } = useEditMode();\n\n const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;\n const actionsContent = (\n <EmptyDashboardActions actions={actions} onEditButtonClick={onEditButtonClick} isEditMode={isEditMode} />\n );\n\n return (\n <Box sx={{ width: CONTAINER_WIDTH, textAlign: 'center', margin: '0 auto' }}>\n <Box sx={{ width: PRIMARY_CONTENT_WIDTH, margin: '0 auto' }}>\n <Typography variant=\"h2\" gutterBottom>\n {title}\n </Typography>\n <Typography variant=\"body1\">{description ?? defaultDescription}</Typography>\n {actionsContent && (\n <Box sx={{ display: 'flex', gap: 2, marginTop: 1, justifyContent: 'center' }}>{actionsContent}</Box>\n )}\n </Box>\n {additionalText && (\n <Typography variant=\"subtitle1\" sx={{ marginTop: 12 }}>\n {additionalText}\n </Typography>\n )}\n </Box>\n );\n};\n"],"names":["Typography","Box","useEditMode","AddPanelButton","EditVariablesButton","EditButton","DEFAULT_TITLE","DEFAULT_DESCRIPTION","edit","view","CONTAINER_WIDTH","PRIMARY_CONTENT_WIDTH","COMMON_BUTTON_PROPS","variant","color","EmptyDashboardActions","actions","isEditMode","onEditButtonClick","label","fullWidth","onClick","EmptyDashboard","title","description","additionalText","defaultDescription","actionsContent","sx","width","textAlign","margin","gutterBottom","display","gap","marginTop","justifyContent"],"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,UAAU,EAAEC,GAAG,QAAQ,eAAe,CAAC;AAChD,SAASC,WAAW,QAAQ,eAAe,CAAC;AAC5C,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,mBAAmB,QAAQ,cAAc,CAAC;AACnD,SAASC,UAAU,QAAQ,eAAe,CAAC;AAkC3C,MAA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":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyDashboard/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export * from './EmptyDashboard';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EmptyDashboard/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 './EmptyDashboard';\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,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface WarningDisplay {
|
|
3
|
+
query: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
}
|
|
6
|
+
interface QuerySummaryTableProps {
|
|
7
|
+
showTotalQueries?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function QuerySummaryTable(props: QuerySummaryTableProps): JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=QuerySummaryTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuerySummaryTable.d.ts","sourceRoot":"","sources":["../../../src/components/QuerySummaryTable/QuerySummaryTable.tsx"],"names":[],"mappings":";AA8BA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sBAmG9D"}
|
|
@@ -0,0 +1,179 @@
|
|
|
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 { Box, Button, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography, Stack } from '@mui/material';
|
|
15
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
16
|
+
import { useActiveTimeSeriesQueries, useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system';
|
|
17
|
+
const TABLE_MAX_WIDTH = 1000;
|
|
18
|
+
export function QuerySummaryTable(props) {
|
|
19
|
+
const { showTotalQueries =true } = props;
|
|
20
|
+
const datasourcClient = useDatasourceClient({
|
|
21
|
+
kind: 'PrometheusDatasource'
|
|
22
|
+
});
|
|
23
|
+
const { absoluteTimeRange } = useTimeRange();
|
|
24
|
+
// for displaying a summary of recent query results
|
|
25
|
+
const queryClient = useQueryClient();
|
|
26
|
+
const queries = queryClient.getQueryCache().findAll();
|
|
27
|
+
const activeQueries = queries.filter((query)=>query.state.status === 'loading');
|
|
28
|
+
const completedQueries = queries.filter((query)=>query.state.status === 'success');
|
|
29
|
+
const querySummary = useActiveTimeSeriesQueries();
|
|
30
|
+
if (datasourcClient.isLoading === true) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const warnings = [];
|
|
34
|
+
querySummary.forEach((query)=>{
|
|
35
|
+
var ref;
|
|
36
|
+
const queryData = query.state.data;
|
|
37
|
+
if (queryData && ((ref = queryData.metadata) === null || ref === void 0 ? void 0 : ref.notices)) {
|
|
38
|
+
var ref1;
|
|
39
|
+
const queryKey = query.queryKey;
|
|
40
|
+
const warningMessage = (ref1 = queryData.metadata.notices[0]) === null || ref1 === void 0 ? void 0 : ref1.message;
|
|
41
|
+
if (warningMessage) {
|
|
42
|
+
warnings.push({
|
|
43
|
+
query: String(queryKey[0].spec.plugin.spec.query),
|
|
44
|
+
summary: warningMessage
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
50
|
+
spacing: 1,
|
|
51
|
+
mb: 2,
|
|
52
|
+
sx: {
|
|
53
|
+
maxWidth: TABLE_MAX_WIDTH
|
|
54
|
+
},
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
57
|
+
sx: {
|
|
58
|
+
p: 1
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
62
|
+
variant: "h2",
|
|
63
|
+
mb: 1,
|
|
64
|
+
children: "Query Summary"
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ _jsx(TableContainer, {
|
|
67
|
+
component: Paper,
|
|
68
|
+
children: /*#__PURE__*/ _jsxs(Table, {
|
|
69
|
+
size: "small",
|
|
70
|
+
"aria-label": "query summary table",
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
73
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
76
|
+
children: "Queries Loading"
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
79
|
+
children: "Recent Time Series Queries"
|
|
80
|
+
}),
|
|
81
|
+
showTotalQueries && /*#__PURE__*/ _jsx(TableCell, {
|
|
82
|
+
children: "Total Queries"
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
85
|
+
children: "Start Time"
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
88
|
+
children: "End Time"
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
94
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
97
|
+
children: activeQueries.length
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
100
|
+
children: querySummary.length
|
|
101
|
+
}),
|
|
102
|
+
showTotalQueries && /*#__PURE__*/ _jsx(TableCell, {
|
|
103
|
+
children: completedQueries.length
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
106
|
+
children: absoluteTimeRange.start.toString()
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
109
|
+
children: absoluteTimeRange.end.toString()
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
warnings.length > 0 && /*#__PURE__*/ _jsxs(Box, {
|
|
120
|
+
sx: {
|
|
121
|
+
p: 1,
|
|
122
|
+
m: 0
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
126
|
+
variant: "h3",
|
|
127
|
+
mb: 1,
|
|
128
|
+
children: "Warnings"
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ _jsx(TableContainer, {
|
|
131
|
+
component: Paper,
|
|
132
|
+
sx: {
|
|
133
|
+
mb: 2
|
|
134
|
+
},
|
|
135
|
+
children: /*#__PURE__*/ _jsxs(Table, {
|
|
136
|
+
size: "small",
|
|
137
|
+
"aria-label": "query warnings table",
|
|
138
|
+
children: [
|
|
139
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
140
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
141
|
+
children: [
|
|
142
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
143
|
+
children: "Query"
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
146
|
+
children: "Summary"
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
152
|
+
children: warnings.map((details, idx)=>{
|
|
153
|
+
return /*#__PURE__*/ _jsxs(TableRow, {
|
|
154
|
+
children: [
|
|
155
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
156
|
+
children: details.query
|
|
157
|
+
}),
|
|
158
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
159
|
+
children: details.summary
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
}, idx);
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
})
|
|
167
|
+
}),
|
|
168
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
169
|
+
disabled: true,
|
|
170
|
+
variant: "outlined",
|
|
171
|
+
children: "TODO: Action Button"
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=QuerySummaryTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/QuerySummaryTable/QuerySummaryTable.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 {\n Box,\n Button,\n Paper,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Typography,\n Stack,\n} from '@mui/material';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { useActiveTimeSeriesQueries, useDatasourceClient, useTimeRange } from '@perses-dev/plugin-system';\n\nexport interface WarningDisplay {\n query: string;\n summary: string;\n}\n\nconst TABLE_MAX_WIDTH = 1000;\n\ninterface QuerySummaryTableProps {\n showTotalQueries?: boolean;\n}\n\nexport function QuerySummaryTable(props: QuerySummaryTableProps) {\n const { showTotalQueries = true } = props;\n const datasourcClient = useDatasourceClient({ kind: 'PrometheusDatasource' });\n const { absoluteTimeRange } = useTimeRange();\n\n // for displaying a summary of recent query results\n const queryClient = useQueryClient();\n const queries = queryClient.getQueryCache().findAll();\n const activeQueries = queries.filter((query) => query.state.status === 'loading');\n const completedQueries = queries.filter((query) => query.state.status === 'success');\n const querySummary = useActiveTimeSeriesQueries();\n\n if (datasourcClient.isLoading === true) {\n return null;\n }\n\n const warnings: WarningDisplay[] = [];\n querySummary.forEach((query) => {\n const queryData = query.state.data;\n if (queryData && queryData.metadata?.notices) {\n const queryKey = query.queryKey as [TimeSeriesQueryDefinition<UnknownSpec>];\n const warningMessage = queryData.metadata.notices[0]?.message;\n if (warningMessage) {\n warnings.push({\n query: String(queryKey[0].spec.plugin.spec.query),\n summary: warningMessage,\n });\n }\n }\n });\n\n return (\n <Stack\n spacing={1}\n mb={2}\n sx={{\n maxWidth: TABLE_MAX_WIDTH,\n }}\n >\n <Box sx={{ p: 1 }}>\n <Typography variant=\"h2\" mb={1}>\n Query Summary\n </Typography>\n <TableContainer component={Paper}>\n <Table size=\"small\" aria-label=\"query summary table\">\n <TableHead>\n <TableRow>\n <TableCell>Queries Loading</TableCell>\n <TableCell>Recent Time Series Queries</TableCell>\n {showTotalQueries && <TableCell>Total Queries</TableCell>}\n <TableCell>Start Time</TableCell>\n <TableCell>End Time</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>{activeQueries.length}</TableCell>\n <TableCell>{querySummary.length}</TableCell>\n {showTotalQueries && <TableCell>{completedQueries.length}</TableCell>}\n <TableCell>{absoluteTimeRange.start.toString()}</TableCell>\n <TableCell>{absoluteTimeRange.end.toString()}</TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </TableContainer>\n </Box>\n\n {warnings.length > 0 && (\n <Box sx={{ p: 1, m: 0 }}>\n <Typography variant=\"h3\" mb={1}>\n Warnings\n </Typography>\n <TableContainer component={Paper} sx={{ mb: 2 }}>\n <Table size=\"small\" aria-label=\"query warnings table\">\n <TableHead>\n <TableRow>\n <TableCell>Query</TableCell>\n <TableCell>Summary</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {warnings.map((details, idx) => {\n return (\n <TableRow key={idx}>\n <TableCell>{details.query}</TableCell>\n <TableCell>{details.summary}</TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </TableContainer>\n <Button disabled variant=\"outlined\">\n TODO: Action Button\n </Button>\n </Box>\n )}\n </Stack>\n );\n}\n"],"names":["Box","Button","Paper","Table","TableBody","TableCell","TableContainer","TableHead","TableRow","Typography","Stack","useQueryClient","useActiveTimeSeriesQueries","useDatasourceClient","useTimeRange","TABLE_MAX_WIDTH","QuerySummaryTable","props","showTotalQueries","datasourcClient","kind","absoluteTimeRange","queryClient","queries","getQueryCache","findAll","activeQueries","filter","query","state","status","completedQueries","querySummary","isLoading","warnings","forEach","queryData","data","metadata","notices","queryKey","warningMessage","message","push","String","spec","plugin","summary","spacing","mb","sx","maxWidth","p","variant","component","size","aria-label","length","start","toString","end","m","map","details","idx","disabled"],"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,SACEA,GAAG,EACHC,MAAM,EACNC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,KAAK,QACA,eAAe,CAAC;AACvB,SAASC,cAAc,QAAQ,uBAAuB,CAAC;AAEvD,SAASC,0BAA0B,EAAEC,mBAAmB,EAAEC,YAAY,QAAQ,2BAA2B,CAAC;AAO1G,MAAMC,eAAe,GAAG,IAAI,AAAC;AAM7B,OAAO,SAASC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AEpC;sBAAS;;cACL,AACP;;MACK,CACR;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QuerySummaryTable/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export * from './QuerySummaryTable';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/QuerySummaryTable/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 './QuerySummaryTable';\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,qBAAqB,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { TimeOption } from '@perses-dev/components';
|
|
|
3
3
|
export declare const TIME_OPTIONS: TimeOption[];
|
|
4
4
|
interface TimeRangeControlsProps {
|
|
5
5
|
heightPx?: number;
|
|
6
|
+
showRefresh?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function TimeRangeControls({ heightPx }: TimeRangeControlsProps): JSX.Element;
|
|
8
|
+
export declare function TimeRangeControls({ heightPx, showRefresh }: TimeRangeControlsProps): JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=TimeRangeControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAoC,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOtF,eAAO,MAAM,YAAY,EAAE,UAAU,EAUpC,CAAC;AAIF,UAAU,sBAAsB;IAE9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,WAAkB,EAAE,EAAE,sBAAsB,eA8BzF"}
|