From 451833cb8c1c24667f589550e93dba2af68a1203 Mon Sep 17 00:00:00 2001
From: AreYouScared
Date: Sat, 11 Apr 2020 23:57:49 -0400
Subject: [PATCH] Add Disk User
Added Disk usage to console page, matches same inforamtion on overview page.
---
.../scripts/components/server/ServerConsole.tsx | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/resources/scripts/components/server/ServerConsole.tsx b/resources/scripts/components/server/ServerConsole.tsx
index 434589f10..8593216fc 100644
--- a/resources/scripts/components/server/ServerConsole.tsx
+++ b/resources/scripts/components/server/ServerConsole.tsx
@@ -6,6 +6,7 @@ import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
import classNames from 'classnames';
import { faMemory } from '@fortawesome/free-solid-svg-icons/faMemory';
import { faMicrochip } from '@fortawesome/free-solid-svg-icons/faMicrochip';
+import { faHdd } from '@fortawesome/free-solid-svg-icons/faHdd';
import { bytesToHuman } from '@/helpers';
import SuspenseSpinner from '@/components/elements/SuspenseSpinner';
import TitledGreyBox from '@/components/elements/TitledGreyBox';
@@ -42,6 +43,7 @@ const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void
export default () => {
const [ memory, setMemory ] = useState(0);
const [ cpu, setCpu ] = useState(0);
+ const [ disk, setDisk ] = useState(0);
const server = ServerContext.useStoreState(state => state.server.data!);
const status = ServerContext.useStoreState(state => state.status.value);
@@ -58,6 +60,7 @@ export default () => {
setMemory(stats.memory_bytes);
setCpu(stats.cpu_absolute);
+ setDisk(stats.disk_bytes);
};
const sendPowerCommand = (command: PowerAction) => {
@@ -92,6 +95,14 @@ export default () => {
/>
{status}
+
+
+ {cpu.toFixed(2)} %
+
{
- {cpu.toFixed(2)} %
+ {bytesToHuman(disk)}
+ / {server.limits.disk} MB