diff --git a/src/components/layout/Aside.tsx b/src/components/layout/Aside.tsx index c856a4e31..9154fea10 100644 --- a/src/components/layout/Aside.tsx +++ b/src/components/layout/Aside.tsx @@ -1,5 +1,11 @@ import { Aside as MantineAside, Group } from '@mantine/core'; -import { WeatherModule, DateModule, CalendarModule, TotalDownloadsModule, SystemModule } from '../modules'; +import { + WeatherModule, + DateModule, + CalendarModule, + TotalDownloadsModule, + SystemModule, +} from '../modules'; import { ModuleWrapper } from '../modules/moduleWrapper'; export default function Aside(props: any) { @@ -15,7 +21,7 @@ export default function Aside(props: any) { base: 'auto', }} > - + diff --git a/src/components/modules/downloads/DownloadsModule.tsx b/src/components/modules/downloads/DownloadsModule.tsx index f8f55fd26..3f440b905 100644 --- a/src/components/modules/downloads/DownloadsModule.tsx +++ b/src/components/modules/downloads/DownloadsModule.tsx @@ -1,13 +1,4 @@ -import { - Table, - Text, - Tooltip, - Title, - Group, - Progress, - Skeleton, - ScrollArea, -} from '@mantine/core'; +import { Table, Text, Tooltip, Title, Group, Progress, Skeleton, ScrollArea } from '@mantine/core'; import { IconDownload as Download } from '@tabler/icons'; import { useEffect, useState } from 'react'; import axios from 'axios'; diff --git a/src/components/modules/system/SystemModule.tsx b/src/components/modules/system/SystemModule.tsx index 414098fad..2b84357f2 100644 --- a/src/components/modules/system/SystemModule.tsx +++ b/src/components/modules/system/SystemModule.tsx @@ -1,10 +1,7 @@ import { - Card, Center, - ColorSwatch, Group, RingProgress, - Text, Title, useMantineTheme, } from '@mantine/core'; @@ -12,9 +9,8 @@ import { IconCpu } from '@tabler/icons'; import { useEffect, useState } from 'react'; import axios from 'axios'; import si from 'systeminformation'; -import { ResponsiveLine } from '@nivo/line'; -import { IModule } from '../modules'; import { useListState } from '@mantine/hooks'; +import { IModule } from '../modules'; export const SystemModule: IModule = { title: 'System info', @@ -55,65 +51,12 @@ export default function SystemInfo(args: any) {
Current CPU load - {/* { - const Download = slice.points[0].data.y as number; - const Upload = slice.points[1].data.y as number; - // Get the number of seconds since the last update. - const seconds = (Date.now() - (slice.points[0].data.x as number)) / 1000; - // Round to the nearest second. - const roundedSeconds = Math.round(seconds); - return ( - - {roundedSeconds} seconds ago - - - - - CPU: {currentLoad} - - - - - ); - }} - data={[ - { - id: 'downloads', - data: chartDataUp, - }, - ]} - curve="monotoneX" - yFormat=" >-.2f" - axisTop={null} - axisRight={null} - enablePoints={false} - animate={false} - enableGridX={false} - enableGridY={false} - enableArea - defs={[ - linearGradientDef('gradientA', [ - { offset: 0, color: 'inherit' }, - { offset: 100, color: 'inherit', opacity: 0 }, - ]), - ]} - fill={[{ match: '*', id: 'gradientA' }]} - colors={[ - // Blue - theme.colors.blue[5], - // Green - theme.colors.green[5], - ]} - /> */} {`${(currentLoad * 100).toFixed(2)}%`}
} - thickness={12} + size={150} + label={
{`${currentLoad.toFixed(2)}%`}
} + thickness={15} roundCaps - sections={[{ value: data?.load?.currentLoad ?? 0, color: 'cyan' }]} + sections={[{ value: currentLoad ?? 0, color: 'cyan' }]} />