mirror of https://github.com/abpframework/abp.git
6 changed files with 71 additions and 10 deletions
@ -1,8 +1,10 @@ |
|||||
@page |
@page |
||||
@model Volo.ClientSimulation.Web.Pages.IndexModel |
@model Volo.ClientSimulation.Web.Pages.IndexModel |
||||
@{ |
@section scripts |
||||
|
{ |
||||
|
<abp-script-bundle> |
||||
|
<abp-script src="/Pages/SimulationArea.js" /> |
||||
|
<abp-script src="/Pages/Index.js" /> |
||||
|
</abp-script-bundle> |
||||
} |
} |
||||
<div> |
<div id="SimulationArea"></div> |
||||
<a abp-button="Primary" href="#">Start</a> |
|
||||
<a abp-button="Primary" href="#">Stop</a> |
|
||||
</div> |
|
||||
@ -1,16 +1,13 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages; |
using Microsoft.AspNetCore.Mvc.RazorPages; |
||||
|
|
||||
namespace Volo.ClientSimulation.Web.Pages |
namespace Volo.ClientSimulation.Web.Pages |
||||
{ |
{ |
||||
public class IndexModel : PageModel |
public class IndexModel : PageModel |
||||
{ |
{ |
||||
public void OnGet() |
public async Task OnGetAsync() |
||||
{ |
{ |
||||
|
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
(function ($) { |
||||
|
$(function () { |
||||
|
SimulationArea.init($('#SimulationArea')); |
||||
|
}); |
||||
|
})(jQuery); |
||||
@ -0,0 +1,10 @@ |
|||||
|
@page |
||||
|
@{ |
||||
|
Layout = null; |
||||
|
} |
||||
|
@using Volo.Abp |
||||
|
@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> |
||||
|
|
||||
|
@RandomHelper.GetRandom(1, 111) |
||||
@ -0,0 +1,26 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.AspNetCore.Mvc.RazorPages; |
||||
|
|
||||
|
namespace Volo.ClientSimulation.Web.Pages |
||||
|
{ |
||||
|
public class SimulationAreaModel : PageModel |
||||
|
{ |
||||
|
public async Task OnGetAsync() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public async Task PostStartAsync() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public async Task PostStopAsync() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
var SimulationArea = {}; |
||||
|
(function ($) { |
||||
|
|
||||
|
var $mainContainer = null; |
||||
|
|
||||
|
function refreshSimulationArea() { |
||||
|
$.get('/SimulationArea').done( |
||||
|
function (result) { |
||||
|
$mainContainer.html(result); |
||||
|
}).always(function () { |
||||
|
setTimeout(refreshSimulationArea, 1000); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
SimulationArea.init = function ($container) { |
||||
|
$mainContainer = $container; |
||||
|
console.log('Simulation initialized'); |
||||
|
setTimeout(refreshSimulationArea, 1000); |
||||
|
}; |
||||
|
|
||||
|
})(jQuery); |
||||
Loading…
Reference in new issue