@perses-dev/dashboards 0.8.1 → 0.10.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/Dashboard.js +25 -14
- package/dist/cjs/components/DashboardToolbar.js +148 -20
- package/dist/cjs/components/GridLayout/GridItemContent.js +25 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +92 -27
- package/dist/cjs/components/GridLayout/GridTitle.js +91 -31
- package/dist/cjs/components/GridLayout/index.js +18 -19
- package/dist/cjs/components/Panel/DeletePanelDialog.js +91 -0
- package/dist/cjs/components/Panel/Panel.js +156 -55
- package/dist/cjs/components/Panel/Panel.test.js +58 -41
- package/dist/cjs/components/Panel/PanelContent.js +41 -12
- package/dist/cjs/components/Panel/index.js +16 -17
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +84 -108
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +87 -92
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +194 -0
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +48 -0
- package/dist/cjs/components/PanelDrawer/index.js +28 -0
- package/dist/cjs/components/PanelGroupDialog/DeletePanelGroupDialog.js +86 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +121 -39
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +74 -88
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +120 -38
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +42 -27
- package/dist/cjs/components/TimeRangeControls/index.js +16 -17
- package/dist/cjs/components/Variables/Variable.js +195 -36
- package/dist/cjs/components/Variables/VariableEditor.js +207 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +236 -0
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +88 -0
- package/dist/cjs/components/Variables/VariableList.js +81 -13
- package/dist/cjs/components/Variables/index.js +18 -18
- package/dist/cjs/components/index.js +21 -21
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +70 -0
- package/dist/cjs/context/DashboardProvider/common.js +18 -0
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +71 -0
- package/dist/cjs/context/DashboardProvider/index.js +29 -0
- package/dist/cjs/context/DashboardProvider/layout-slice.js +200 -0
- package/dist/cjs/context/DashboardProvider/panel-editing-slice.js +156 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +38 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
- package/dist/cjs/context/QueryStringProvider.js +69 -15
- package/dist/cjs/context/TemplateVariableProvider.js +135 -136
- package/dist/cjs/context/TimeRangeProvider.js +79 -30
- package/dist/cjs/context/index.js +20 -22
- package/dist/cjs/css/styles.js +43 -39
- package/dist/cjs/index.js +19 -20
- package/dist/cjs/test/dashboard-provider.js +51 -0
- package/dist/cjs/test/index.js +18 -18
- package/dist/cjs/test/plugin-registry.js +52 -25
- package/dist/cjs/test/render.js +25 -22
- package/dist/cjs/test/setup-tests.js +4 -2
- package/dist/cjs/test/testDashboard.js +203 -107
- package/dist/cjs/utils/functions.js +9 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +49 -23
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +62 -31
- package/dist/cjs/views/ViewDashboard/index.js +16 -17
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +165 -0
- package/dist/cjs/views/index.js +16 -17
- package/dist/components/Dashboard.d.ts +1 -4
- package/dist/components/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard.js +34 -1
- package/dist/components/Dashboard.js.map +1 -0
- package/dist/components/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar.js +154 -1
- package/dist/components/DashboardToolbar.js.map +1 -0
- package/dist/components/GridLayout/GridItemContent.d.ts +3 -3
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +35 -1
- package/dist/components/GridLayout/GridItemContent.js.map +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +2 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +102 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -0
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +99 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -0
- package/dist/components/GridLayout/index.js +16 -1
- package/dist/components/GridLayout/index.js.map +1 -0
- package/dist/components/Panel/DeletePanelDialog.d.ts +5 -0
- package/dist/components/Panel/DeletePanelDialog.d.ts.map +1 -0
- package/dist/components/Panel/DeletePanelDialog.js +80 -0
- package/dist/components/Panel/DeletePanelDialog.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +1 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +181 -1
- package/dist/components/Panel/Panel.js.map +1 -0
- package/dist/components/Panel/Panel.test.js +74 -1
- package/dist/components/Panel/Panel.test.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +5 -4
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +41 -1
- package/dist/components/Panel/PanelContent.js.map +1 -0
- package/dist/components/Panel/index.js +15 -1
- package/dist/components/Panel/index.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +4 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +96 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js +99 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js +184 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.js +42 -0
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
- package/dist/components/PanelDrawer/index.d.ts +2 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -0
- package/dist/components/PanelDrawer/index.js +15 -0
- package/dist/components/PanelDrawer/index.js.map +1 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.d.ts +4 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.js +75 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +131 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +74 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +137 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +59 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/Variables/Variable.d.ts.map +1 -1
- package/dist/components/Variables/Variable.js +210 -1
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +8 -0
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditor.js +196 -0
- package/dist/components/Variables/VariableEditor.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +225 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js +15 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +21 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +76 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +84 -1
- package/dist/components/Variables/VariableList.js.map +1 -0
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +17 -1
- package/dist/components/Variables/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +20 -1
- package/dist/components/index.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +23 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.js +52 -0
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +5 -0
- package/dist/context/DashboardProvider/common.d.ts.map +1 -0
- package/dist/context/DashboardProvider/common.js +17 -0
- package/dist/context/DashboardProvider/common.js.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +32 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js +56 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
- package/dist/context/DashboardProvider/index.d.ts +3 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -0
- package/dist/context/DashboardProvider/index.js +16 -0
- package/dist/context/DashboardProvider/index.js.map +1 -0
- package/dist/context/DashboardProvider/layout-slice.d.ts +57 -0
- package/dist/context/DashboardProvider/layout-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/layout-slice.js +196 -0
- package/dist/context/DashboardProvider/layout-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editing-slice.d.ts +70 -0
- package/dist/context/DashboardProvider/panel-editing-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-editing-slice.js +152 -0
- package/dist/context/DashboardProvider/panel-editing-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +15 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.js +32 -0
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +24 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
- package/dist/context/DatasourceStoreProvider.js +166 -0
- package/dist/context/DatasourceStoreProvider.js.map +1 -0
- package/dist/context/QueryStringProvider.js +40 -1
- package/dist/context/QueryStringProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider.d.ts +8 -3
- package/dist/context/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider.js +199 -1
- package/dist/context/TemplateVariableProvider.js.map +1 -0
- package/dist/context/TimeRangeProvider.js +72 -1
- package/dist/context/TimeRangeProvider.js.map +1 -0
- package/dist/context/index.d.ts +3 -4
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +19 -1
- package/dist/context/index.js.map +1 -0
- package/dist/css/styles.js +186 -1
- package/dist/css/styles.js.map +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +19 -0
- package/dist/test/dashboard-provider.d.ts.map +1 -0
- package/dist/test/dashboard-provider.js +40 -0
- package/dist/test/dashboard-provider.js.map +1 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +17 -1
- package/dist/test/index.js.map +1 -0
- package/dist/test/plugin-registry.d.ts +3 -4
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +74 -1
- package/dist/test/plugin-registry.js.map +1 -0
- package/dist/test/render.d.ts +1 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +34 -1
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.js +18 -1
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/test/testDashboard.d.ts.map +1 -1
- package/dist/test/testDashboard.js +286 -1
- package/dist/test/testDashboard.js.map +1 -0
- package/dist/utils/functions.js +17 -1
- package/dist/utils/functions.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +55 -1
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +79 -1
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
- package/dist/views/ViewDashboard/index.js +15 -1
- package/dist/views/ViewDashboard/index.js.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +158 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
- package/dist/views/index.js +15 -1
- package/dist/views/index.js.map +1 -0
- package/package.json +13 -7
- package/dist/cjs/components/PanelDrawer/PanelOptionsEditor.js +0 -19
- package/dist/cjs/context/DashboardAppSlice.js +0 -45
- package/dist/cjs/context/DashboardProvider.js +0 -98
- package/dist/cjs/context/LayoutsSlice.js +0 -42
- package/dist/components/PanelDrawer/PanelOptionsEditor.d.ts +0 -9
- package/dist/components/PanelDrawer/PanelOptionsEditor.d.ts.map +0 -1
- package/dist/components/PanelDrawer/PanelOptionsEditor.js +0 -1
- package/dist/context/DashboardAppSlice.d.ts +0 -26
- package/dist/context/DashboardAppSlice.d.ts.map +0 -1
- package/dist/context/DashboardAppSlice.js +0 -1
- package/dist/context/DashboardProvider.d.ts +0 -34
- package/dist/context/DashboardProvider.d.ts.map +0 -1
- package/dist/context/DashboardProvider.js +0 -1
- package/dist/context/LayoutsSlice.d.ts +0 -12
- package/dist/context/LayoutsSlice.d.ts.map +0 -1
- package/dist/context/LayoutsSlice.js +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,7 +10,14 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "default", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>_default
|
|
20
|
+
});
|
|
15
21
|
const testDashboard = {
|
|
16
22
|
kind: 'Dashboard',
|
|
17
23
|
metadata: {
|
|
@@ -19,113 +25,183 @@ const testDashboard = {
|
|
|
19
25
|
project: 'perses',
|
|
20
26
|
created_at: '2021-11-09',
|
|
21
27
|
updated_at: '2021-11-09',
|
|
22
|
-
version: 0
|
|
28
|
+
version: 0
|
|
23
29
|
},
|
|
24
30
|
spec: {
|
|
25
|
-
datasource: { kind: 'Prometheus', global: true, name: 'Public Prometheus Demo Server' },
|
|
26
31
|
duration: '24h',
|
|
27
32
|
variables: [
|
|
28
33
|
{
|
|
29
|
-
name: 'job',
|
|
30
34
|
kind: 'TextVariable',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
spec: {
|
|
36
|
+
name: 'job',
|
|
37
|
+
value: 'node'
|
|
38
|
+
}
|
|
34
39
|
},
|
|
35
40
|
{
|
|
36
|
-
name: 'instance',
|
|
37
41
|
kind: 'TextVariable',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
spec: {
|
|
43
|
+
name: 'instance',
|
|
44
|
+
value: 'demo.do.prometheus.io:9100'
|
|
45
|
+
}
|
|
41
46
|
},
|
|
42
47
|
{
|
|
43
|
-
name: 'interval',
|
|
44
48
|
kind: 'TextVariable',
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
spec: {
|
|
50
|
+
name: 'interval',
|
|
51
|
+
value: '1m'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
49
54
|
],
|
|
50
55
|
panels: {
|
|
51
56
|
cpu: {
|
|
52
|
-
kind: '
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
kind: 'Panel',
|
|
58
|
+
spec: {
|
|
59
|
+
display: {
|
|
60
|
+
name: 'CPU'
|
|
61
|
+
},
|
|
62
|
+
plugin: {
|
|
63
|
+
kind: 'TimeSeriesChart',
|
|
64
|
+
spec: {
|
|
65
|
+
queries: [
|
|
66
|
+
{
|
|
67
|
+
kind: 'TimeSeriesQuery',
|
|
68
|
+
spec: {
|
|
69
|
+
plugin: {
|
|
70
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
71
|
+
spec: {
|
|
72
|
+
query: 'avg without (cpu)(rate(node_cpu_seconds_total{job="node",instance="$instance",mode!="idle"}[$interval]))'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
unit: {
|
|
79
|
+
kind: '%'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
65
84
|
},
|
|
66
85
|
memory: {
|
|
67
|
-
kind: '
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
kind: 'Panel',
|
|
87
|
+
spec: {
|
|
88
|
+
display: {
|
|
89
|
+
name: 'Memory'
|
|
90
|
+
},
|
|
91
|
+
plugin: {
|
|
92
|
+
kind: 'TimeSeriesChart',
|
|
93
|
+
spec: {
|
|
94
|
+
queries: [
|
|
95
|
+
{
|
|
96
|
+
kind: 'TimeSeriesQuery',
|
|
97
|
+
spec: {
|
|
98
|
+
plugin: {
|
|
99
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
100
|
+
spec: {
|
|
101
|
+
query: 'node_memory_MemTotal_bytes{job="node",instance="$instance"} - node_memory_MemFree_bytes{job="node",instance="$instance"} - node_memory_Buffers_bytes{job="node",instance="$instance"} - node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
kind: 'TimeSeriesQuery',
|
|
108
|
+
spec: {
|
|
109
|
+
plugin: {
|
|
110
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
111
|
+
spec: {
|
|
112
|
+
query: 'node_memory_Buffers_bytes{job="node",instance="$instance"}'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
kind: 'TimeSeriesQuery',
|
|
119
|
+
spec: {
|
|
120
|
+
plugin: {
|
|
121
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
122
|
+
spec: {
|
|
123
|
+
query: 'node_memory_Cached_bytes{job="node",instance="$instance"}'
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
kind: 'TimeSeriesQuery',
|
|
130
|
+
spec: {
|
|
131
|
+
plugin: {
|
|
132
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
133
|
+
spec: {
|
|
134
|
+
query: 'node_memory_MemFree_bytes{job="node",instance="$instance"}'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
unit: {
|
|
141
|
+
kind: 'Bytes'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
98
146
|
},
|
|
99
147
|
diskIO: {
|
|
100
|
-
kind: '
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
148
|
+
kind: 'Panel',
|
|
149
|
+
spec: {
|
|
150
|
+
display: {
|
|
151
|
+
name: 'Disk I/O Utilization'
|
|
152
|
+
},
|
|
153
|
+
plugin: {
|
|
154
|
+
kind: 'TimeSeriesChart',
|
|
155
|
+
spec: {
|
|
156
|
+
queries: [
|
|
157
|
+
{
|
|
158
|
+
kind: 'TimeSeriesQuery',
|
|
159
|
+
spec: {
|
|
160
|
+
plugin: {
|
|
161
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
162
|
+
spec: {
|
|
163
|
+
query: 'rate(node_disk_io_time_seconds_total{job="node",instance="$instance",device!~"^(md\\\\d+$|dm-)"}[$interval])'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
unit: {
|
|
170
|
+
kind: 'Percent'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
113
175
|
},
|
|
114
176
|
filesystemFullness: {
|
|
115
|
-
kind: '
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
177
|
+
kind: 'Panel',
|
|
178
|
+
spec: {
|
|
179
|
+
display: {
|
|
180
|
+
name: 'Filesystem Fullness'
|
|
181
|
+
},
|
|
182
|
+
plugin: {
|
|
183
|
+
kind: 'TimeSeriesChart',
|
|
184
|
+
spec: {
|
|
185
|
+
queries: [
|
|
186
|
+
{
|
|
187
|
+
kind: 'TimeSeriesQuery',
|
|
188
|
+
spec: {
|
|
189
|
+
plugin: {
|
|
190
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
191
|
+
spec: {
|
|
192
|
+
query: '1 - node_filesystem_free_bytes{job="node",instance="$instance",fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} / node_filesystem_size_bytes{job="node",instance="$instance"}'
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
unit: {
|
|
199
|
+
kind: 'Percent'
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
129
205
|
},
|
|
130
206
|
layouts: [
|
|
131
207
|
// Regular Title, no collapse enabled
|
|
@@ -134,6 +210,9 @@ const testDashboard = {
|
|
|
134
210
|
spec: {
|
|
135
211
|
display: {
|
|
136
212
|
title: 'CPU Stats',
|
|
213
|
+
collapse: {
|
|
214
|
+
open: true
|
|
215
|
+
}
|
|
137
216
|
},
|
|
138
217
|
items: [
|
|
139
218
|
// First Row
|
|
@@ -142,10 +221,21 @@ const testDashboard = {
|
|
|
142
221
|
y: 0,
|
|
143
222
|
width: 12,
|
|
144
223
|
height: 4,
|
|
145
|
-
content: {
|
|
224
|
+
content: {
|
|
225
|
+
$ref: '#/spec/panels/cpu'
|
|
226
|
+
}
|
|
146
227
|
},
|
|
147
|
-
|
|
148
|
-
|
|
228
|
+
{
|
|
229
|
+
x: 0,
|
|
230
|
+
y: 5,
|
|
231
|
+
width: 6,
|
|
232
|
+
height: 2,
|
|
233
|
+
content: {
|
|
234
|
+
$ref: '#/spec/panels/diskIO'
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
149
239
|
},
|
|
150
240
|
// No title,
|
|
151
241
|
{
|
|
@@ -157,10 +247,12 @@ const testDashboard = {
|
|
|
157
247
|
y: 0,
|
|
158
248
|
width: 8,
|
|
159
249
|
height: 3,
|
|
160
|
-
content: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
250
|
+
content: {
|
|
251
|
+
$ref: '#/spec/panels/memory'
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
164
256
|
},
|
|
165
257
|
// Collapsed
|
|
166
258
|
{
|
|
@@ -169,8 +261,8 @@ const testDashboard = {
|
|
|
169
261
|
display: {
|
|
170
262
|
title: 'Disk Stats',
|
|
171
263
|
collapse: {
|
|
172
|
-
open: false
|
|
173
|
-
}
|
|
264
|
+
open: false
|
|
265
|
+
}
|
|
174
266
|
},
|
|
175
267
|
items: [
|
|
176
268
|
{
|
|
@@ -178,19 +270,23 @@ const testDashboard = {
|
|
|
178
270
|
y: 0,
|
|
179
271
|
width: 6,
|
|
180
272
|
height: 2,
|
|
181
|
-
content: {
|
|
273
|
+
content: {
|
|
274
|
+
$ref: '#/spec/panels/diskIO'
|
|
275
|
+
}
|
|
182
276
|
},
|
|
183
277
|
{
|
|
184
278
|
x: 18,
|
|
185
279
|
y: 0,
|
|
186
280
|
width: 6,
|
|
187
281
|
height: 2,
|
|
188
|
-
content: {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
282
|
+
content: {
|
|
283
|
+
$ref: '#/spec/panels/filesystemFullness'
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
195
291
|
};
|
|
196
|
-
|
|
292
|
+
const _default = testDashboard;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,9 +10,14 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
exports
|
|
16
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "removeWhiteSpacesAndSpecialCharacters", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>removeWhiteSpacesAndSpecialCharacters
|
|
20
|
+
});
|
|
21
|
+
const removeWhiteSpacesAndSpecialCharacters = (str)=>{
|
|
17
22
|
return str.replace(/\s+/g, '');
|
|
18
23
|
};
|
|
19
|
-
exports.removeWhiteSpacesAndSpecialCharacters = removeWhiteSpacesAndSpecialCharacters;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DashboardApp = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
1
|
// Copyright 2022 The Perses Authors
|
|
9
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -17,24 +10,57 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
17
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
11
|
// See the License for the specific language governing permissions and
|
|
19
12
|
// limitations under the License.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "DashboardApp", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>DashboardApp
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
const _components = require("@perses-dev/components");
|
|
24
|
+
const _components1 = require("../../components");
|
|
25
|
+
const _panelGroupDialog = /*#__PURE__*/ _interopRequireDefault(require("../../components/PanelGroupDialog/PanelGroupDialog"));
|
|
26
|
+
const _dashboardToolbar = require("../../components/DashboardToolbar");
|
|
27
|
+
const _deletePanelGroupDialog = /*#__PURE__*/ _interopRequireDefault(require("../../components/PanelGroupDialog/DeletePanelGroupDialog"));
|
|
28
|
+
const _deletePanelDialog = /*#__PURE__*/ _interopRequireDefault(require("../../components/Panel/DeletePanelDialog"));
|
|
29
|
+
function _interopRequireDefault(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const DashboardApp = (props)=>{
|
|
35
|
+
const { dashboardResource } = props;
|
|
36
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
37
|
+
sx: {
|
|
38
|
+
padding: (theme)=>theme.spacing(1, 0),
|
|
33
39
|
flexGrow: 1,
|
|
34
40
|
overflowX: 'hidden',
|
|
35
41
|
overflowY: 'auto',
|
|
36
42
|
display: 'flex',
|
|
37
|
-
flexDirection: 'column'
|
|
38
|
-
},
|
|
43
|
+
flexDirection: 'column'
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_dashboardToolbar.DashboardToolbar, {
|
|
47
|
+
dashboardName: dashboardResource.metadata.name
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
50
|
+
sx: {
|
|
51
|
+
padding: (theme)=>theme.spacing(2)
|
|
52
|
+
},
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ErrorBoundary, {
|
|
55
|
+
FallbackComponent: _components.ErrorAlert,
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.Dashboard, {})
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.PanelDrawer, {}),
|
|
59
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_panelGroupDialog.default, {}),
|
|
60
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_deletePanelGroupDialog.default, {}),
|
|
61
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_deletePanelDialog.default, {})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
39
66
|
};
|
|
40
|
-
exports.DashboardApp = DashboardApp;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ViewDashboard = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
1
|
// Copyright 2022 The Perses Authors
|
|
6
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -14,39 +10,74 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
14
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
11
|
// See the License for the specific language governing permissions and
|
|
16
12
|
// limitations under the License.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "ViewDashboard", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>ViewDashboard
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = require("react");
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _core = require("@perses-dev/core");
|
|
25
|
+
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _components = require("@perses-dev/components");
|
|
27
|
+
const _context = require("../../context");
|
|
28
|
+
const _dashboardApp = require("./DashboardApp");
|
|
27
29
|
function ViewDashboard(props) {
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
const {
|
|
31
|
-
|
|
32
|
-
const dashboardDuration = (
|
|
33
|
-
const defaultTimeRange = (0,
|
|
30
|
+
const { dashboardResource , datasourceApi , sx , ...others } = props;
|
|
31
|
+
const { spec } = dashboardResource;
|
|
32
|
+
const { queryString , setQueryString } = (0, _pluginSystem.useQueryString)();
|
|
33
|
+
var _duration;
|
|
34
|
+
const dashboardDuration = (_duration = spec.duration) !== null && _duration !== void 0 ? _duration : '1h';
|
|
35
|
+
const defaultTimeRange = (0, _core.getDefaultTimeRange)(dashboardDuration, queryString);
|
|
34
36
|
// TODO: add reusable sync query string or no-op util
|
|
35
|
-
(0,
|
|
36
|
-
const currentParams = Object.fromEntries([
|
|
37
|
+
(0, _react.useEffect)(()=>{
|
|
38
|
+
const currentParams = Object.fromEntries([
|
|
39
|
+
...queryString
|
|
40
|
+
]);
|
|
37
41
|
// if app does not provide query string implementation, setTimeRange is used instead
|
|
38
42
|
if (!currentParams.start && setQueryString) {
|
|
39
43
|
// default to duration in dashboard definition if start param is not already set
|
|
40
44
|
queryString.set('start', dashboardDuration);
|
|
41
45
|
setQueryString(queryString);
|
|
42
46
|
}
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
}, [
|
|
48
|
+
dashboardDuration,
|
|
49
|
+
queryString,
|
|
50
|
+
setQueryString
|
|
51
|
+
]);
|
|
52
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_context.DatasourceStoreProvider, {
|
|
53
|
+
dashboardResource: dashboardResource,
|
|
54
|
+
datasourceApi: datasourceApi,
|
|
55
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_context.DashboardProvider, {
|
|
56
|
+
initialState: {
|
|
57
|
+
dashboardSpec: spec
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_context.TimeRangeProvider, {
|
|
60
|
+
initialTimeRange: defaultTimeRange,
|
|
61
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_context.TemplateVariableProvider, {
|
|
62
|
+
initialVariableDefinitions: spec.variables,
|
|
63
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
64
|
+
sx: (0, _components.combineSx)({
|
|
65
|
+
display: 'flex',
|
|
66
|
+
width: '100%',
|
|
67
|
+
height: '100%',
|
|
68
|
+
position: 'relative',
|
|
69
|
+
overflow: 'hidden'
|
|
70
|
+
}, sx),
|
|
71
|
+
...others,
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ErrorBoundary, {
|
|
73
|
+
FallbackComponent: _components.ErrorAlert,
|
|
74
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_dashboardApp.DashboardApp, {
|
|
75
|
+
dashboardResource: dashboardResource
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
});
|
|
51
83
|
}
|
|
52
|
-
exports.ViewDashboard = ViewDashboard;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,19 +10,19 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./ViewDashboard"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|