@perses-dev/dashboards 0.8.0 → 0.8.1
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/GridLayout/GridLayout.js +2 -2
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +40 -0
- package/dist/cjs/views/{ViewDashboard.js → ViewDashboard/ViewDashboard.js} +13 -4
- package/dist/cjs/views/ViewDashboard/index.js +29 -0
- package/dist/components/GridLayout/GridLayout.js +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +7 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.js +1 -0
- package/dist/views/{ViewDashboard.d.ts → ViewDashboard/ViewDashboard.d.ts} +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.js +1 -0
- package/dist/views/ViewDashboard/index.d.ts +2 -0
- package/dist/views/ViewDashboard/index.d.ts.map +1 -0
- package/dist/views/ViewDashboard/index.js +1 -0
- package/package.json +4 -4
- package/dist/cjs/views/DashboardApp.js +0 -46
- package/dist/views/DashboardApp.d.ts +0 -4
- package/dist/views/DashboardApp.d.ts.map +0 -1
- package/dist/views/DashboardApp.js +0 -1
- package/dist/views/ViewDashboard.d.ts.map +0 -1
- package/dist/views/ViewDashboard.js +0 -1
|
@@ -25,9 +25,9 @@ const ResponsiveGridLayout = (0, react_grid_layout_1.WidthProvider)(react_grid_l
|
|
|
25
25
|
* Layout component that arranges children in a Grid based on the definition.
|
|
26
26
|
*/
|
|
27
27
|
function GridLayout(props) {
|
|
28
|
-
var _a, _b;
|
|
28
|
+
var _a, _b, _c;
|
|
29
29
|
const { groupIndex, definition: { spec }, renderGridItemContent, ...others } = props;
|
|
30
|
-
const [isOpen, setIsOpen] = (0, react_1.useState)(
|
|
30
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)((_c = (_b = (_a = spec.display) === null || _a === void 0 ? void 0 : _a.collapse) === null || _b === void 0 ? void 0 : _b.open) !== null && _c !== void 0 ? _c : true);
|
|
31
31
|
const { isEditMode } = (0, context_1.useEditMode)();
|
|
32
32
|
const gridItems = [];
|
|
33
33
|
spec.items.forEach((item, idx) => {
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
// Copyright 2022 The Perses Authors
|
|
9
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
// you may not use this file except in compliance with the License.
|
|
11
|
+
// You may obtain a copy of the License at
|
|
12
|
+
//
|
|
13
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
//
|
|
15
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
// See the License for the specific language governing permissions and
|
|
19
|
+
// limitations under the License.
|
|
20
|
+
const material_1 = require("@mui/material");
|
|
21
|
+
const components_1 = require("@perses-dev/components");
|
|
22
|
+
const components_2 = require("../../components");
|
|
23
|
+
const PanelGroupDialog_1 = __importDefault(require("../../components/PanelGroupDialog/PanelGroupDialog"));
|
|
24
|
+
const PanelDrawer_1 = __importDefault(require("../../components/PanelDrawer/PanelDrawer"));
|
|
25
|
+
const DashboardToolbar_1 = require("../../components/DashboardToolbar");
|
|
26
|
+
const context_1 = require("../../context");
|
|
27
|
+
const DashboardApp = (props) => {
|
|
28
|
+
const { dashboardResource } = props;
|
|
29
|
+
const { dashboard } = (0, context_1.useDashboard)();
|
|
30
|
+
const { panelGroupDialog } = (0, context_1.useDashboardApp)();
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
32
|
+
padding: (theme) => theme.spacing(1, 2),
|
|
33
|
+
flexGrow: 1,
|
|
34
|
+
overflowX: 'hidden',
|
|
35
|
+
overflowY: 'auto',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
flexDirection: 'column',
|
|
38
|
+
}, children: [(0, jsx_runtime_1.jsx)(DashboardToolbar_1.DashboardToolbar, { dashboardName: dashboardResource.metadata.name }), (0, jsx_runtime_1.jsx)(components_1.ErrorBoundary, { FallbackComponent: components_1.ErrorAlert, children: (0, jsx_runtime_1.jsx)(components_2.TemplateVariableList, {}) }), (0, jsx_runtime_1.jsx)(components_1.ErrorBoundary, { FallbackComponent: components_1.ErrorAlert, children: (0, jsx_runtime_1.jsx)(components_2.Dashboard, { spec: dashboard }) }), (0, jsx_runtime_1.jsx)(PanelDrawer_1.default, {}), panelGroupDialog && (0, jsx_runtime_1.jsx)(PanelGroupDialog_1.default, {})] }));
|
|
39
|
+
};
|
|
40
|
+
exports.DashboardApp = DashboardApp;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ViewDashboard = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
// Copyright
|
|
5
|
+
// Copyright 2022 The Perses Authors
|
|
6
6
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
// you may not use this file except in compliance with the License.
|
|
8
8
|
// You may obtain a copy of the License at
|
|
@@ -15,16 +15,19 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
// See the License for the specific language governing permissions and
|
|
16
16
|
// limitations under the License.
|
|
17
17
|
const react_1 = require("react");
|
|
18
|
+
const material_1 = require("@mui/material");
|
|
18
19
|
const core_1 = require("@perses-dev/core");
|
|
19
20
|
const plugin_system_1 = require("@perses-dev/plugin-system");
|
|
20
|
-
const
|
|
21
|
+
const components_1 = require("@perses-dev/components");
|
|
22
|
+
const context_1 = require("../../context");
|
|
21
23
|
const DashboardApp_1 = require("./DashboardApp");
|
|
22
24
|
/**
|
|
23
25
|
* The View for displaying a Dashboard, along with the UI for selecting variable values.
|
|
24
26
|
*/
|
|
25
27
|
function ViewDashboard(props) {
|
|
26
28
|
var _a;
|
|
27
|
-
const { dashboardResource
|
|
29
|
+
const { dashboardResource, sx, ...others } = props;
|
|
30
|
+
const { spec } = dashboardResource;
|
|
28
31
|
const { queryString, setQueryString } = (0, plugin_system_1.useQueryString)();
|
|
29
32
|
const dashboardDuration = (_a = spec.duration) !== null && _a !== void 0 ? _a : '1h';
|
|
30
33
|
const defaultTimeRange = (0, core_1.getDefaultTimeRange)(dashboardDuration, queryString);
|
|
@@ -38,6 +41,12 @@ function ViewDashboard(props) {
|
|
|
38
41
|
setQueryString(queryString);
|
|
39
42
|
}
|
|
40
43
|
}, [dashboardDuration, queryString, setQueryString]);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(context_1.DashboardProvider, { initialState: { dashboardSpec: spec }, children: (0, jsx_runtime_1.jsx)(context_1.TimeRangeProvider, { initialTimeRange: defaultTimeRange, children: (0, jsx_runtime_1.jsx)(context_1.TemplateVariableProvider, { initialVariableDefinitions: spec.variables, children: (0, jsx_runtime_1.jsx)(
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(context_1.DashboardProvider, { initialState: { dashboardSpec: spec }, children: (0, jsx_runtime_1.jsx)(context_1.TimeRangeProvider, { initialTimeRange: defaultTimeRange, children: (0, jsx_runtime_1.jsx)(context_1.TemplateVariableProvider, { initialVariableDefinitions: spec.variables, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: (0, components_1.combineSx)({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
position: 'relative',
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
}, sx), ...others, children: (0, jsx_runtime_1.jsx)(components_1.ErrorBoundary, { FallbackComponent: components_1.ErrorAlert, children: (0, jsx_runtime_1.jsx)(DashboardApp_1.DashboardApp, { dashboardResource: dashboardResource }) }) }) }) }) }));
|
|
42
51
|
}
|
|
43
52
|
exports.ViewDashboard = ViewDashboard;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
__exportStar(require("./ViewDashboard"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useState}from"react";import{Responsive,WidthProvider}from"react-grid-layout";import{Box,Collapse,GlobalStyles}from"@mui/material";import{styles}from"../../css/styles";import{useEditMode}from"../../context";import{GridTitle}from"./GridTitle";const ResponsiveGridLayout=WidthProvider(Responsive);export function GridLayout(e){var s,i;const{groupIndex:
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useState}from"react";import{Responsive,WidthProvider}from"react-grid-layout";import{Box,Collapse,GlobalStyles}from"@mui/material";import{styles}from"../../css/styles";import{useEditMode}from"../../context";import{GridTitle}from"./GridTitle";const ResponsiveGridLayout=WidthProvider(Responsive);export function GridLayout(e){var s,i,o;const{groupIndex:t,definition:{spec:r},renderGridItemContent:l,...d}=e,[a,n]=useState(null===(o=null===(i=null===(s=r.display)||void 0===s?void 0:s.collapse)||void 0===i?void 0:i.open)||void 0===o||o),{isEditMode:p}=useEditMode(),m=[];return r.items.forEach(((e,s)=>{const{x:i,y:o,width:r,height:d}=e;m.push(_jsx("div",{"data-grid":{x:i,y:o,w:r,h:d},children:l(e,t)},s))})),_jsxs(_Fragment,{children:[_jsx(GlobalStyles,{styles}),_jsxs(Box,{...d,component:"section",sx:{"& + &":{marginTop:e=>e.spacing(1)}},children:[void 0!==r.display&&_jsx(GridTitle,{groupIndex:t,title:r.display.title,collapse:void 0===r.display.collapse?void 0:{isOpen:a,onToggleOpen:()=>n((e=>!e))}}),_jsx(Collapse,{in:a,unmountOnExit:!0,children:_jsx(ResponsiveGridLayout,{className:"layout",breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:24,md:24,sm:24,xs:24,xxs:2},rowHeight:30,draggableHandle:".drag-handle",resizeHandles:["se"],isDraggable:p,isResizable:p,children:m})})]})]})}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DashboardResource } from '@perses-dev/core';
|
|
3
|
+
export interface DashboardAppProps {
|
|
4
|
+
dashboardResource: DashboardResource;
|
|
5
|
+
}
|
|
6
|
+
export declare const DashboardApp: (props: DashboardAppProps) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=DashboardApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardApp.d.ts","sourceRoot":"","sources":["../../../src/views/ViewDashboard/DashboardApp.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,UAAW,iBAAiB,gBA0BpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Box}from"@mui/material";import{ErrorAlert,ErrorBoundary}from"@perses-dev/components";import{TemplateVariableList,Dashboard}from"../../components";import PanelGroupDialog from"../../components/PanelGroupDialog/PanelGroupDialog";import PanelDrawer from"../../components/PanelDrawer/PanelDrawer";import{DashboardToolbar}from"../../components/DashboardToolbar";import{useDashboard,useDashboardApp}from"../../context";export const DashboardApp=r=>{const{dashboardResource:o}=r,{dashboard:a}=useDashboard(),{panelGroupDialog:e}=useDashboardApp();return _jsxs(Box,{sx:{padding:r=>r.spacing(1,2),flexGrow:1,overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column"},children:[_jsx(DashboardToolbar,{dashboardName:o.metadata.name}),_jsx(ErrorBoundary,{FallbackComponent:ErrorAlert,children:_jsx(TemplateVariableList,{})}),_jsx(ErrorBoundary,{FallbackComponent:ErrorAlert,children:_jsx(Dashboard,{spec:a})}),_jsx(PanelDrawer,{}),e&&_jsx(PanelGroupDialog,{})]})};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BoxProps } from '@mui/material';
|
|
3
3
|
import { DashboardResource } from '@perses-dev/core';
|
|
4
|
-
export interface ViewDashboardProps extends BoxProps {
|
|
4
|
+
export interface ViewDashboardProps extends Omit<BoxProps, 'children'> {
|
|
5
5
|
dashboardResource: DashboardResource;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewDashboard.d.ts","sourceRoot":"","sources":["../../../src/views/ViewDashboard/ViewDashboard.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AAM1E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IACpE,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eA4CtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect}from"react";import{Box}from"@mui/material";import{getDefaultTimeRange}from"@perses-dev/core";import{useQueryString}from"@perses-dev/plugin-system";import{ErrorBoundary,ErrorAlert,combineSx}from"@perses-dev/components";import{TimeRangeProvider,TemplateVariableProvider,DashboardProvider}from"../../context";import{DashboardApp}from"./DashboardApp";export function ViewDashboard(r){var e;const{dashboardResource:i,sx:o,...a}=r,{spec:t}=i,{queryString:s,setQueryString:n}=useQueryString(),d=null!==(e=t.duration)&&void 0!==e?e:"1h",m=getDefaultTimeRange(d,s);return useEffect((()=>{!Object.fromEntries([...s]).start&&n&&(s.set("start",d),n(s))}),[d,s,n]),_jsx(DashboardProvider,{initialState:{dashboardSpec:t},children:_jsx(TimeRangeProvider,{initialTimeRange:m,children:_jsx(TemplateVariableProvider,{initialVariableDefinitions:t.variables,children:_jsx(Box,{sx:combineSx({display:"flex",width:"100%",height:"100%",position:"relative",overflow:"hidden"},o),...a,children:_jsx(ErrorBoundary,{FallbackComponent:ErrorAlert,children:_jsx(DashboardApp,{dashboardResource:i})})})})})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ViewDashboard/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./ViewDashboard";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/dashboards",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "The dashboards feature in Perses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@perses-dev/components": "^0.8.
|
|
28
|
-
"@perses-dev/core": "^0.8.
|
|
29
|
-
"@perses-dev/plugin-system": "^0.8.
|
|
27
|
+
"@perses-dev/components": "^0.8.1",
|
|
28
|
+
"@perses-dev/core": "^0.8.1",
|
|
29
|
+
"@perses-dev/plugin-system": "^0.8.1",
|
|
30
30
|
"@types/react-grid-layout": "^1.3.2",
|
|
31
31
|
"immer": "^9.0.15",
|
|
32
32
|
"react-grid-layout": "^1.3.4",
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
// Copyright 2022 The Perses Authors
|
|
9
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
// you may not use this file except in compliance with the License.
|
|
11
|
-
// You may obtain a copy of the License at
|
|
12
|
-
//
|
|
13
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
//
|
|
15
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
// See the License for the specific language governing permissions and
|
|
19
|
-
// limitations under the License.
|
|
20
|
-
const material_1 = require("@mui/material");
|
|
21
|
-
const components_1 = require("@perses-dev/components");
|
|
22
|
-
const components_2 = require("../components");
|
|
23
|
-
const PanelGroupDialog_1 = __importDefault(require("../components/PanelGroupDialog/PanelGroupDialog"));
|
|
24
|
-
const PanelDrawer_1 = __importDefault(require("../components/PanelDrawer/PanelDrawer"));
|
|
25
|
-
const DashboardToolbar_1 = require("../components/DashboardToolbar");
|
|
26
|
-
const context_1 = require("../context");
|
|
27
|
-
const DashboardApp = (props) => {
|
|
28
|
-
const { dashboardResource, sx, children, ...others } = props;
|
|
29
|
-
const { dashboard } = (0, context_1.useDashboard)();
|
|
30
|
-
const { panelGroupDialog } = (0, context_1.useDashboardApp)();
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: (0, components_1.combineSx)({
|
|
32
|
-
display: 'flex',
|
|
33
|
-
width: '100%',
|
|
34
|
-
height: '100%',
|
|
35
|
-
position: 'relative',
|
|
36
|
-
overflow: 'hidden',
|
|
37
|
-
}, sx), ...others, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
38
|
-
padding: (theme) => theme.spacing(1, 2),
|
|
39
|
-
flexGrow: 1,
|
|
40
|
-
overflowX: 'hidden',
|
|
41
|
-
overflowY: 'auto',
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flexDirection: 'column',
|
|
44
|
-
}, children: [(0, jsx_runtime_1.jsx)(DashboardToolbar_1.DashboardToolbar, { dashboardName: dashboardResource.metadata.name }), (0, jsx_runtime_1.jsx)(components_2.TemplateVariableList, {}), (0, jsx_runtime_1.jsx)(components_2.Dashboard, { spec: dashboard }), (0, jsx_runtime_1.jsx)(PanelDrawer_1.default, {}), panelGroupDialog && (0, jsx_runtime_1.jsx)(PanelGroupDialog_1.default, {}), children] }) }));
|
|
45
|
-
};
|
|
46
|
-
exports.DashboardApp = DashboardApp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardApp.d.ts","sourceRoot":"","sources":["../../src/views/DashboardApp.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,eAAO,MAAM,YAAY,UAAW,kBAAkB,gBAqCrD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Box}from"@mui/material";import{combineSx}from"@perses-dev/components";import{TemplateVariableList,Dashboard}from"../components";import PanelGroupDialog from"../components/PanelGroupDialog/PanelGroupDialog";import PanelDrawer from"../components/PanelDrawer/PanelDrawer";import{DashboardToolbar}from"../components/DashboardToolbar";import{useDashboard,useDashboardApp}from"../context";export const DashboardApp=o=>{const{dashboardResource:a,sx:r,children:e,...s}=o,{dashboard:i}=useDashboard(),{panelGroupDialog:n}=useDashboardApp();return _jsx(Box,{sx:combineSx({display:"flex",width:"100%",height:"100%",position:"relative",overflow:"hidden"},r),...s,children:_jsxs(Box,{sx:{padding:o=>o.spacing(1,2),flexGrow:1,overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column"},children:[_jsx(DashboardToolbar,{dashboardName:a.metadata.name}),_jsx(TemplateVariableList,{}),_jsx(Dashboard,{spec:i}),_jsx(PanelDrawer,{}),n&&_jsx(PanelGroupDialog,{}),e]})})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDashboard.d.ts","sourceRoot":"","sources":["../../src/views/ViewDashboard.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AAK1E,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eA8BtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect}from"react";import{getDefaultTimeRange}from"@perses-dev/core";import{useQueryString}from"@perses-dev/plugin-system";import{TimeRangeProvider,TemplateVariableProvider,DashboardProvider}from"../context";import{DashboardApp}from"./DashboardApp";export function ViewDashboard(e){var r;const{dashboardResource:{spec:i},children:a}=e,{queryString:t,setQueryString:o}=useQueryString(),s=null!==(r=i.duration)&&void 0!==r?r:"1h",n=getDefaultTimeRange(s,t);return useEffect((()=>{!Object.fromEntries([...t]).start&&o&&(t.set("start",s),o(t))}),[s,t,o]),_jsx(DashboardProvider,{initialState:{dashboardSpec:i},children:_jsx(TimeRangeProvider,{initialTimeRange:n,children:_jsx(TemplateVariableProvider,{initialVariableDefinitions:i.variables,children:_jsx(DashboardApp,{...e,children:a})})})})}
|