From 2cd688dc176f922cf47aa57bcead303581800a5d Mon Sep 17 00:00:00 2001 From: Michel Zimmer Date: Mon, 29 Aug 2022 20:33:25 +0200 Subject: [PATCH] Add connections to host details pane --- Dockerfile | 2 +- package.json | 2 +- src/HostDetails.module.css | 14 +++++- src/HostDetails.tsx | 95 ++++++++++++++++++++++++++++++++++++-- src/Main.module.css | 1 + src/Main.tsx | 11 +++-- src/Stats.ts | 34 ++++++++++---- src/index.css | 2 +- 8 files changed, 140 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4bd7f7..f9f5cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,5 +24,5 @@ LABEL org.opencontainers.image.vendor="neuland – Büro für Informatik GmbH" LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.title="bandwhichd-ui" LABEL org.opencontainers.image.description="bandwhichd ui displaying network topology and statistics" -LABEL org.opencontainers.image.version="0.2.0" +LABEL org.opencontainers.image.version="0.3.0" COPY --from=build --chown=root:root /home/node/dist /usr/share/nginx/html \ No newline at end of file diff --git a/package.json b/package.json index e88cb6b..1674f66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bandwhichd-ui", - "version": "0.2.0", + "version": "0.3.0", "description": "bandwhichd ui displaying network topology and statistics", "license": "MIT", "private": true, diff --git a/src/HostDetails.module.css b/src/HostDetails.module.css index 2f10ce9..911608c 100644 --- a/src/HostDetails.module.css +++ b/src/HostDetails.module.css @@ -1,7 +1,17 @@ -.hostDetails { +.host-details { background-color: #eeeeee; } -.hostDetails > section { +.host-details > section { padding: .5em; +} + +.host-details > section > ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +.host-details > section > ul > li + li { + margin-top: .5em; } \ No newline at end of file diff --git a/src/HostDetails.tsx b/src/HostDetails.tsx index 48f4774..8e3d517 100644 --- a/src/HostDetails.tsx +++ b/src/HostDetails.tsx @@ -1,9 +1,12 @@ -import { Host } from "./Stats"; +import { Map } from "immutable"; +import { Connection, Host, HostId, Stats, UnmonitoredHost } from "./Stats"; import style from "./HostDetails.module.css"; export interface HostDetailsProps { - maybeSelectedHost: Host | null; + maybeStats: Stats | null; + maybeSelectedHost: Host & { hostId: HostId } | null; + setMaybeSelectedHostId: (maybeSelectedHostId: HostId | null) => void, } export const HostDetails: React.FC = @@ -13,9 +16,95 @@ export const HostDetails: React.FC = } const selectedHost = props.maybeSelectedHost; - return