89 lines
3.3 KiB
Plaintext
89 lines
3.3 KiB
Plaintext
@page "/module/{moduleId}"
|
|
|
|
@using System.Net;
|
|
@using PanoptesFrontend.Data
|
|
@using PanoptesFrontend.Services
|
|
@using System
|
|
@using System.Text.Json
|
|
@using Microsoft.AspNetCore.Components.Web
|
|
@inject IHttpService httpService
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
@if (tables != null || graphs != null)
|
|
{
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
@if (graphs != null)
|
|
{
|
|
@for (int i = 0; i < graphs.Length; i += 2)
|
|
{
|
|
<div class="col-md-12">
|
|
<div class="row">
|
|
@if (i < graphs.Length)
|
|
{
|
|
<div class="col-md-6">
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<DynamicChart StatsList="@graphs[i].Stats"
|
|
SelectedChartType="@graphs[i].Graph"
|
|
ChartTitle="@graphs[i].Title"
|
|
ChartId="@graphs[i].Id"
|
|
module="@moduleId"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
@if (i + 1 < graphs.Length)
|
|
{
|
|
<div class="col-md-6">
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<DynamicChart StatsList="@graphs[i + 1].Stats"
|
|
SelectedChartType="@graphs[i + 1].Graph"
|
|
ChartTitle="@graphs[i + 1].Title"
|
|
ChartId="@graphs[i + 1].Id"
|
|
module="@moduleId"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
@if (tables != null)
|
|
{
|
|
<div class="col-md-12">
|
|
@foreach (var table in tables)
|
|
{
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<DynamicTable data="@table.Data" TableId="@table.Id" module="@moduleId"/>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
|
|
@code {
|
|
private TableComponent[] tables;
|
|
private GraphComponent[] graphs;
|
|
[Parameter]
|
|
public string moduleId { get; set; }
|
|
|
|
protected async override Task OnInitializedAsync()
|
|
{
|
|
var panoptesHost = Environment.GetEnvironmentVariable("PANOPTESHOST");
|
|
var schema = await httpService.GetAsync<Schema>($"http://{panoptesHost}/{moduleId}/schema");
|
|
tables = schema.tables;
|
|
graphs = schema.graphs;
|
|
}
|
|
|
|
}
|
|
|