fix: avoid show remote model on system monitor (#3412)

* fix: avoid show remote model on system monitor

* fix: update copies and remove padding
This commit is contained in:
Faisal Amir 2024-08-20 16:12:37 +07:00 committed by GitHub
parent 5bbf7f8676
commit 1f5d504b3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 50 additions and 43 deletions

View File

@ -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,8 +35,7 @@ const TableActiveModel = () => {
})}
</tr>
</thead>
{activeModel && (
<Fragment>
{activeModel && localEngines.includes(activeModel.engine) ? (
<tbody>
<tr>
<td
@ -46,7 +46,9 @@ const TableActiveModel = () => {
</td>
<td className="px-4 py-2">
<Badge theme="secondary">
{toGibibytes(activeModel.metadata.size)}
{activeModel.metadata.size
? toGibibytes(activeModel.metadata.size)
: '-'}
</Badge>
</td>
<td className="px-4 py-2 text-center">
@ -74,7 +76,12 @@ const TableActiveModel = () => {
</td>
</tr>
</tbody>
</Fragment>
) : (
<tbody>
<tr className="text-[hsla(var(--text-secondary))]">
<td className="p-4">No on-device model running</td>
</tr>
</tbody>
)}
</table>
</div>

View File

@ -88,7 +88,7 @@ const SystemMonitor = () => {
<div
ref={setElementExpand}
className={twMerge(
'fixed bottom-9 left-[49px] z-50 flex w-[calc(100%-48px-8px)] flex-shrink-0 flex-col border-t border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))]',
'fixed bottom-9 left-[49px] z-50 flex w-[calc(100%-48px)] flex-shrink-0 flex-col border-t border-[hsla(var(--app-border))] bg-[hsla(var(--app-bg))]',
showFullScreen && 'h-[calc(100%-63px)]',
reduceTransparent && 'w-[calc(100%-48px)] rounded-none'
)}