chore: set timeout to 10s by default in DatePicker's time settings (#63)

* chore: set timeout to 10s by default in DatePicker's time settings

* chore: update release notes

---------

Co-authored-by: yaojiping <yaojiping@infini.ltd>
Co-authored-by: Hardy <luohoufu@163.com>
This commit is contained in:
yaojp123 2024-12-31 09:26:04 +08:00 committed by GitHub
parent 9733b72531
commit 59908761b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 24 additions and 10 deletions

View File

@ -24,6 +24,8 @@ Information about release notes of INFINI Console is provided here.
- Optimize metric query bucket size (#59) - 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. - 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. - 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. - Enhanced http_client to support customizable configurations.

View File

@ -45,7 +45,7 @@ const TimeSetting = props => {
const timeoutObject = useMemo(() => { const timeoutObject = useMemo(() => {
if (!timeout) { if (!timeout) {
return { return {
value: 120, value: 10,
unit: 's', unit: 's',
} }
} }
@ -128,10 +128,10 @@ const TimeSetting = props => {
timeoutObject && ( timeoutObject && (
<> <>
<InputNumber <InputNumber
min={60} min={10}
value={timeoutObject.value} value={timeoutObject.value}
style={{ width: '100%' }} style={{ width: '100%' }}
step={10} step={1}
precision={0} precision={0}
onChange={(value) => { onChange={(value) => {
if (Number.isInteger(value)) { if (Number.isInteger(value)) {

View File

@ -24,7 +24,7 @@
| showTimeInterval | 是否显示时间间隔 | boolean | false | 1.0.0 | | showTimeInterval | 是否显示时间间隔 | boolean | false | 1.0.0 |
| timeInterval | 时间间隔 | string | - | 1.0.0 | | timeInterval | 时间间隔 | string | - | 1.0.0 |
| showTimeout | 是否显示超时时间 | boolean | false | 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 | | onTimeSettingChange | 时间配置变更的回调 | ({timeField: string, timeInterval: string, timeout: string}) => void | - | 1.0.0 |
| autoFitLoading | 自动适配时间载入状态 | boolean | false | 1.0.0 | | autoFitLoading | 自动适配时间载入状态 | boolean | false | 1.0.0 |
| onAutoFit | 自动适配时间的回调 | () => void | - | 1.0.0 | | onAutoFit | 自动适配时间的回调 | () => void | - | 1.0.0 |

View File

@ -52,7 +52,7 @@ export default (props) => {
showTimeInterval: true, showTimeInterval: true,
timeInterval: "15s", timeInterval: "15s",
showTimeout: true, showTimeout: true,
timeout: "120s", timeout: "10s",
}); });
const [currentTimeZone, setCurrentTimeZone] = useState(timeZone); const [currentTimeZone, setCurrentTimeZone] = useState(timeZone);

View File

@ -40,7 +40,7 @@ export default (props) => {
timeFormatter: formatter.dates(1), timeFormatter: formatter.dates(1),
}, },
timeInterval: allTimeSettingsCache.timeInterval, timeInterval: allTimeSettingsCache.timeInterval,
timeout: allTimeSettingsCache.timeout || '120s', timeout: allTimeSettingsCache.timeout || '10s',
}); });
const [refresh, setRefresh] = useState({ isRefreshPaused: allTimeSettingsCache.isRefreshPaused || false, refreshInterval: allTimeSettingsCache.refreshInterval || 30000 }); const [refresh, setRefresh] = useState({ isRefreshPaused: allTimeSettingsCache.isRefreshPaused || false, refreshInterval: allTimeSettingsCache.refreshInterval || 30000 });

View File

@ -78,7 +78,7 @@ const Monitor = (props) => {
timeFormatter: formatter.dates(1), timeFormatter: formatter.dates(1),
}, },
timeInterval: formatTimeInterval(param?.timeInterval) || allTimeSettingsCache.timeInterval, timeInterval: formatTimeInterval(param?.timeInterval) || allTimeSettingsCache.timeInterval,
timeout: formatTimeout(param?.timeout) || allTimeSettingsCache.timeout || '120s', timeout: formatTimeout(param?.timeout) || allTimeSettingsCache.timeout || '10s',
param: param, param: param,
refresh: true, refresh: true,
}) })

View File

@ -5,6 +5,7 @@ import Infos from "./Detail/Infos";
import Card from "./Card"; import Card from "./Card";
import Table from "./Table"; import Table from "./Table";
import Overview from "@/components/Overview"; import Overview from "@/components/Overview";
import { getAllTimeSettingsCache } from "@/components/Overview/Monitor";
const facetLabels = { const facetLabels = {
"labels.health_status": "health status", "labels.health_status": "health status",
@ -34,6 +35,9 @@ const sideSorterOptions = [
]; ];
export default () => { export default () => {
const allTimeSettingsCache = getAllTimeSettingsCache()
return ( return (
<Overview <Overview
searchAction={`${ESPrefix}/cluster/_search`} searchAction={`${ESPrefix}/cluster/_search`}
@ -54,7 +58,7 @@ export default () => {
text: item?._source?.name text: item?._source?.name
}), }),
}} }}
infoAction={`${ESPrefix}/cluster/info?timeout=120s`} infoAction={`${ESPrefix}/cluster/info?timeout=${allTimeSettingsCache.timeout || '10s'}`}
facetLabels={facetLabels} facetLabels={facetLabels}
aggsParams={aggsParams} aggsParams={aggsParams}
sideSorterOptions={sideSorterOptions} sideSorterOptions={sideSorterOptions}

