From befcd90558c09e6d9824f45449e9ccfde1185275 Mon Sep 17 00:00:00 2001 From: Egor Gripasov Date: Wed, 16 Dec 2020 13:39:02 +0300 Subject: [PATCH] running bots refresh (#61) --- .../console-app/src/containers/panels/bots/RunningBots.js | 7 ++++--- packages/console-app/src/version.json | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/console-app/src/containers/panels/bots/RunningBots.js b/packages/console-app/src/containers/panels/bots/RunningBots.js index 5ee3255..b243936 100644 --- a/packages/console-app/src/containers/panels/bots/RunningBots.js +++ b/packages/console-app/src/containers/panels/bots/RunningBots.js @@ -3,7 +3,7 @@ // import moment from 'moment'; -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useContext } from 'react'; import { useQuery, useMutation } from '@apollo/react-hooks'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; @@ -12,7 +12,7 @@ import TableBody from '@material-ui/core/TableBody'; import BOT_LIST from '../../../gql/bot_list.graphql'; import BOT_KILL from '../../../gql/bot_kill.graphql'; -import { useQueryStatusReducer, useStatusReducer, useSorter } from '../../../hooks'; +import { ConsoleContext, useQueryStatusReducer, useStatusReducer, useSorter } from '../../../hooks'; import BotControls from '../../../components/BotControls'; import Table from '../../../components/Table'; @@ -22,8 +22,9 @@ const RunningBots = () => { const [sorter, sortBy] = useSorter('started', false); const [botList, setBotList] = useState([]); const [, setStatus] = useStatusReducer(); + const { config } = useContext(ConsoleContext); - const { data: botListResponse, refetch } = useQueryStatusReducer(useQuery(BOT_LIST)); + const { data: botListResponse, refetch } = useQueryStatusReducer(useQuery(BOT_LIST, { pollInterval: config.api.pollInterval })); useEffect(() => { if (botListResponse) { diff --git a/packages/console-app/src/version.json b/packages/console-app/src/version.json index 5c8b684..61fc2c3 100644 --- a/packages/console-app/src/version.json +++ b/packages/console-app/src/version.json @@ -1,7 +1,7 @@ { "build": { "name": "@dxos/console-app", - "buildDate": "2020-12-10T18:33:21.012Z", - "version": "1.2.7-alpha.0" + "buildDate": "2020-12-16T09:52:39.755Z", + "version": "1.2.7-alpha.2" } }