31 lines
710 B
Plaintext
31 lines
710 B
Plaintext
@page "/counter"
|
|
@using System.Text.Json
|
|
@using HopFrame.Web
|
|
@using HopFrame.Web.Admin.Providers
|
|
@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>
|
|
|
|
@inject IAdminPagesProvider Provider
|
|
|
|
@code {
|
|
private int currentCount = 0;
|
|
private string[] permissions = ["web.counter"];
|
|
|
|
private void IncrementCount() {
|
|
currentCount++;
|
|
|
|
string json = JsonSerializer.Serialize(Provider.LoadRegisteredAdminPages(), new JsonSerializerOptions {
|
|
WriteIndented = true
|
|
});
|
|
|
|
Console.WriteLine(json);
|
|
}
|
|
|
|
} |