Merge branch 'routing' into 'master'
Routing for modules See merge request murphg62/2023-ca400-murphg62-byrnm257!16
This commit is contained in:
commit
e44c7001a4
@ -39,6 +39,8 @@
|
|||||||
public string SelectedChartType {get; set;}
|
public string SelectedChartType {get; set;}
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public int ChartId {get; set;}
|
public int ChartId {get; set;}
|
||||||
|
[Parameter]
|
||||||
|
public string module {get; set;}
|
||||||
|
|
||||||
protected override void OnAfterRender(bool firstRender)
|
protected override void OnAfterRender(bool firstRender)
|
||||||
{
|
{
|
||||||
@ -53,8 +55,7 @@
|
|||||||
|
|
||||||
private async Task UpdateChartSeries()
|
private async Task UpdateChartSeries()
|
||||||
{
|
{
|
||||||
string module = "localhost:8080";
|
var response = await httpService.GetAsync<GraphComponent>($"http://localhost:10000/component/{module}/{ChartId}");
|
||||||
var response = await httpService.GetAsync<GraphComponent>($"http://localhost:10000/{module}/{ChartId}");
|
|
||||||
StatsList = response.Stats;
|
StatsList = response.Stats;
|
||||||
await chart.UpdateSeriesAsync(true);
|
await chart.UpdateSeriesAsync(true);
|
||||||
await InvokeAsync(() => StateHasChanged());
|
await InvokeAsync(() => StateHasChanged());
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
public List<Dictionary<string, object>> data { get; set; }
|
public List<Dictionary<string, object>> data { get; set; }
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public int TableId {get; set;}
|
public int TableId {get; set;}
|
||||||
|
[Parameter]
|
||||||
|
public string module {get; set;}
|
||||||
|
|
||||||
public IDictionary<string, Type> columns { get; set; }
|
public IDictionary<string, Type> columns { get; set; }
|
||||||
public string GetColumnPropertyExpression(string name, Type type)
|
public string GetColumnPropertyExpression(string name, Type type)
|
||||||
@ -63,9 +65,7 @@
|
|||||||
|
|
||||||
private async Task Update()
|
private async Task Update()
|
||||||
{
|
{
|
||||||
string module = "localhost:8080";
|
var response = await httpService.GetAsync<TableComponent>($"http://localhost:10000/component/{module}/{TableId}");
|
||||||
|
|
||||||
var response = await httpService.GetAsync<TableComponent>($"http://localhost:10000/{module}/{TableId}");
|
|
||||||
|
|
||||||
if (response.Data != null)
|
if (response.Data != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
@page "/test"
|
@page "/module/{moduleId}"
|
||||||
|
|
||||||
@using System.Net;
|
@using System.Net;
|
||||||
@using PanoptesFrontend.Data
|
@using PanoptesFrontend.Data
|
||||||
@ -8,48 +8,76 @@
|
|||||||
@inject IHttpService httpService
|
@inject IHttpService httpService
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
|
|
||||||
@if (tables != null | graphs != null)
|
@if (tables != null || graphs != null)
|
||||||
{
|
{
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
@if (graphs != null)
|
||||||
@foreach (var component in tables)
|
|
||||||
{
|
{
|
||||||
<div class="card mb-3">
|
@for (int i = 0; i < graphs.Length; i += 2)
|
||||||
<div class="card-body">
|
{
|
||||||
<DynamicTable data="@component.Data" TableId="@component.Id"/>
|
<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>
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
}
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
@if (tables != null)
|
||||||
@foreach (var component in graphs)
|
|
||||||
{
|
{
|
||||||
<div class="card mb-3">
|
<div class="col-md-12">
|
||||||
<div class="card-body">
|
@foreach (var table in tables)
|
||||||
<DynamicChart StatsList="@component.Stats"
|
{
|
||||||
SelectedChartType="@component.Graph"
|
<div class="card mb-3">
|
||||||
ChartTitle="@component.Title"
|
<div class="card-body">
|
||||||
ChartId="@component.Id"/>
|
<DynamicTable data="@table.Data" TableId="@table.Id" module="@moduleId"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private TableComponent[] tables;
|
private TableComponent[] tables;
|
||||||
private GraphComponent[] graphs;
|
private GraphComponent[] graphs;
|
||||||
|
[Parameter]
|
||||||
private string module = "localhost:8080";
|
public string moduleId { get; set; }
|
||||||
|
|
||||||
protected async override Task OnInitializedAsync()
|
protected async override Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
var schema = await httpService.GetAsync<Schema>($"http://localhost:10000/{module}/schema");
|
var schema = await httpService.GetAsync<Schema>("http://localhost:10000/" + moduleId + "/schema");
|
||||||
tables = schema.tables;
|
tables = schema.tables;
|
||||||
graphs = schema.graphs;
|
graphs = schema.graphs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
{
|
{
|
||||||
@foreach (var module in response){
|
@foreach (var module in response){
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href=@module.Name Match="NavLinkMatch.All">
|
<NavLink class="nav-link" href=@($"/module/{module.Name}") Match="NavLinkMatch.All">
|
||||||
<span class="oi oi-home" aria-hidden="true"></span> @module.Name
|
<span class="oi oi-home" aria-hidden="true"></span> @module.Name
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user