Skip to content

Commit

Permalink
ui: Replace queryTimeSpansCodes by core-ui one
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWatenbergScality committed Sep 24, 2021
1 parent 67fafc3 commit 8a8508d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/VolumeMetricsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
LAST_SEVEN_DAYS,
LAST_TWENTY_FOUR_HOURS,
LAST_ONE_HOUR,
queryTimeSpansCodes,
GRAFANA_DASHBOARDS,
} from '../constants';
import { useIntl } from 'react-intl';
Expand All @@ -30,6 +29,7 @@ import {
VolumeUsageChart,
} from './VolumeCharts';
import { SyncedCursorCharts } from '@scality/core-ui/dist/components/vegachartv2/SyncedCursorCharts';
import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants';

const MetricGraphCardContainer = styled.div`
min-height: 270px;
Expand Down
22 changes: 0 additions & 22 deletions ui/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,6 @@ export const QUERY_LAST_ONE_HOUR = 'now-1h';

export const PORT_NODE_EXPORTER = '9100';

// deprecated should retrieve from core-ui
export const queryTimeSpansCodes = [
{
label: QUERY_LAST_SEVEN_DAYS,
value: LAST_SEVEN_DAYS,
duration: SAMPLE_DURATION_LAST_SEVEN_DAYS,
frequency: SAMPLE_FREQUENCY_LAST_SEVEN_DAYS,
},
{
label: QUERY_LAST_TWENTY_FOUR_HOURS,
value: LAST_TWENTY_FOUR_HOURS,
duration: SAMPLE_DURATION_LAST_TWENTY_FOUR_HOURS,
frequency: SAMPLE_FREQUENCY_LAST_TWENTY_FOUR_HOURS,
},
{
label: QUERY_LAST_ONE_HOUR,
value: LAST_ONE_HOUR,
duration: SAMPLE_DURATION_LAST_ONE_HOUR,
frequency: SAMPLE_FREQUENCY_LAST_ONE_HOUR,
},
];

// alert
export const NODE_FILESYSTEM_SPACE_FILLINGUP = 'NodeFilesystemSpaceFillingUp';
export const NODE_FILESYSTEM_ALMOST_OUTOF_SPACE =
Expand Down
2 changes: 1 addition & 1 deletion ui/src/containers/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import {
LAST_SEVEN_DAYS,
LAST_TWENTY_FOUR_HOURS,
LAST_ONE_HOUR,
queryTimeSpansCodes,
} from '../constants';

import { useURLQuery } from '../services/utils';
import { useMetricsTimeSpan } from '@scality/core-ui/dist/next';
import { SyncedCursorCharts } from '@scality/core-ui/dist/components/vegachartv2/SyncedCursorCharts';
import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants';

const DashboardGrid = styled.div`
display: grid;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/containers/NodePageRSP.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import {
NoInstanceSelected,
} from '../components/style/CommonLayoutStyle';
import {
queryTimeSpansCodes,
NODE_ALERTS_GROUP,
PORT_NODE_EXPORTER,
} from '../constants';
import { useAlerts } from './AlertProvider';
import { useIntl } from 'react-intl';
import { queryTimeSpansCodes } from '@scality/core-ui/dist/components/constants';

// <NodePageRSP> fetches the data for all the tabs given the current selected Node
// handles the refresh for the metrics tab
Expand Down

0 comments on commit 8a8508d

Please sign in to comment.