jan/web/screens/Settings/index.tsx
Faisal Amir daa7c0ca21
feat: better hardware setting (#4471)
* feat: better hardware setting

* chore: update layout

* feat: better hardware setting

* chore: fix title section

* chore: added hardware engine management

* chore: integrate gpus and enable set gpu activate

* chore: update calculate ram and vram

* chore: update calulate vram and ram used

* fix: set active gpus

* chore: fix progress bar spacing

* chore: always update cache vram gpu

* chore: update cpu usage percentage

* chore: fix type usage cpu

* chore: update ram cpus usage getsystemmonitor from new api harware engine management system

* test: update test case data using hardware management extension

* chore: resolve conflict lock json

* chore: cleanup app services

* chore: update type OperationSystemInfo

* chore: update app service

* chore: show list gpus on system monitor

* chore: remove monitoring extension

* chore: update test case app service

* chore: remove unused hooks useGpusSetting

* chore: remove monitor from shource index

* chore: fix test core

* chore: update gpu and cpu info on engine management ext

* chore: fix app service test

* chore: update test appService include cpu info

* chore: filter gpus show or hide on system monitor based activated gpu

* chore: remove unused run_mode

* chore: remove tensort

* chore: update check gpu run_mode

* chore: handle undefined gpus

* chore: cleanup PR

* chore: cleanup process node error

* chore: fix type
2025-02-03 22:01:08 +07:00

49 lines
1.3 KiB
TypeScript

import { useEffect } from 'react'
import { useSetAtom } from 'jotai'
import CenterPanelContainer from '@/containers/CenterPanelContainer'
import SettingDetail from '@/screens/Settings/SettingDetail'
import SettingLeftPanel from '@/screens/Settings/SettingLeftPanel'
import { SUCCESS_SET_NEW_DESTINATION } from './Advanced/DataFolder'
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'
export const SettingScreenList = [
'My Models',
'Preferences',
'Keyboard Shortcuts',
'Hardware',
'Privacy',
'Advanced Settings',
'Engines',
'Extensions',
] as const
export type SettingScreenTuple = typeof SettingScreenList
export type SettingScreen = SettingScreenTuple[number]
const SettingsScreen = () => {
const setSelectedSettingScreen = useSetAtom(selectedSettingAtom)
useEffect(() => {
if (localStorage.getItem(SUCCESS_SET_NEW_DESTINATION) === 'true') {
setSelectedSettingScreen('Advanced Settings')
localStorage.removeItem(SUCCESS_SET_NEW_DESTINATION)
}
}, [setSelectedSettingScreen])
return (
<div data-testid="testid-setting-description" className="flex h-full">
<SettingLeftPanel />
<CenterPanelContainer>
<SettingDetail />
</CenterPanelContainer>
</div>
)
}
export default SettingsScreen