mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 04:26:02 +08:00
commit
0ab09c1c67
@ -146,7 +146,7 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
|
||||||
query-service:
|
query-service:
|
||||||
image: signoz/query-service:0.33.0
|
image: signoz/query-service:0.33.1
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
"-config=/root/config/prometheus.yml",
|
"-config=/root/config/prometheus.yml",
|
||||||
@ -186,7 +186,7 @@ services:
|
|||||||
<<: *db-depend
|
<<: *db-depend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: signoz/frontend:0.33.0
|
image: signoz/frontend:0.33.1
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
@ -164,7 +164,7 @@ services:
|
|||||||
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
||||||
|
|
||||||
query-service:
|
query-service:
|
||||||
image: signoz/query-service:${DOCKER_TAG:-0.33.0}
|
image: signoz/query-service:${DOCKER_TAG:-0.33.1}
|
||||||
container_name: signoz-query-service
|
container_name: signoz-query-service
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
@ -203,7 +203,7 @@ services:
|
|||||||
<<: *db-depend
|
<<: *db-depend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: signoz/frontend:${DOCKER_TAG:-0.33.0}
|
image: signoz/frontend:${DOCKER_TAG:-0.33.1}
|
||||||
container_name: signoz-frontend
|
container_name: signoz-frontend
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -6,10 +6,10 @@ import Label from './Label';
|
|||||||
export const getLabel = (
|
export const getLabel = (
|
||||||
labelClickedHandler: (labelIndex: number) => void,
|
labelClickedHandler: (labelIndex: number) => void,
|
||||||
): ColumnType<DataSetProps> => ({
|
): ColumnType<DataSetProps> => ({
|
||||||
render: (label: string, _, index): JSX.Element => (
|
render: (label, record): JSX.Element => (
|
||||||
<Label
|
<Label
|
||||||
label={label}
|
label={label}
|
||||||
labelIndex={index}
|
labelIndex={record.index}
|
||||||
labelClickedHandler={labelClickedHandler}
|
labelClickedHandler={labelClickedHandler}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
@ -20,10 +20,10 @@ export const getGraphManagerTableColumns = ({
|
|||||||
width: 50,
|
width: 50,
|
||||||
dataIndex: ColumnsKeyAndDataIndex.Index,
|
dataIndex: ColumnsKeyAndDataIndex.Index,
|
||||||
key: ColumnsKeyAndDataIndex.Index,
|
key: ColumnsKeyAndDataIndex.Index,
|
||||||
render: (_: string, __: DataSetProps, index: number): JSX.Element => (
|
render: (_: string, record: DataSetProps): JSX.Element => (
|
||||||
<CustomCheckBox
|
<CustomCheckBox
|
||||||
data={data}
|
data={data}
|
||||||
index={index}
|
index={record.index}
|
||||||
checkBoxOnChangeHandler={checkBoxOnChangeHandler}
|
checkBoxOnChangeHandler={checkBoxOnChangeHandler}
|
||||||
graphVisibilityState={graphVisibilityState}
|
graphVisibilityState={graphVisibilityState}
|
||||||
/>
|
/>
|
||||||
|
@ -59,20 +59,21 @@ function WidgetGraphComponent({
|
|||||||
[data, name],
|
[data, name],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [graphsVisibilityStates, setGraphsVisibilityStates] = useState<
|
||||||
|
boolean[]
|
||||||
|
>(localStoredVisibilityStates);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!lineChartRef.current) return;
|
if (!lineChartRef.current) return;
|
||||||
|
|
||||||
localStoredVisibilityStates.forEach((state, index) => {
|
localStoredVisibilityStates.forEach((state, index) => {
|
||||||
lineChartRef.current?.toggleGraph(index, state);
|
lineChartRef.current?.toggleGraph(index, state);
|
||||||
});
|
});
|
||||||
|
setGraphsVisibilityStates(localStoredVisibilityStates);
|
||||||
}, [localStoredVisibilityStates]);
|
}, [localStoredVisibilityStates]);
|
||||||
|
|
||||||
const { setLayouts, selectedDashboard, setSelectedDashboard } = useDashboard();
|
const { setLayouts, selectedDashboard, setSelectedDashboard } = useDashboard();
|
||||||
|
|
||||||
const [graphsVisibilityStates, setGraphsVisibilityStates] = useState<
|
|
||||||
boolean[]
|
|
||||||
>(localStoredVisibilityStates);
|
|
||||||
|
|
||||||
const { featureResponse } = useSelector<AppState, AppReducer>(
|
const { featureResponse } = useSelector<AppState, AppReducer>(
|
||||||
(state) => state.app,
|
(state) => state.app,
|
||||||
);
|
);
|
||||||
|
@ -125,7 +125,7 @@ function GraphLayout({
|
|||||||
<CardContainer isDarkMode={isDarkMode} key={id} data-grid={layout}>
|
<CardContainer isDarkMode={isDarkMode} key={id} data-grid={layout}>
|
||||||
<Card $panelType={currentWidget?.panelTypes || PANEL_TYPES.TIME_SERIES}>
|
<Card $panelType={currentWidget?.panelTypes || PANEL_TYPES.TIME_SERIES}>
|
||||||
<GridCard
|
<GridCard
|
||||||
widget={currentWidget || ({ id } as Widgets)}
|
widget={currentWidget || ({ id, query: {} } as Widgets)}
|
||||||
name={currentWidget?.id || ''}
|
name={currentWidget?.id || ''}
|
||||||
headerMenuList={headerMenuList}
|
headerMenuList={headerMenuList}
|
||||||
/>
|
/>
|
||||||
|
@ -6,6 +6,7 @@ import Editor from 'components/Editor';
|
|||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import { MESSAGE } from 'hooks/useFeatureFlag';
|
import { MESSAGE } from 'hooks/useFeatureFlag';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
|
import { getUpdatedLayout } from 'lib/dashboard/getUpdatedLayout';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -65,6 +66,12 @@ function ImportJSON({
|
|||||||
setDashboardCreating(true);
|
setDashboardCreating(true);
|
||||||
const dashboardData = JSON.parse(editorValue) as DashboardData;
|
const dashboardData = JSON.parse(editorValue) as DashboardData;
|
||||||
|
|
||||||
|
if (dashboardData?.layout) {
|
||||||
|
dashboardData.layout = getUpdatedLayout(dashboardData.layout);
|
||||||
|
} else {
|
||||||
|
dashboardData.layout = [];
|
||||||
|
}
|
||||||
|
|
||||||
const response = await createDashboard({
|
const response = await createDashboard({
|
||||||
...dashboardData,
|
...dashboardData,
|
||||||
uploadedGrafana,
|
uploadedGrafana,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
.query-table {
|
.query-table {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
height: inherit;
|
||||||
.query-table--download {
|
.query-table--download {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
|
23
frontend/src/lib/dashboard/getUpdatedLayout.ts
Normal file
23
frontend/src/lib/dashboard/getUpdatedLayout.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
|
import { Layout } from 'react-grid-layout';
|
||||||
|
|
||||||
|
export const getUpdatedLayout = (layout?: Layout[]): Layout[] => {
|
||||||
|
let widgetLayout = layout;
|
||||||
|
|
||||||
|
// filter empty from i from i due to previous version of signoz
|
||||||
|
widgetLayout = layout?.filter((i) => i.i !== 'empty');
|
||||||
|
|
||||||
|
const seen = new Set();
|
||||||
|
|
||||||
|
// filter duplicate i values
|
||||||
|
widgetLayout = widgetLayout?.filter((i) => {
|
||||||
|
const duplicate = seen.has(i.i);
|
||||||
|
seen.add(i.i);
|
||||||
|
return !duplicate;
|
||||||
|
});
|
||||||
|
|
||||||
|
// filter EMPTY_WIDGET from i due to previous version of signoz
|
||||||
|
widgetLayout = widgetLayout?.filter((i) => i.i !== PANEL_TYPES.EMPTY_WIDGET);
|
||||||
|
|
||||||
|
return widgetLayout || [];
|
||||||
|
};
|
@ -1,11 +1,11 @@
|
|||||||
import { Modal } from 'antd';
|
import { Modal } from 'antd';
|
||||||
import get from 'api/dashboard/get';
|
import get from 'api/dashboard/get';
|
||||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import { getMinMax } from 'container/TopNav/AutoRefresh/config';
|
import { getMinMax } from 'container/TopNav/AutoRefresh/config';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
import useTabVisibility from 'hooks/useTabFocus';
|
import useTabVisibility from 'hooks/useTabFocus';
|
||||||
|
import { getUpdatedLayout } from 'lib/dashboard/getUpdatedLayout';
|
||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
PropsWithChildren,
|
PropsWithChildren,
|
||||||
@ -107,11 +107,7 @@ export function DashboardProvider({
|
|||||||
|
|
||||||
dashboardRef.current = data;
|
dashboardRef.current = data;
|
||||||
|
|
||||||
setLayouts(
|
setLayouts(getUpdatedLayout(data.data.layout));
|
||||||
data.data.layout?.filter(
|
|
||||||
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
|
|
||||||
) || [],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -147,11 +143,7 @@ export function DashboardProvider({
|
|||||||
|
|
||||||
updatedTimeRef.current = dayjs(data.updated_at);
|
updatedTimeRef.current = dayjs(data.updated_at);
|
||||||
|
|
||||||
setLayouts(
|
setLayouts(getUpdatedLayout(data.data.layout));
|
||||||
data.data.layout?.filter(
|
|
||||||
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
|
|
||||||
) || [],
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -164,11 +156,7 @@ export function DashboardProvider({
|
|||||||
|
|
||||||
setSelectedDashboard(data);
|
setSelectedDashboard(data);
|
||||||
|
|
||||||
setLayouts(
|
setLayouts(getUpdatedLayout(data.data.layout));
|
||||||
data.data.layout?.filter(
|
|
||||||
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
|
|
||||||
) || [],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.21
|
|||||||
require (
|
require (
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.14.0
|
github.com/ClickHouse/clickhouse-go/v2 v2.14.0
|
||||||
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb
|
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb
|
||||||
github.com/SigNoz/signoz-otel-collector v0.79.12
|
github.com/SigNoz/signoz-otel-collector v0.79.13
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974
|
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_sync v0.0.0-20230822164844-1b861a431974
|
github.com/SigNoz/zap_otlp/zap_otlp_sync v0.0.0-20230822164844-1b861a431974
|
||||||
github.com/antonmedv/expr v1.12.5
|
github.com/antonmedv/expr v1.12.5
|
||||||
|
4
go.sum
4
go.sum
@ -99,8 +99,8 @@ github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb h1:bneLSKPf9YUSFm
|
|||||||
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb/go.mod h1:JznGDNg9x1cujDKa22RaQOimOvvEfy3nxzDGd8XDgmA=
|
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb/go.mod h1:JznGDNg9x1cujDKa22RaQOimOvvEfy3nxzDGd8XDgmA=
|
||||||
github.com/SigNoz/prometheus v1.9.78 h1:bB3yuDrRzi/Mv00kWayR9DZbyjTuGfendSqISyDcXiY=
|
github.com/SigNoz/prometheus v1.9.78 h1:bB3yuDrRzi/Mv00kWayR9DZbyjTuGfendSqISyDcXiY=
|
||||||
github.com/SigNoz/prometheus v1.9.78/go.mod h1:MffmFu2qFILQrOHehx3D0XjYtaZMVfI+Ppeiv98x4Ww=
|
github.com/SigNoz/prometheus v1.9.78/go.mod h1:MffmFu2qFILQrOHehx3D0XjYtaZMVfI+Ppeiv98x4Ww=
|
||||||
github.com/SigNoz/signoz-otel-collector v0.79.12 h1:0yDMhcN7Taa8WrFv8YrHRaDvRxHqLfp5c6w1TSEWk+I=
|
github.com/SigNoz/signoz-otel-collector v0.79.13 h1:An8tJwvIpbfyC2Gtxs/Z424jLbKO2a6W7UzQ64G5/zI=
|
||||||
github.com/SigNoz/signoz-otel-collector v0.79.12/go.mod h1:MXjHt3atjTAF2Wrqu0W7Xx+oJ1yb8UfpsNu+A8Ssjtg=
|
github.com/SigNoz/signoz-otel-collector v0.79.13/go.mod h1:P6tjd7wTHgHvBk6lHAXR++EuQaGY2mGu0aQWyI086qs=
|
||||||
github.com/SigNoz/zap_otlp v0.1.0 h1:T7rRcFN87GavY8lDGZj0Z3Xv6OhJA6Pj3I9dNPmqvRc=
|
github.com/SigNoz/zap_otlp v0.1.0 h1:T7rRcFN87GavY8lDGZj0Z3Xv6OhJA6Pj3I9dNPmqvRc=
|
||||||
github.com/SigNoz/zap_otlp v0.1.0/go.mod h1:lcHvbDbRgvDnPxo9lDlaL1JK2PyOyouP/C3ynnYIvyo=
|
github.com/SigNoz/zap_otlp v0.1.0/go.mod h1:lcHvbDbRgvDnPxo9lDlaL1JK2PyOyouP/C3ynnYIvyo=
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974 h1:PKVgdf83Yw+lZJbFtNGBgqXiXNf3+kOXW2qZ7Ms7OaY=
|
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974 h1:PKVgdf83Yw+lZJbFtNGBgqXiXNf3+kOXW2qZ7Ms7OaY=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user