diff --git a/package.json b/package.json index 7a277643..26db191a 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "react-syntax-highlighter": "^15.4.3", "react-test-renderer": "^17.0.2", "recharts": "^2.0.9", - "trueblocks-sdk": "^0.60.1", + "trueblocks-sdk": "^0.62.9", "ts-morph": "^13.0.2" } } diff --git a/src/ui/App.tsx b/src/ui/App.tsx index f469d9a1..fe0256c7 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -18,7 +18,7 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { Chain, - Config, getConfig, getVersion, SuccessResponse, + Config, getStatus, getVersion, SuccessResponse, } from 'trueblocks-sdk'; import { ChainSelect } from '@components/ChainSelect'; @@ -95,10 +95,11 @@ export const App = () => { useEffect(() => { const fetchStatus = async () => { - const statusResponse = wrapResponse(await getConfig({ - modes: ['show'], + const statusResponse = wrapResponse(await getStatus({ + modes: ["some"], chain: chain.chain, fmt: 'json', + verbose: true, })); if (isSuccessfulCall(statusResponse)) { diff --git a/src/ui/modules/types/Config.ts b/src/ui/modules/types/Config.ts index e2f6faa2..b967feb8 100644 --- a/src/ui/modules/types/Config.ts +++ b/src/ui/modules/types/Config.ts @@ -26,7 +26,6 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, - isValid: false, }, { items: [], @@ -35,7 +34,6 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, - isValid: false, }, { items: [], @@ -44,7 +42,6 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, - isValid: false, }, { items: [], @@ -53,7 +50,6 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, - isValid: false, }, ], chains: [], diff --git a/src/ui/views/Dashboard/Tabs/Monitors.tsx b/src/ui/views/Dashboard/Tabs/Monitors.tsx index 3b3eb561..80c72450 100644 --- a/src/ui/views/Dashboard/Tabs/Monitors.tsx +++ b/src/ui/views/Dashboard/Tabs/Monitors.tsx @@ -9,7 +9,7 @@ import { import { ColumnsType } from 'antd/lib/table'; import { Chain, Config, - getConfig, Monitor, + getStatus, Monitor, } from 'trueblocks-sdk'; import { ClickableAddress } from '@components/ClickableAddress'; @@ -40,11 +40,10 @@ export const Monitors = () => { const [selectedNameTags] = useState(''); const [loadingEdit, setLoadingEdit] = useState(false); - const monitorsCall = useSdk(() => getConfig({ + const monitorsCall = useSdk(() => getStatus({ chain: chain.chain, - modes: ['show'], - module: ['monitors'], - details: true, + modes: ['monitors'], + verbose: true, }), undefined, []) as CallStatus; if (isFailedCall(monitorsCall)) { createErrorNotification({ diff --git a/src/ui/views/Settings/Tabs/Indexes.tsx b/src/ui/views/Settings/Tabs/Indexes.tsx index cbd3c1ce..afa88951 100644 --- a/src/ui/views/Settings/Tabs/Indexes.tsx +++ b/src/ui/views/Settings/Tabs/Indexes.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useMemo } from 'react'; import { ColumnsType } from 'antd/lib/table'; import { - Config, getConfig, IndexCacheItem, PinnedChunk, + Config, getStatus, CacheRecordUp, } from 'trueblocks-sdk'; import { BaseView } from '@components/BaseView'; @@ -27,11 +27,10 @@ import { IndexTable } from './SubTabs/IndexTable'; export const IndexesView = () => { const { chain } = useGlobalState(); - const statusCall = useSdk(() => getConfig({ + const statusCall = useSdk(() => getStatus({ chain: chain.chain, - modes: ['show'], - module: ['index'], - details: true, + modes: ['index'], + verbose: true, })); const theGridData = useMemo(() => { @@ -43,7 +42,7 @@ export const IndexesView = () => { return statusCall.data; } return [createEmptyStatus()]; - }, [statusCall]) as any as IndexCacheItem[]; + }, [statusCall]) as any as CacheRecordUp[]; useEffect(() => { if (isFailedCall(statusCall)) { @@ -88,7 +87,7 @@ function padLeft(num: number, size: number, char: string = '0') { return s; } -const renderBlockRange = (record: PinnedChunk) => ( +const renderBlockRange = (record: CacheRecordUp) => (
{padLeft(record.firstApp, 9)} @@ -103,7 +102,7 @@ const renderBlockRange = (record: PinnedChunk) => (
); -export const indexSchema: ColumnsType = [ +export const indexSchema: ColumnsType = [ addColumn({ title: 'Block Range', dataIndex: 'firstApp', diff --git a/src/ui/views/Settings/Tabs/SubTabs/IndexGrid.tsx b/src/ui/views/Settings/Tabs/SubTabs/IndexGrid.tsx index 74666cd7..a7e39b36 100644 --- a/src/ui/views/Settings/Tabs/SubTabs/IndexGrid.tsx +++ b/src/ui/views/Settings/Tabs/SubTabs/IndexGrid.tsx @@ -2,14 +2,14 @@ import React, { useEffect, useState } from 'react'; import { createUseStyles } from 'react-jss'; import cx from 'classnames'; -import { IndexCacheItem } from 'trueblocks-sdk'; +import { CacheRecordUp } from 'trueblocks-sdk'; export const IndexGrid = ({ theData, title, loading, }: { - theData: IndexCacheItem[]; + theData: CacheRecordUp[]; title: string | JSX.Element, loading: boolean }) => ( @@ -28,7 +28,7 @@ const cols = Array(10) export const GridTable = ({ data, }: { - data: IndexCacheItem[]; + data: CacheRecordUp[]; }) => { const [selected, setSelected] = useState(localStorage.getItem('grid-select') || ''); // TODO(tjayrush): This needs to pick up the actual last indexed block @@ -142,7 +142,7 @@ export const DetailTable = ({ cellStart, cellSpan, }: { - data: IndexCacheItem[]; + data: CacheRecordUp[]; cellStart: any; cellSpan: any; }) => { @@ -171,7 +171,7 @@ export const DetailTable = ({ } const range = { start: cellStart, end: cellStart + cellSpan }; - const filteredData = data.filter((item: IndexCacheItem) => item.firstApp >= range.start && item.firstApp < range.end); + const filteredData = data.filter((item: CacheRecordUp) => item.firstApp >= range.start && item.firstApp < range.end); if (filteredData.length > 200 || cellSpan > 100000) { return (
- {filteredData.map((record: IndexCacheItem) => ( + {filteredData.map((record: CacheRecordUp) => (
- {record.filename.replace(/.bin/, '')} + {record.filename.replace(/^.*[\\\/]/, '').replace(/.bin/, '')}
{details.map((field) => { let val = <>; diff --git a/yarn.lock b/yarn.lock index 20520b9a..6532362e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13663,7 +13663,7 @@ resolve@^2.0.0-next.3: react-test-renderer: ^17.0.2 recharts: ^2.0.9 style-loader: ^2.0.0 - trueblocks-sdk: ^0.60.1 + trueblocks-sdk: ^0.62.9 ts-jest: ^26.5.3 ts-loader: ^8.0.18 ts-morph: ^13.0.2 @@ -13674,13 +13674,13 @@ resolve@^2.0.0-next.3: languageName: unknown linkType: soft -"trueblocks-sdk@npm:^0.60.1": - version: 0.60.1 - resolution: "trueblocks-sdk@npm:0.60.1" +"trueblocks-sdk@npm:^0.62.9": + version: 0.62.9 + resolution: "trueblocks-sdk@npm:0.62.9" dependencies: typescript: ^4.9.4 vitest: ^0.29.2 - checksum: cc3f0f969baf1cbe68285156db83dc1e11f28d72fe62c2d686b77f7a0e4bc62b4a74c789d69e2e5479a20d439e80e7bedca8ee9f1fdb3e5f162012834fe990bf + checksum: a5201074c9940b9742c39f8d29ecbf25ec0a5d85d5d9f9b85b106c3da02271f5ca1a0776157795c744f54da616c8adf1cbfdc18f4e0f5b1e13f664014553cc1a languageName: node linkType: hard