Skip to content

Commit 6eeafde

Browse files
committed
chore: 增加 TaskDashboard 组件
1 parent b0d8f58 commit 6eeafde

8 files changed

Lines changed: 104 additions & 1 deletion

File tree

BootstrapBlazor.Extensions.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 18
4-
VisualStudioVersion = 18.0.10828.68 main
4+
VisualStudioVersion = 18.0.10828.68
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "components", "components", "{FF1089BE-C704-4374-B629-C57C08E1798F}"
77
EndProject
@@ -200,6 +200,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.OpcDa", "sr
200200
EndProject
201201
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestOpcDa", "test\UnitTestOpcDa\UnitTestOpcDa.csproj", "{835C8BA9-A9CC-4EA0-9002-34A20F8B2E86}"
202202
EndProject
203+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Tasks.Dashboard", "src\components\BootstrapBlazor.Tasks.Dashboard\BootstrapBlazor.Tasks.Dashboard.csproj", "{30C57119-C564-401C-AE3A-6203E2733E1A}"
204+
EndProject
203205
Global
204206
GlobalSection(SolutionConfigurationPlatforms) = preSolution
205207
Debug|Any CPU = Debug|Any CPU
@@ -546,6 +548,10 @@ Global
546548
{835C8BA9-A9CC-4EA0-9002-34A20F8B2E86}.Debug|Any CPU.Build.0 = Debug|Any CPU
547549
{835C8BA9-A9CC-4EA0-9002-34A20F8B2E86}.Release|Any CPU.ActiveCfg = Release|Any CPU
548550
{835C8BA9-A9CC-4EA0-9002-34A20F8B2E86}.Release|Any CPU.Build.0 = Release|Any CPU
551+
{30C57119-C564-401C-AE3A-6203E2733E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
552+
{30C57119-C564-401C-AE3A-6203E2733E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
553+
{30C57119-C564-401C-AE3A-6203E2733E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
554+
{30C57119-C564-401C-AE3A-6203E2733E1A}.Release|Any CPU.Build.0 = Release|Any CPU
549555
EndGlobalSection
550556
GlobalSection(SolutionProperties) = preSolution
551557
HideSolutionNode = FALSE
@@ -640,6 +646,7 @@ Global
640646
{98373A64-E224-4715-AE02-A8C6DAFF3338} = {B6A98ADE-D26A-4D0B-8978-AB7AC915F5AE}
641647
{01007B10-7C3C-4136-83FF-981CA39AD3D4} = {7B29E81D-92DE-46C8-8EDC-1B48C8F12BC2}
642648
{835C8BA9-A9CC-4EA0-9002-34A20F8B2E86} = {B6A98ADE-D26A-4D0B-8978-AB7AC915F5AE}
649+
{30C57119-C564-401C-AE3A-6203E2733E1A} = {FF1089BE-C704-4374-B629-C57C08E1798F}
643650
EndGlobalSection
644651
GlobalSection(ExtensibilityGlobals) = postSolution
645652
SolutionGuid = {D5EB1960-6F30-4CE1-B375-EAE1F787D6FF}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<Version>9.0.0-beta01</Version>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Task Dashboard</PackageTags>
9+
<Description>Bootstrap UI components extensions of Task</Description>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<Content Remove="Locales\en-US.json" />
14+
<Content Remove="Locales\zh-CN.json" />
15+
<EmbeddedResource Include="Locales\en-US.json" />
16+
<EmbeddedResource Include="Locales\zh-CN.json" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="BootstrapBlazor" Version="9.0.1" />
21+
<PackageReference Include="Longbow.Tasks" Version="9.0.1" />
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<ProjectReference Include="..\..\..\..\BootstrapBlazor\src\BootstrapBlazor\BootstrapBlazor.csproj" />
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<Using Include="BootstrapBlazor.Components" />
30+
<Using Include="Longbow.Tasks" />
31+
</ItemGroup>
32+
33+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@namespace BootstrapBlazor.Components
2+
@inherits BootstrapComponentBase
3+
4+
<div @attributes="AdditionalAttributes" class="@ClassString">
5+
<Table TItem="IScheduler" Items="@_schedulers">
6+
<TableColumns>
7+
<TableTemplateColumn Text="@Localizer["Name"]"></TableTemplateColumn>
8+
<TableTemplateColumn Text="@Localizer["Status"]"></TableTemplateColumn>
9+
<TableTemplateColumn Text="@Localizer["NextRuntime"]"></TableTemplateColumn>
10+
<TableTemplateColumn Text="@Localizer["LastRuntime"]"></TableTemplateColumn>
11+
<TableTemplateColumn Text="@Localizer["LastRunResult"]"></TableTemplateColumn>
12+
<TableTemplateColumn Text="@Localizer["TaskStatus"]"></TableTemplateColumn>
13+
<TableTemplateColumn Text="@Localizer["Exception"]"></TableTemplateColumn>
14+
</TableColumns>
15+
</Table>
16+
</div>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
using Microsoft.AspNetCore.Components;
6+
using Microsoft.Extensions.Localization;
7+
8+
namespace BootstrapBlazor.Components;
9+
10+
/// <summary>
11+
/// Task Dashboard Component
12+
/// </summary>
13+
public partial class TaskDashboard
14+
{
15+
[Inject, NotNull]
16+
private IStringLocalizer<TaskDashboard>? Localizer { get; set; }
17+
18+
private string? ClassString => CssBuilder.Default("bb-tasks-dashboard")
19+
.AddClassFromAttributes(AdditionalAttributes)
20+
.Build();
21+
22+
private IEnumerable<IScheduler> _schedulers = [];
23+
24+
/// <summary>
25+
/// <inheritdoc/>
26+
/// </summary>
27+
protected override void OnParametersSet()
28+
{
29+
base.OnParametersSet();
30+
31+
_schedulers = TaskServicesManager.ToList();
32+
}
33+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.my-component {
2+
border: 2px dashed red;
3+
padding: 1em;
4+
margin: 1em 0;
5+
background-image: url('background.png');
6+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@using Microsoft.AspNetCore.Components.Web
2+
@using Longbow.Tasks

0 commit comments

Comments
 (0)