diff --git a/web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx b/web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx index de9b52782..c9d86e5e8 100644 --- a/web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx +++ b/web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx @@ -1,5 +1,3 @@ -import { Fragment } from 'react' - import { Tooltip, Button, Badge } from '@janhq/joi' import { useAtom } from 'jotai' @@ -8,12 +6,15 @@ import { useActiveModel } from '@/hooks/useActiveModel' import { toGibibytes } from '@/utils/converter' +import { localEngines } from '@/utils/modelEngine' + import { serverEnabledAtom } from '@/helpers/atoms/LocalServer.atom' const Column = ['Model', 'Size', ''] const TableActiveModel = () => { const { activeModel, stateModel, stopModel } = useActiveModel() + const [serverEnabled, setServerEnabled] = useAtom(serverEnabledAtom) return ( @@ -34,47 +35,53 @@ const TableActiveModel = () => { })} - {activeModel && ( - - - - -

{activeModel.name}

- - - - {toGibibytes(activeModel.metadata.size)} - - - - { - stopModel() - window.core?.api?.stopServer() - setServerEnabled(false) - }} - > - Stop - - } - content="The API server is running, stop the model will + {activeModel && localEngines.includes(activeModel.engine) ? ( + + + +

{activeModel.name}

+ + + + {activeModel.metadata.size + ? toGibibytes(activeModel.metadata.size) + : '-'} + + + + { + stopModel() + window.core?.api?.stopServer() + setServerEnabled(false) + }} + > + Stop + + } + content="The API server is running, stop the model will also stop the server" - disabled={!serverEnabled} - /> - - - -
+ disabled={!serverEnabled} + /> + + + + ) : ( + + + No on-device model running + + )} diff --git a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx index b513cc15c..7fb20b0a4 100644 --- a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx +++ b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx @@ -88,7 +88,7 @@ const SystemMonitor = () => {