diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index 1256e26e..d7e18cac 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -24,6 +24,8 @@ Information about release notes of INFINI Console is provided here. - Optimize metric query bucket size (#59) - Add suggestion to chart in monitor if is no data because the time interval is less than the collection interval. - Check if the cluster version supports metric transport_outbound_comnections in monitor. +- Set timeout to 10s by default in DatePicker's time settings. +- Check if the cluster version supports metric transport_outbound_comnections in monitor. - Enhanced http_client to support customizable configurations. diff --git a/web/src/common/src/DatePicker/TimeSetting.jsx b/web/src/common/src/DatePicker/TimeSetting.jsx index 5401ff75..8afc5e34 100644 --- a/web/src/common/src/DatePicker/TimeSetting.jsx +++ b/web/src/common/src/DatePicker/TimeSetting.jsx @@ -45,7 +45,7 @@ const TimeSetting = props => { const timeoutObject = useMemo(() => { if (!timeout) { return { - value: 120, + value: 10, unit: 's', } } @@ -128,10 +128,10 @@ const TimeSetting = props => { timeoutObject && ( <> { if (Number.isInteger(value)) { diff --git a/web/src/common/src/DatePicker/index.md b/web/src/common/src/DatePicker/index.md index 424e6680..38092a06 100644 --- a/web/src/common/src/DatePicker/index.md +++ b/web/src/common/src/DatePicker/index.md @@ -24,7 +24,7 @@ | showTimeInterval | 是否显示时间间隔 | boolean | false | 1.0.0 | | timeInterval | 时间间隔 | string | - | 1.0.0 | | showTimeout | 是否显示超时时间 | boolean | false | 1.0.0 | -| timeout | 超时时间 | string | 120s | 1.0.0 | +| timeout | 超时时间 | string | 10s | 1.0.0 | | onTimeSettingChange | 时间配置变更的回调 | ({timeField: string, timeInterval: string, timeout: string}) => void | - | 1.0.0 | | autoFitLoading | 自动适配时间载入状态 | boolean | false | 1.0.0 | | onAutoFit | 自动适配时间的回调 | () => void | - | 1.0.0 | diff --git a/web/src/components/ListView/components/DatePicker/index.jsx b/web/src/components/ListView/components/DatePicker/index.jsx index 5a7dcebe..cd6cf2d4 100644 --- a/web/src/components/ListView/components/DatePicker/index.jsx +++ b/web/src/components/ListView/components/DatePicker/index.jsx @@ -52,7 +52,7 @@ export default (props) => { showTimeInterval: true, timeInterval: "15s", showTimeout: true, - timeout: "120s", + timeout: "10s", }); const [currentTimeZone, setCurrentTimeZone] = useState(timeZone); diff --git a/web/src/components/Overview/Detail/Metrics/index.js b/web/src/components/Overview/Detail/Metrics/index.js index 610c3603..7d40ed49 100644 --- a/web/src/components/Overview/Detail/Metrics/index.js +++ b/web/src/components/Overview/Detail/Metrics/index.js @@ -40,7 +40,7 @@ export default (props) => { timeFormatter: formatter.dates(1), }, timeInterval: allTimeSettingsCache.timeInterval, - timeout: allTimeSettingsCache.timeout || '120s', + timeout: allTimeSettingsCache.timeout || '10s', }); const [refresh, setRefresh] = useState({ isRefreshPaused: allTimeSettingsCache.isRefreshPaused || false, refreshInterval: allTimeSettingsCache.refreshInterval || 30000 }); diff --git a/web/src/components/Overview/Monitor/index.jsx b/web/src/components/Overview/Monitor/index.jsx index 4344001c..ecbf8a7a 100644 --- a/web/src/components/Overview/Monitor/index.jsx +++ b/web/src/components/Overview/Monitor/index.jsx @@ -78,7 +78,7 @@ const Monitor = (props) => { timeFormatter: formatter.dates(1), }, timeInterval: formatTimeInterval(param?.timeInterval) || allTimeSettingsCache.timeInterval, - timeout: formatTimeout(param?.timeout) || allTimeSettingsCache.timeout || '120s', + timeout: formatTimeout(param?.timeout) || allTimeSettingsCache.timeout || '10s', param: param, refresh: true, }) diff --git a/web/src/pages/Platform/Overview/Cluster/index.tsx b/web/src/pages/Platform/Overview/Cluster/index.tsx index 5a9341dd..d47cc5b1 100644 --- a/web/src/pages/Platform/Overview/Cluster/index.tsx +++ b/web/src/pages/Platform/Overview/Cluster/index.tsx @@ -5,6 +5,7 @@ import Infos from "./Detail/Infos"; import Card from "./Card"; import Table from "./Table"; import Overview from "@/components/Overview"; +import { getAllTimeSettingsCache } from "@/components/Overview/Monitor"; const facetLabels = { "labels.health_status": "health status", @@ -34,6 +35,9 @@ const sideSorterOptions = [ ]; export default () => { + + const allTimeSettingsCache = getAllTimeSettingsCache() + return ( { text: item?._source?.name }), }} - infoAction={`${ESPrefix}/cluster/info?timeout=120s`} + infoAction={`${ESPrefix}/cluster/info?timeout=${allTimeSettingsCache.timeout || '10s'}`} facetLabels={facetLabels} aggsParams={aggsParams} sideSorterOptions={sideSorterOptions} diff --git a/web/src/pages/Platform/Overview/Indices/index.tsx b/web/src/pages/Platform/Overview/Indices/index.tsx index 30b3364b..dd34b32e 100644 --- a/web/src/pages/Platform/Overview/Indices/index.tsx +++ b/web/src/pages/Platform/Overview/Indices/index.tsx @@ -4,6 +4,7 @@ import Infos from "./Detail/Infos"; import Card from "./Card"; import Table from "./Table"; import Overview from "@/components/Overview"; +import { getAllTimeSettingsCache } from "@/components/Overview/Monitor"; const facetLabels = { "metadata.cluster_name": "cluster", @@ -28,6 +29,9 @@ const sideSorterOptions = [ ]; export default () => { + + const allTimeSettingsCache = getAllTimeSettingsCache() + return ( { text: item?._source?.metadata?.index_name }), }} - infoAction={`${ESPrefix}/index/info?timeout=120s`} + infoAction={`${ESPrefix}/index/info?timeout=${allTimeSettingsCache.timeout || '10s'}`} facetLabels={facetLabels} aggsParams={aggsParams} sideSorterOptions={sideSorterOptions} diff --git a/web/src/pages/Platform/Overview/Node/index.tsx b/web/src/pages/Platform/Overview/Node/index.tsx index e3060961..7b128ee0 100644 --- a/web/src/pages/Platform/Overview/Node/index.tsx +++ b/web/src/pages/Platform/Overview/Node/index.tsx @@ -5,6 +5,7 @@ import Card from "./Card"; import Table from "./Table"; import Overview from "@/components/Overview"; import Logs from "./Detail/Logs"; +import { getAllTimeSettingsCache } from "@/components/Overview/Monitor"; const facetLabels = { "metadata.cluster_name": "cluster", @@ -38,6 +39,9 @@ const sideSorterOptions = [ ]; export default () => { + + const allTimeSettingsCache = getAllTimeSettingsCache() + return ( { text: item?._source?.metadata?.node_name }), }} - infoAction={`${ESPrefix}/node/info?timeout=120s`} + infoAction={`${ESPrefix}/node/info?timeout=${allTimeSettingsCache.timeout || '10s'}`} facetLabels={facetLabels} selectFilterLabels={selectFilterLabels} aggsParams={aggsParams}