SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat: show dashboard in full screen (#4040)
Yunus Me7f9c3981bae
diff --git a/frontend/package.json b/frontend/package.jsonindex 0c79c47b1d..25036d24fe 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -82,6 +82,7 @@"react-drag-listview": "2.0.0","react-error-boundary": "4.0.11","react-force-graph": "^1.43.0",+ "react-full-screen": "1.1.1","react-grid-layout": "^1.3.4","react-helmet-async": "1.3.0","react-i18next": "^11.16.1",diff --git a/frontend/public/locales/en/dashboard.json b/frontend/public/locales/en/dashboard.jsonindex 7c4b894e76..5602ec5592 100644--- a/frontend/public/locales/en/dashboard.json+++ b/frontend/public/locales/en/dashboard.json@@ -17,6 +17,7 @@"layout_saved_successfully": "Layout saved successfully","add_panel": "Add Panel","save_layout": "Save Layout",+ "full_view": "Full Screen View","variable_updated_successfully": "Variable updated successfully","error_while_updating_variable": "Error while updating variable","dashboard_has_been_updated": "Dashboard has been updated",diff --git a/frontend/src/container/GridCardLayout/GridCardLayout.styles.scss b/frontend/src/container/GridCardLayout/GridCardLayout.styles.scssnew file mode 100644index 0000000000..08de391e4c--- /dev/null+++ b/frontend/src/container/GridCardLayout/GridCardLayout.styles.scss@@ -0,0 +1,7 @@+.fullscreen-grid-container {+ overflow: auto;++ .react-grid-layout {+ border: none !important;+ }+}diff --git a/frontend/src/container/GridCardLayout/GridCardLayout.tsx b/frontend/src/container/GridCardLayout/GridCardLayout.tsxindex e3a346ef82..19d7244f5e 100644--- a/frontend/src/container/GridCardLayout/GridCardLayout.tsx+++ b/frontend/src/container/GridCardLayout/GridCardLayout.tsx@@ -1,3 +1,5 @@+import './GridCardLayout.styles.scss';+import { PlusOutlined, SaveFilled } from '@ant-design/icons';import { SOMETHING_WENT_WRONG } from 'constants/api';import { PANEL_TYPES } from 'constants/queryBuilder';@@ -5,7 +7,9 @@ import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard';import useComponentPermission from 'hooks/useComponentPermission';import { useIsDarkMode } from 'hooks/useDarkMode';import { useNotifications } from 'hooks/useNotifications';+import { FullscreenIcon } from 'lucide-react';import { useDashboard } from 'providers/Dashboard/Dashboard';+import { FullScreen, useFullScreenHandle } from 'react-full-screen';import { useTranslation } from 'react-i18next';import { useSelector } from 'react-redux';import { AppState } from 'store/reducers';@@ -34,6 +38,7 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element {isDashboardLocked,} = useDashboard();const { data } = selectedDashboard || {};+ const handle = useFullScreenHandle();const { widgets, variables } = data || {};@@ -106,6 +111,15 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element {<>{!isDashboardLocked && (<ButtonContainer>+ <Button+ loading={updateDashboardMutation.isLoading}+ onClick={handle.enter}+ icon={<FullscreenIcon size={16} />}+ disabled={updateDashboardMutation.isLoading}+ >+ {t('dashboard:full_view')}+ </Button>+{saveLayoutPermission && (<Buttonloading={updateDashboardMutation.isLoading}@@ -129,46 +143,48 @@ function GraphLayout({ onAddPanelHandler }: GraphLayoutProps): JSX.Element {</ButtonContainer>)}- <ReactGridLayout- cols={12}- rowHeight={100}- autoSize- width={100}- useCSSTransforms- isDraggable={!isDashboardLocked && addPanelPermission}- isDroppable={!isDashboardLocked && addPanelPermission}- isResizable={!isDashboardLocked && addPanelPermission}- allowOverlap={false}- onLayoutChange={setLayouts}- draggableHandle=".drag-handle"- layout={layouts}- >- {layouts.map((layout) => {- const { i: id } = layout;- const currentWidget = (widgets || [])?.find((e) => e.id === id);-- return (- <CardContainer- className={isDashboardLocked ? '' : 'enable-resize'}- isDarkMode={isDarkMode}- key={id}- data-grid={layout}- >- <Card- className="grid-item"- $panelType={currentWidget?.panelTypes || PANEL_TYPES.TIME_SERIES}+ <FullScreen handle={handle} className="fullscreen-grid-container">+ <ReactGridLayout+ cols={12}+ rowHeight={100}+ autoSize+ width={100}+ useCSSTransforms+ isDraggable={!isDashboardLocked && addPanelPermission}+ isDroppable={!isDashboardLocked && addPanelPermission}+ isResizable={!isDashboardLocked && addPanelPermission}+ allowOverlap={false}+ onLayoutChange={setLayouts}+ draggableHandle=".drag-handle"+ layout={layouts}+ >+ {layouts.map((layout) => {+ const { i: id } = layout;+ const currentWidget = (widgets || [])?.find((e) => e.id === id);++ return (+ <CardContainer+ className={isDashboardLocked ? '' : 'enable-resize'}+ isDarkMode={isDarkMode}+ key={id}+ data-grid={layout}>- <GridCard- widget={currentWidget || ({ id, query: {} } as Widgets)}- name={currentWidget?.id || ''}- headerMenuList={widgetActions}- variables={variables}- />- </Card>- </CardContainer>- );- })}- </ReactGridLayout>+ <Card+ className="grid-item"+ $panelType={currentWidget?.panelTypes || PANEL_TYPES.TIME_SERIES}+ >+ <GridCard+ widget={currentWidget || ({ id, query: {} } as Widgets)}+ name={currentWidget?.id || ''}+ headerMenuList={widgetActions}+ variables={variables}+ />+ </Card>+ </CardContainer>+ );+ })}+ </ReactGridLayout>+ </FullScreen></>);}diff --git a/frontend/yarn.lock b/frontend/yarn.lockindex a3c9a0449f..c4fb7cd456 100644--- a/frontend/yarn.lock+++ b/frontend/yarn.lock@@ -7803,6 +7803,11 @@ fs.realpath@^1.0.0:resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==+fscreen@^1.0.2:+ version "1.2.0"+ resolved "https://registry.yarnpkg.com/fscreen/-/fscreen-1.2.0.tgz#1a8c88e06bc16a07b473ad96196fb06d6657f59e"+ integrity sha512-hlq4+BU0hlPmwsFjwGGzZ+OZ9N/wq9Ljg/sq3pX+2CD7hrJsX9tJgWWK/wiNTFM212CLHWhicOoqwXyZGGetJg==+[email protected], fsevents@^2.3.2, fsevents@~2.3.2:version "2.3.2"resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"@@ -12850,6 +12855,13 @@ react-force-graph@^1.43.0:prop-types "15"react-kapsule "2"+ version "1.1.1"+ resolved "https://registry.yarnpkg.com/react-full-screen/-/react-full-screen-1.1.1.tgz#b707d56891015a71c503a65dbab3086d75be97d7"+ integrity sha512-xoEgkoTiN0dw9cjYYGViiMCBYbkS97BYb4bHPhQVWXj1UnOs8PZ1rPzpX+2HMhuvQV1jA5AF9GaRbO3fA5aZtg==+ dependencies:+ fscreen "^1.0.2"+react-grid-layout@^1.3.4:version "1.3.4"resolved "https://registry.npmjs.org/react-grid-layout/-/react-grid-layout-1.3.4.tgz"