View File

@ -4,6 +4,7 @@ import Infos from "./Detail/Infos";
import Card from "./Card"; import Card from "./Card";
import Table from "./Table"; import Table from "./Table";
import Overview from "@/components/Overview"; import Overview from "@/components/Overview";
import { getAllTimeSettingsCache } from "@/components/Overview/Monitor";
const facetLabels = { const facetLabels = {
"metadata.cluster_name": "cluster", "metadata.cluster_name": "cluster",
@ -28,6 +29,9 @@ const sideSorterOptions = [
]; ];
export default () => { export default () => {
const allTimeSettingsCache = getAllTimeSettingsCache()
return ( return (
<Overview <Overview
extraQueryFields={["index_id"]} extraQueryFields={["index_id"]}
@ -54,7 +58,7 @@ export default () => {
text: item?._source?.metadata?.index_name text: item?._source?.metadata?.index_name
}), }),
}} }}
infoAction={`${ESPrefix}/index/info?timeout=120s`} infoAction={`${ESPrefix}/index/info?timeout=${allTimeSettingsCache.timeout || '10s'}`}
facetLabels={facetLabels} facetLabels={facetLabels}
aggsParams={aggsParams} aggsParams={aggsParams}
sideSorterOptions={sideSorterOptions} sideSorterOptions={sideSorterOptions}

View File

@ -5,6 +5,7 @@ import Card from "./Card";
import Table from "./Table"; import Table from "./Table";
import Overview from "@/components/Overview"; import Overview from "@/components/Overview";
import Logs from "./Detail/Logs"; import Logs from "./Detail/Logs";
import { getAllTimeSettingsCache } from "@/components/Overview/Monitor";
const facetLabels = { const facetLabels = {
"metadata.cluster_name": "cluster", "metadata.cluster_name": "cluster",
@ -38,6 +39,9 @@ const sideSorterOptions = [
]; ];
export default () => { export default () => {
const allTimeSettingsCache = getAllTimeSettingsCache()
return ( return (
<Overview <Overview
extraQueryFields={["node_id"]} extraQueryFields={["node_id"]}
@ -63,7 +67,7 @@ export default () => {
text: item?._source?.metadata?.node_name text: item?._source?.metadata?.node_name
}), }),
}} }}
infoAction={`${ESPrefix}/node/info?timeout=120s`} infoAction={`${ESPrefix}/node/info?timeout=${allTimeSettingsCache.timeout || '10s'}`}
facetLabels={facetLabels} facetLabels={facetLabels}
selectFilterLabels={selectFilterLabels} selectFilterLabels={selectFilterLabels}
aggsParams={aggsParams} aggsParams={aggsParams}