diff --git a/src/pages/benchmark/components/view-logs-modal.tsx b/src/pages/benchmark/components/view-logs-modal.tsx index 958296be..2b871e93 100644 --- a/src/pages/benchmark/components/view-logs-modal.tsx +++ b/src/pages/benchmark/components/view-logs-modal.tsx @@ -17,6 +17,9 @@ const ViewLogsModal: React.FC = (props) => { const logsViewerRef = React.useRef(null); const requestRef = React.useRef(null); const contentRef = React.useRef(null); + const [params, setParams] = React.useState({ + follow: true + }); const handleCancel = useCallback(() => { logsViewerRef.current?.abort(); @@ -94,9 +97,7 @@ const ViewLogsModal: React.FC = (props) => { tail={undefined} enableScorllLoad={true} isDownloading={false} - params={{ - follow: true - }} + params={params} > diff --git a/src/pages/llmodels/deployments.tsx b/src/pages/llmodels/deployments.tsx index 31814b77..112bcdb7 100644 --- a/src/pages/llmodels/deployments.tsx +++ b/src/pages/llmodels/deployments.tsx @@ -278,6 +278,21 @@ const Models = forwardRef((props, ref) => { fetchData({ loadingVal: false }); + // re-align the instance cache with the backend as a backstop, in case a + // DELETE watch event for terminated instances was missed + getAllModelInstances(); + }); + + // proactively drop a model's instances from the cache when it is stopped, so + // a stale (terminating) instance can't linger and show up alongside the new + // one after an immediate restart + const handleStop = useMemoizedFn(async (modelIds: number[]) => { + const idSet = new Set(modelIds); + cacheInsDataListRef.current = cacheInsDataListRef.current.filter( + (item) => !idSet.has(item.model_id) + ); + setModelInstances(cacheInsDataListRef.current); + handleSearchBySilent(); }); const handleSearch = useMemoizedFn(async (params?: any) => { @@ -456,7 +471,7 @@ const Models = forwardRef((props, ref) => { handleOnToggleExpandAll={createModelsInstanceChunkRequest} onViewLogs={cancelRequestsOnPageInactive} onCancelViewLogs={handleOnCancelViewLogs} - onStop={handleSearchBySilent} + onStop={handleStop} onStart={handleSearchBySilent} onTableSort={handleOnSortChange} onFilterChange={handleOnFilterChange} diff --git a/src/pages/usage/token-tab/components/breakdown-tabs.tsx b/src/pages/usage/token-tab/components/breakdown-tabs.tsx index 9543fee3..616b9526 100644 --- a/src/pages/usage/token-tab/components/breakdown-tabs.tsx +++ b/src/pages/usage/token-tab/components/breakdown-tabs.tsx @@ -47,7 +47,7 @@ const BreakdownTabs: React.FC<{ }, { key: 'users', - label: intl.formatMessage({ id: 'usage.tabs.users' }), + label: intl.formatMessage({ id: 'usage.table.users' }), forceRender: true, children: (