mirror of https://github.com/abpframework/abp.git
12 changed files with 147 additions and 20 deletions
@ -1,10 +1,22 @@ |
|||
@page |
|||
@page "{handler?}" |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
@using Volo.Abp |
|||
@using Volo.ClientSimulation |
|||
@model Volo.ClientSimulation.Web.Pages.SimulationAreaModel |
|||
<abp-button id="StartButton" button-type="Primary" asp-page-handler="Start">Start</abp-button> |
|||
<abp-button id="StopButton" button-type="Primary" abp-button="Primary" asp-page-handler="Stop">Stop</abp-button> |
|||
<abp-alert alert-type="Primary"> |
|||
<form class="d-inline" id="StartButtonForm" method="post" asp-page-handler="Start" data-ajaxForm="true"> |
|||
<abp-button button-type="Primary" type="submit" disabled="@(Model.Simulation.State != SimulationState.Stopped)">Start</abp-button> |
|||
</form> |
|||
<form class="d-inline" id="StopButtonForm" method="post" asp-page-handler="Stop" data-ajaxForm="true"> |
|||
<abp-button button-type="Primary" type="submit" disabled="@(Model.Simulation.State != SimulationState.Started)">Stop</abp-button> |
|||
</form> |
|||
<span class="ml-3"> |
|||
@Model.Simulation.State |
|||
</span> |
|||
</abp-alert> |
|||
<abp-card class="mt-3"> |
|||
<abp-card-body> |
|||
|
|||
@RandomHelper.GetRandom(1, 111) |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,12 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace></RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
using Volo.Abp.Http.Client.IdentityModel; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.ClientSimulation |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpHttpClientIdentityModelModule) |
|||
)] |
|||
public class ClientSimulationModule : AbpModule |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.ClientSimulation |
|||
{ |
|||
public class Simulation : ISingletonDependency |
|||
{ |
|||
public SimulationState State { get; private set; } |
|||
|
|||
public Task StartAsync() |
|||
{ |
|||
State = SimulationState.Starting; |
|||
State = SimulationState.Started; |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
public Task StopAsync() |
|||
{ |
|||
State = SimulationState.Stopping; |
|||
State = SimulationState.Stopped; |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Volo.ClientSimulation |
|||
{ |
|||
public enum SimulationState |
|||
{ |
|||
Stopped, |
|||
Starting, |
|||
Started, |
|||
Stopping |
|||
} |
|||
} |
|||
Loading…
Reference in new issue