Skip to content

Commit

Permalink
feat: add shortcut app logs on system monitor (janhq#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur authored and louis-jan committed Jul 12, 2024
1 parent e12549b commit 34ad977
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions web/containers/Layout/BottomPanel/SystemMonitor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { Fragment, useEffect, useState } from 'react'

import { Progress } from '@janhq/joi'
import { Button, Progress } from '@janhq/joi'
import { useClickOutside } from '@janhq/joi'
import { useAtom, useAtomValue } from 'jotai'
import { MonitorIcon, XIcon, ChevronDown, ChevronUp } from 'lucide-react'
import {
MonitorIcon,
XIcon,
ChevronDown,
ChevronUp,
FolderOpenIcon,
} from 'lucide-react'

import { twMerge } from 'tailwind-merge'

import useGetSystemResources from '@/hooks/useGetSystemResources'

import { usePath } from '@/hooks/usePath'

import { toGibibytes } from '@/utils/converter'

import TableActiveModel from './TableActiveModel'
Expand All @@ -28,6 +36,7 @@ const SystemMonitor = () => {
const usedRam = useAtomValue(usedRamAtom)
const cpuUsage = useAtomValue(cpuUsageAtom)
const gpus = useAtomValue(gpusAtom)
const { onRevealInFinder } = usePath()
const [showFullScreen, setShowFullScreen] = useState(false)
const ramUtilitized = useAtomValue(ramUtilitizedAtom)
const [showSystemMonitorPanel, setShowSystemMonitorPanel] = useAtom(
Expand Down Expand Up @@ -64,7 +73,7 @@ const SystemMonitor = () => {
<div
ref={setControl}
className={twMerge(
'flex cursor-pointer items-center gap-x-1 rounded-l px-1 py-0.5 hover:bg-[hsla(var(--secondary-bg))]',
'flex cursor-pointer items-center gap-x-1 rounded px-1 py-0.5 hover:bg-[hsla(var(--secondary-bg))]',
showSystemMonitorPanel && 'bg-[hsla(var(--secondary-bg))]'
)}
onClick={() => {
Expand All @@ -89,6 +98,12 @@ const SystemMonitor = () => {
Running Models
</h6>
<div className="unset-drag flex cursor-pointer items-center gap-x-2">
<div
className="flex cursor-pointer items-center gap-x-1 rounded px-1 py-0.5 hover:bg-[hsla(var(--secondary-bg))]"
onClick={() => onRevealInFinder('Logs')}
>
<FolderOpenIcon size={12} /> App Log
</div>
{showFullScreen ? (
<ChevronDown
size={20}
Expand Down

0 comments on commit 34ad977

Please sign in to comment.