From 24147cba0f5723be3525e8f40d1954144841629b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 13 May 2021 13:00:00 +0200 Subject: ui: Address technical dept in frontend --- .../src/components/app/sidebars/topology/rack/MachineComponent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js') diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js index caa3dc04..4db0e7fe 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js @@ -1,5 +1,5 @@ import React from 'react' -import Shapes from '../../../../../shapes' +import { Machine } from '../../../../../shapes' const UnitIcon = ({ id, type }) => (
@@ -37,7 +37,7 @@ const MachineComponent = ({ position, machine, onClick }) => { } MachineComponent.propTypes = { - machine: Shapes.Machine, + machine: Machine, } export default MachineComponent -- cgit v1.2.3 From 53623fad76274e39206b8e073e371775ea96946b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 17 May 2021 12:16:10 +0200 Subject: ui: Migrate to FontAwesome 5 React library This change updates the frontend to use the FontAwesome 5 React library that renders SVG icons as opposed to CSS icon fonts. This migration resolves a couple of issues we had with server-side rendering of the previous FontAwesome icons. --- .../app/sidebars/topology/rack/MachineComponent.js | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js') diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js index 4db0e7fe..36b15c71 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js @@ -1,13 +1,16 @@ import React from 'react' +import Image from 'next/image' import { Machine } from '../../../../../shapes' +import { Badge, ListGroupItem } from 'reactstrap' const UnitIcon = ({ id, type }) => ( -
- + {'Machine
) @@ -17,22 +20,23 @@ const MachineComponent = ({ position, machine, onClick }) => { machine.cpuIds.length + machine.gpuIds.length + machine.memoryIds.length + machine.storageIds.length === 0 return ( -
  • - {position} + + {position} +
    {machine.cpuIds.length > 0 ? : undefined} {machine.gpuIds.length > 0 ? : undefined} {machine.memoryIds.length > 0 ? : undefined} {machine.storageIds.length > 0 ? : undefined} - {hasNoUnits ? ( - Machine with no units - ) : undefined} + {hasNoUnits ? Machine with no units : undefined}
    -
  • + ) } -- cgit v1.2.3