first commit -push
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<div class="paper @Class" style="width: @Width; @Style">
|
||||
<b class="text-title">@Title</b>
|
||||
<span class="text-data" style="color: @Color">@Data</span>
|
||||
<span class="text-unit">@Unit</span>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Color { get; set; } = "var(--dashboard-text-common-color)";
|
||||
|
||||
[Parameter]
|
||||
public string Data { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Class { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Style { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string Width { get; set; } = "14.17%";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
.paper {
|
||||
background: var(--dashboard-card-background-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
border-radius: 16px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.paper:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.paper::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--dashboard-card-background-color);
|
||||
transition: left 0.5s ease;
|
||||
}
|
||||
|
||||
.paper .text-title {
|
||||
font-size: 1.1vw;
|
||||
align-items: center;
|
||||
color: var(--dashboard-text-white-color);
|
||||
font-family: var(--dashboard-text-font-family);
|
||||
}
|
||||
|
||||
.paper .text-data {
|
||||
font-size: 2.5vw;
|
||||
font-weight: bold;
|
||||
color: var(--dashboard-text-white-color);
|
||||
}
|
||||
|
||||
.paper .text-unit {
|
||||
font-size: 0.8vw;
|
||||
color: var(--dashboard-text-white-color);
|
||||
font-family: var(--dashboard-text-font-family);
|
||||
}
|
||||
29
RobotNet.WebApp/Dashboard/Components/DailyData.razor
Normal file
29
RobotNet.WebApp/Dashboard/Components/DailyData.razor
Normal file
@@ -0,0 +1,29 @@
|
||||
@using RobotNet.Script.Shares.Dashboard
|
||||
<div class="d-flex w-100 h-100 flex-row">
|
||||
<DailyComponentData Title="Completed" Data="@DataParam.Completed.ToString()" Unit="mission" Color="var(--dashboard-text-green-color)" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Error" Data="@DataParam.Error.ToString()" Unit="mission" Color="var(--dashboard-text-orange-color)" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Total" Data="@DataParam.Total.ToString()" Unit="mission" Color="var(--dashboard-text-green-color)" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Completed Rate" Data="@DataParam.CompletedRate.ToString()" Unit="@("\u200B")" Color="var(--dashboard-text-green-color)" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Takt Time Min" Data="@Math.Round(DataParam.TaktTimeMin, 2).ToString()" Unit="minute" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Takt Time Average" Data="@Math.Round(DataParam.TaktTimeAverage, 2).ToString()" Unit="minute" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Takt Time Max" Data="@Math.Round(DataParam.TaktTimeMax, 2).ToString()" Unit="minute" Width="@width" />
|
||||
<DailyComponentData Style="margin-left: 20px" Title="Robot" Data="@DataParam.RobotOnline.ToString()" Unit="online" Width="@width" />
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string width = "12.25%";
|
||||
|
||||
private DailyMissionDto DataParam = new();
|
||||
public void UpdateData(DailyMissionDto data)
|
||||
{
|
||||
DataParam.Completed = data.Completed;
|
||||
DataParam.Error = data.Error;
|
||||
DataParam.Total = data.Total;
|
||||
DataParam.CompletedRate = data.CompletedRate;
|
||||
DataParam.TaktTimeMin = data.TaktTimeMin;
|
||||
DataParam.TaktTimeAverage = data.TaktTimeAverage;
|
||||
DataParam.TaktTimeMax = data.TaktTimeMax;
|
||||
DataParam.RobotOnline = data.RobotOnline;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
@using RobotNet.Script.Shares.Dashboard
|
||||
@using RobotNet.WebApp.Charts.Components
|
||||
@using RobotNet.WebApp.Charts.Core
|
||||
@using RobotNet.WebApp.Charts.Models.BarChart
|
||||
@using RobotNet.WebApp.Charts.Models.BarChart.Axes
|
||||
@using RobotNet.WebApp.Charts.Models.Common.Dataset
|
||||
@using RobotNet.WebApp.Charts.Enums
|
||||
|
||||
<div class="paper">
|
||||
<BarChart @ref="ChartRef" Width="100" WidthUnit="Unit.Percentage" Height="100" HeightUnit="Unit.Percentage" Style="height: 30vh; width: 50vw" />
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private BarChart ChartRef = default!;
|
||||
private BarChartOptions ChartOptions = default!;
|
||||
private ChartData ChartData = default!;
|
||||
|
||||
private DailyPerformanceDto[] DataParam = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var completed = new BarChartDataset() { Label = "Completed", BackgroundColor = [ChartColors.GreenStr], Data = [.. DataParam.Select(d => d.Completed)] };
|
||||
var error = new BarChartDataset() { Label = "Error", BackgroundColor = [ChartColors.OrangeStr], Data = [.. DataParam.Select(d => d.Error)] };
|
||||
var other = new BarChartDataset() { Label = "Other", BackgroundColor = [ChartColors.GrayStr], Data = [.. DataParam.Select(d => d.Other)] };
|
||||
ChartData = new ChartData { Labels = [.. DataParam.Select(d => d.Label)], Datasets = [completed, error, other] };
|
||||
|
||||
ChartOptions = new()
|
||||
{
|
||||
Responsive = true,
|
||||
Scales = new()
|
||||
{
|
||||
X = new()
|
||||
{
|
||||
Title = new ChartAxesTitle
|
||||
{
|
||||
Text = "Day",
|
||||
Display = true,
|
||||
Color = "#d6d6db",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Size = 15,
|
||||
}
|
||||
},
|
||||
Stacked = true,
|
||||
Grid = new()
|
||||
{
|
||||
Display = false,
|
||||
},
|
||||
Ticks = new()
|
||||
{
|
||||
Color = "#d6d6db"
|
||||
}
|
||||
},
|
||||
Y = new()
|
||||
{
|
||||
Title = new ChartAxesTitle
|
||||
{
|
||||
Text = "Mission",
|
||||
Display = true,
|
||||
Color = "#d6d6db",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Size = 15,
|
||||
},
|
||||
},
|
||||
Min = 0,
|
||||
Stacked = true,
|
||||
Grid = new()
|
||||
{
|
||||
Display = false,
|
||||
},
|
||||
Ticks = new()
|
||||
{
|
||||
Color = "#d6d6db"
|
||||
}
|
||||
},
|
||||
},
|
||||
Plugins = new()
|
||||
{
|
||||
Datalabels = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
BorderColor = "transparent",
|
||||
},
|
||||
Title = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
Text = "Weekly AMR Performance",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Size = 20,
|
||||
Weight = "normal",
|
||||
},
|
||||
},
|
||||
Legend = new()
|
||||
{
|
||||
Display = true,
|
||||
Labels = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Weight = "normal",
|
||||
Size = 15,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await ChartRef.InitializeAsync(chartData: ChartData, chartOptions: ChartOptions);
|
||||
}
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
public async Task UpdateData(DailyPerformanceDto[] dataParam)
|
||||
{
|
||||
var completed = new BarChartDataset() { Label = "Completed", BackgroundColor = [ChartColors.GreenStr], Data = [.. dataParam.Select(d => d.Completed)] };
|
||||
var error = new BarChartDataset() { Label = "Error", BackgroundColor = [ChartColors.OrangeStr], Data = [.. dataParam.Select(d => d.Error)] };
|
||||
var other = new BarChartDataset() { Label = "Other", BackgroundColor = [ChartColors.GrayStr], Data = [.. dataParam.Select(d => d.Other)] };
|
||||
ChartData = new ChartData { Labels = [.. dataParam.Select(d => d.Label)], Datasets = [completed, error, other] };
|
||||
|
||||
await ChartRef.UpdateValuesAsync(ChartData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.paper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 0 1rem 0 1rem;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
background: var(--dashboard-card-background-color);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.paper:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.paper::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--dashboard-card-background-color);
|
||||
transition: left 0.5s ease;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
@using RobotNet.Script.Shares.Dashboard
|
||||
@using RobotNet.WebApp.Charts.Components
|
||||
@using RobotNet.WebApp.Charts.Core
|
||||
@using RobotNet.WebApp.Charts.Models.Common.Dataset
|
||||
@using RobotNet.WebApp.Charts.Models.PieChart
|
||||
@using RobotNet.WebApp.Charts.Enums
|
||||
|
||||
<div class="paper">
|
||||
<PieChart @ref="ChartRef" IsDoughnutChart="true" Width="100" WidthUnit="Unit.Percentage" Height="100" HeightUnit="Unit.Percentage" />
|
||||
<div class="text-percent">@($"{CompletedPercent}%")</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string ChartName { get; set; } = "";
|
||||
|
||||
private PieChart ChartRef = default!;
|
||||
private PieChartOptions ChartOptions = default!;
|
||||
private ChartData ChartData = default!;
|
||||
private PieChartDataset ChartDataSet = default!;
|
||||
|
||||
private int CompletedPercent = 0;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
|
||||
ChartDataSet = new PieChartDataset() { BackgroundColor = [ChartColors.GreenStr, ChartColors.OrangeStr, ChartColors.GrayStr], Data = [90, 10, 10] };
|
||||
ChartData = new ChartData { Labels = ["Completed", "Error", "Other"], Datasets = [ChartDataSet] };
|
||||
|
||||
ChartOptions = new()
|
||||
{
|
||||
Responsive = true,
|
||||
Cutout = "50%",
|
||||
Plugins = new()
|
||||
{
|
||||
Datalabels = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
BorderColor = "transparent",
|
||||
},
|
||||
Title = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
Text = ChartName,
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Size = 20,
|
||||
Weight = "normal",
|
||||
},
|
||||
},
|
||||
Legend = new()
|
||||
{
|
||||
Display = false,
|
||||
Position = LegendPosition.Top,
|
||||
Labels = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Weight = "normal",
|
||||
Size = 15,
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
if (!firstRender) return;
|
||||
await ChartRef.InitializeAsync(chartData: ChartData, chartOptions: ChartOptions);
|
||||
}
|
||||
|
||||
public async Task UpdateData(DailyPerformanceDto data)
|
||||
{
|
||||
ChartDataSet = new PieChartDataset() { BackgroundColor = [ChartColors.GreenStr, ChartColors.OrangeStr, ChartColors.GrayStr], Data = [data.Completed, data.Error, data.Other] };
|
||||
ChartData = new ChartData { Labels = ["Completed", "Error", "Other"], Datasets = [ChartDataSet] };
|
||||
await ChartRef.UpdateValuesAsync(ChartData);
|
||||
|
||||
if (data.Completed + data.Error + data.Other != 0) CompletedPercent = (int)(data.Completed * 100.0 / (data.Completed + data.Error + data.Other) + 0.5);
|
||||
else CompletedPercent = 0;
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
.paper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 0 1rem 1rem 1rem;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
background: var(--dashboard-card-background-color);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.paper:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.paper::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--dashboard-card-background-color);
|
||||
transition: left 0.5s ease;
|
||||
}
|
||||
|
||||
.paper .text-percent {
|
||||
font-size: 3vw;
|
||||
line-height: 3vw;
|
||||
color: #00cc00;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: 48%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
padding: 50px 0 12px 0;
|
||||
}
|
||||
122
RobotNet.WebApp/Dashboard/Components/TaktTimeLineChart.razor
Normal file
122
RobotNet.WebApp/Dashboard/Components/TaktTimeLineChart.razor
Normal file
@@ -0,0 +1,122 @@
|
||||
@using RobotNet.Script.Shares.Dashboard
|
||||
@using RobotNet.WebApp.Charts.Components
|
||||
@using RobotNet.WebApp.Charts.Core
|
||||
@using RobotNet.WebApp.Charts.Models.Common
|
||||
@using RobotNet.WebApp.Charts.Models.Common.Dataset
|
||||
@using RobotNet.WebApp.Charts.Models.LineChart
|
||||
@using RobotNet.WebApp.Charts.Enums
|
||||
|
||||
<div class="paper">
|
||||
<LineChart @ref="ChartRef" Width="100" WidthUnit="Unit.Percentage" Height="100" HeightUnit="Unit.Percentage" Style="height: 30vh; width: 50vw" />
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private LineChart ChartRef = default!;
|
||||
private LineChartOptions ChartOptions = default!;
|
||||
private ChartData ChartData = default!;
|
||||
|
||||
private TaktTimeMissionDto[] DataParam = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var minDataset = new LineChartDataset() { Label = "Min", BackgroundColor = [ChartColors.ColorList[0]], BorderColor = [ChartColors.ColorList[0]], Data = [..DataParam.Select(d => d.Min)]};
|
||||
var AverageDataset = new LineChartDataset() { Label = "Average", BackgroundColor = [ChartColors.ColorList[1]], BorderColor = [ChartColors.ColorList[1]], Data = [.. DataParam.Select(d => d.Average)] };
|
||||
var maxDataset = new LineChartDataset() { Label = "Max", BackgroundColor = [ChartColors.ColorList[2]], BorderColor = [ChartColors.ColorList[2]], Data = [.. DataParam.Select(d => d.Max)] };
|
||||
ChartData = new ChartData { Labels = [.. DataParam.Select(d => d.Label)], Datasets = [minDataset, AverageDataset, maxDataset] };
|
||||
|
||||
ChartOptions = new()
|
||||
{
|
||||
Responsive = true,
|
||||
Interaction = new() { Mode = InteractionMode.Index, Intersect = false },
|
||||
Scales = new()
|
||||
{
|
||||
X = new()
|
||||
{
|
||||
Title = new()
|
||||
{
|
||||
Text = "Day",
|
||||
Display = true,
|
||||
Color = "#d6d6db",
|
||||
},
|
||||
Grid = new()
|
||||
{
|
||||
Display = false,
|
||||
},
|
||||
Ticks = new()
|
||||
{
|
||||
Color = "#d6d6db"
|
||||
}
|
||||
},
|
||||
Y = new()
|
||||
{
|
||||
Title = new()
|
||||
{
|
||||
Text = "Minute",
|
||||
Display = true,
|
||||
Color = "#d6d6db",
|
||||
},
|
||||
Grid = new()
|
||||
{
|
||||
Display = false,
|
||||
},
|
||||
Ticks = new()
|
||||
{
|
||||
Color = "#d6d6db"
|
||||
}
|
||||
},
|
||||
},
|
||||
Plugins = new()
|
||||
{
|
||||
Datalabels = new()
|
||||
{
|
||||
Display = false,
|
||||
},
|
||||
Legend = new()
|
||||
{
|
||||
Display = true,
|
||||
Labels = new()
|
||||
{
|
||||
Color = "#d6d6db",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Weight = "normal",
|
||||
Size = 15,
|
||||
},
|
||||
}
|
||||
},
|
||||
Title = new()
|
||||
{
|
||||
FullSize = false,
|
||||
Color = "#d6d6db",
|
||||
Text = "AMR Takt Time",
|
||||
Font = new()
|
||||
{
|
||||
Family = "Roboto",
|
||||
Size = 20,
|
||||
Weight = "normal",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await ChartRef.InitializeAsync(chartData: ChartData, chartOptions: ChartOptions);
|
||||
}
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
public async Task UpdateData(TaktTimeMissionDto[] dataParam)
|
||||
{
|
||||
var minDataset = new LineChartDataset() { Label = "Min", BackgroundColor = [ChartColors.ColorList[0]], BorderColor = [ChartColors.ColorList[0]], Data = [.. dataParam.Select(d => d.Min)] };
|
||||
var AverageDataset = new LineChartDataset() { Label = "Average", BackgroundColor = [ChartColors.ColorList[1]], BorderColor = [ChartColors.ColorList[1]], Data = [.. dataParam.Select(d => d.Average)] };
|
||||
var maxDataset = new LineChartDataset() { Label = "Max", BackgroundColor = [ChartColors.ColorList[2]], BorderColor = [ChartColors.ColorList[2]], Data = [.. dataParam.Select(d => d.Max)] };
|
||||
ChartData = new ChartData { Labels = [.. dataParam.Select(d => d.Label)], Datasets = [minDataset, AverageDataset, maxDataset] };
|
||||
|
||||
await ChartRef.UpdateValuesAsync(ChartData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.paper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 0 1rem 0 1rem;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
background: var(--dashboard-card-background-color);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.paper:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.paper::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--dashboard-card-background-color);
|
||||
transition: left 0.5s ease;
|
||||
}
|
||||
Reference in New Issue
Block a user