From 8bcb72b2596713611ee7c924701b7207d4345de0 Mon Sep 17 00:00:00 2001 From: Gary Murphy Date: Sat, 6 May 2023 20:14:56 +0100 Subject: [PATCH] updated dynamic component layout --- src/PanoptesFrontend/Pages/ModDisplay.razor | 71 ++++++++++++++------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/src/PanoptesFrontend/Pages/ModDisplay.razor b/src/PanoptesFrontend/Pages/ModDisplay.razor index 7750191..6f9a93f 100644 --- a/src/PanoptesFrontend/Pages/ModDisplay.razor +++ b/src/PanoptesFrontend/Pages/ModDisplay.razor @@ -8,37 +8,64 @@ @inject IHttpService httpService @inject IJSRuntime JSRuntime -@if (tables != null | graphs != null) +@if (tables != null || graphs != null) {
-
-
- @foreach (var component in tables) +
+ @if (graphs != null) { -
-
- + @for (int i = 0; i < graphs.Length; i += 2) + { +
+
+ @if (i < graphs.Length) + { +
+
+
+ +
+
+
+ } + @if (i + 1 < graphs.Length) + { +
+
+
+ +
+
+
+ } +
-
+ } } -
-
- @foreach (var component in graphs) + + @if (tables != null) { -
-
- -
+
+ @foreach (var table in tables) + { +
+
+ +
+
+ }
}
-
- } @@ -50,7 +77,7 @@ protected async override Task OnInitializedAsync() { - var schema = await httpService.GetAsync("http://localhost:10000/" + @moduleId + "/schema"); + var schema = await httpService.GetAsync("http://localhost:10000/" + moduleId + "/schema"); tables = schema.tables; graphs = schema.graphs; }