Add project files.

This commit is contained in:
2025-08-20 11:07:36 +03:30
parent 3863c74931
commit 1a308a4069
899 changed files with 85379 additions and 0 deletions
@@ -0,0 +1,20 @@
@page "/"
@rendermode InteractiveServer
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
@@ -0,0 +1,36 @@
@page "/Error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@code{
[CascadingParameter] private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
}
@@ -0,0 +1,67 @@
@page "/weather"
@attribute [StreamRendering]
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates showing data.</p>
@if (forecasts == null)
{
<p>
<em>Loading...</em>
</p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate streaming rendering
await Task.Delay(500);
var startDate = DateOnly.FromDateTime(DateTime.Now);
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray();
}
private class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}
@@ -0,0 +1,28 @@
@page "/workflow-definitions/{definitionId}"
@using Elsa.Api.Client.Resources.WorkflowDefinitions.Models
@rendermode InteractiveServer
<WorkflowDefinitionEditorWrapper @ref="Editor" DefinitionId="@DefinitionId" WorkflowDefinitionVersionSelected="@WorkflowDefinitionVersionSelected"/>
<MudButton OnClick="@OnClick">Get Current Version</MudButton>
@code
{
/// <summary>
/// The ID of the workflow definition to edit.
/// </summary>
[Parameter]
public string DefinitionId { get; set; } = default!;
private WorkflowDefinitionEditorWrapper Editor { get; set; } = default!;
private Task WorkflowDefinitionVersionSelected(WorkflowDefinition arg)
{
return Task.CompletedTask;
}
private Task OnClick()
{
var selectedVersion = Editor.GetSelectedWorkflowDefinitionVersion();
return Task.CompletedTask;
}
}
@@ -0,0 +1,12 @@
@page "/workflow-definitions"
@rendermode InteractiveServer
<WorkflowDefinitionListWrapper EditWorkflowDefinition="@OnEditWorkflowDefinition" />
@code {
[Inject] NavigationManager NavigationManager { get; set; } = default!;
private void OnEditWorkflowDefinition(string definitionId)
{
NavigationManager.NavigateTo($"workflow-definitions/{definitionId}");
}
}
@@ -0,0 +1,12 @@
@page "/workflow-instances/{instanceId}"
@rendermode InteractiveServer
<WorkflowInstanceViewerWrapper InstanceId="@InstanceId"/>
@code
{
/// <summary>
/// The ID of the workflow instance to edit.
/// </summary>
[Parameter]
public string InstanceId { get; set; } = default!;
}
@@ -0,0 +1,15 @@
@page "/workflow-instances"
@rendermode InteractiveServer
<WorkflowInstanceListWrapper ViewWorkflowInstance="@OnViewWorkflowInstance"/>
@code {
[Inject] NavigationManager NavigationManager { get; set; } = default!;
private void OnViewWorkflowInstance(string instanceId)
{
NavigationManager.NavigateTo($"workflow-instances/{instanceId}");
}
}