diff --git a/web/src/components/Overview/Monitor/index.jsx b/web/src/components/Overview/Monitor/index.jsx index c1b006b3..1ccaa538 100644 --- a/web/src/components/Overview/Monitor/index.jsx +++ b/web/src/components/Overview/Monitor/index.jsx @@ -158,7 +158,7 @@ const Monitor = (props) => { return monitor_configs?.node_stats?.enabled === false && monitor_configs?.index_stats?.enabled === false } return metric_collection_mode === 'agent' - }, [JSON.stringify(selectedCluster?.monitor_configs)]) + }, [JSON.stringify(selectedCluster)]) return (
@@ -170,46 +170,48 @@ const Monitor = (props) => { <>
- { - handleTimeChange({ start, end }) - }} - {...refresh} - onRefreshChange={(newRefresh) => { - onTimeSettingsChange(newRefresh) - setRefresh(newRefresh) - }} - onRefresh={(value) => handleTimeChange({ ...(value || {}), refresh: new Date().valueOf()})} - showTimeSetting={true} - showTimeInterval={true} - timeInterval={state.timeInterval} - timeIntervalDisabled={state.timeIntervalDisabled} - showTimeout={true} - timeout={state.timeout} - onTimeSettingChange={(timeSetting) => { - onTimeSettingsChange({ - timeInterval: timeSetting.timeInterval, - timeout: timeSetting.timeout - }) - setState({ - ...state, - param, - timeInterval: timeSetting.timeInterval, - timeout: timeSetting.timeout - }); - }} - timeZone={timeZone} - onTimeZoneChange={(timeZone) => { - onTimeSettingsChange({ - timeZone, - }) - setTimeZone(timeZone) - }} - recentlyUsedRangesKey={'monitor'} - /> +
+ { + handleTimeChange({ start, end }) + }} + {...refresh} + onRefreshChange={(newRefresh) => { + onTimeSettingsChange(newRefresh) + setRefresh(newRefresh) + }} + onRefresh={(value) => handleTimeChange({ ...(value || {}), refresh: new Date().valueOf()})} + showTimeSetting={true} + showTimeInterval={true} + timeInterval={state.timeInterval} + timeIntervalDisabled={state.timeIntervalDisabled} + showTimeout={true} + timeout={state.timeout} + onTimeSettingChange={(timeSetting) => { + onTimeSettingsChange({ + timeInterval: timeSetting.timeInterval, + timeout: timeSetting.timeout + }) + setState({ + ...state, + param, + timeInterval: timeSetting.timeInterval, + timeout: timeSetting.timeout + }); + }} + timeZone={timeZone} + onTimeZoneChange={(timeZone) => { + onTimeSettingsChange({ + timeZone, + }) + setTimeZone(timeZone) + }} + recentlyUsedRangesKey={'monitor'} + /> +
diff --git a/web/src/components/vendor/discover/public/application/components/histogram/histogram.jsx b/web/src/components/vendor/discover/public/application/components/histogram/histogram.jsx index b6499bc4..27e5b23c 100644 --- a/web/src/components/vendor/discover/public/application/components/histogram/histogram.jsx +++ b/web/src/components/vendor/discover/public/application/components/histogram/histogram.jsx @@ -88,7 +88,7 @@ export class DiscoverHistogram extends Component { render() { const timeZone = getTimezone(); - const { chartData } = this.props; + const { chartData, height = 100 } = this.props; const { chartsTheme, chartsBaseTheme } = this.state; @@ -149,7 +149,7 @@ export class DiscoverHistogram extends Component { //console.log(data) return ( - + item.id === payload.id); idx > -1 && (state.clusterList[idx].name = payload.name); if (state.selectedCluster?.id === payload.id) { - state.selectedCluster.monitor_configs = payload.monitor_configs + state.selectedCluster = { + ...(state.selectedCluster || {}), + ...(payload || {}) + } } state.clusterStatus[payload.id].config.monitored = payload.monitored; return state; diff --git a/web/src/pages/DataManagement/Discover.jsx b/web/src/pages/DataManagement/Discover.jsx index cccd8fb0..bfc12207 100644 --- a/web/src/pages/DataManagement/Discover.jsx +++ b/web/src/pages/DataManagement/Discover.jsx @@ -178,6 +178,9 @@ const Discover = (props) => { field: "", enabled: false, }; + + const [histogramVisible, setHistogramVisible] = useState(false) + const [distinctParams, setDistinctParams] = React.useState( distinctParamsDefault ); @@ -1162,7 +1165,9 @@ const Discover = (props) => { showLayoutListIcon={false} histogramProps={{ histogramData, - timefilterUpdateHandler + onHistogramToggle: () => { + setHistogramVisible(!histogramVisible) + }, }} // viewLayout={viewLayout} // onViewLayoutChange={(layout) => { @@ -1310,6 +1315,31 @@ const Discover = (props) => { responsive={false} style={{ position: "relative" }} > + {histogramVisible && opts.timefield && ( + +
+ {opts.chartAggConfigs && + histogramData && + records.length !== 0 && ( +
+ +
+ )} +
+ +
+ )}
{ - const { histogramData, timefilterUpdateHandler } = props - - const [visible, setVisible] = useState(false) + const { onHistogramToggle } = props return ( - - )}> - { - setVisible(!visible) - }}/> - + { + onHistogramToggle() + }}/> ) } \ No newline at end of file diff --git a/web/src/pages/Platform/Overview/components/Logs/index.jsx b/web/src/pages/Platform/Overview/components/Logs/index.jsx index 022eaa76..3cf330fc 100644 --- a/web/src/pages/Platform/Overview/components/Logs/index.jsx +++ b/web/src/pages/Platform/Overview/components/Logs/index.jsx @@ -314,7 +314,10 @@ export default (props) => {
) : ( - + ) }