From c75a621c521c1438dec9850b852a65be93a4cd30 Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Mon, 2 Nov 2020 00:49:07 -0500 Subject: [PATCH] Only show allocation if user has permission prevents just a blank scetion in the details box if a sub user dosn't have the permission of `allocation.read` Also fixes the server router where it was set to `allocations` and not `allocation` making it not showup period even if the sub user had the correct permissions. --- .../components/server/ServerDetailsBlock.tsx | 15 +++++++++------ resources/scripts/routers/ServerRouter.tsx | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/resources/scripts/components/server/ServerDetailsBlock.tsx b/resources/scripts/components/server/ServerDetailsBlock.tsx index 321c01943..fdd4599c4 100644 --- a/resources/scripts/components/server/ServerDetailsBlock.tsx +++ b/resources/scripts/components/server/ServerDetailsBlock.tsx @@ -6,6 +6,7 @@ import { bytesToHuman, megabytesToHuman } from '@/helpers'; import TitledGreyBox from '@/components/elements/TitledGreyBox'; import { ServerContext } from '@/state/server'; import CopyOnClick from '@/components/elements/CopyOnClick'; +import Can from '@/elements/Can'; interface Stats { memory: number; @@ -70,12 +71,14 @@ const ServerDetailsBlock = () => { />  {!status ? 'Connecting...' : status}

- -

- - {primaryAllocation} -

-
+ + +

+ + {primaryAllocation} +

+
+

{stats.cpu.toFixed(2)}%

diff --git a/resources/scripts/routers/ServerRouter.tsx b/resources/scripts/routers/ServerRouter.tsx index ec6bc20b4..f5f8855a8 100644 --- a/resources/scripts/routers/ServerRouter.tsx +++ b/resources/scripts/routers/ServerRouter.tsx @@ -100,7 +100,7 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) Backups - + Network