Remove sample files, change main index to dashboard page
This commit is contained in:
parent
24d6169027
commit
03656e6284
@ -1,18 +0,0 @@
|
||||
@page "/counter"
|
||||
|
||||
<PageTitle>Counter</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h3" GutterBottom="true">Counter</MudText>
|
||||
<MudText Class="mb-4">Current count: @currentCount</MudText>
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" @onclick="IncrementCount">Click me</MudButton>
|
||||
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
}
|
||||
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
@inject NavigationManager UriHelper
|
||||
@inject IDialogService DialogService
|
||||
|
||||
@page "/Dashboard"
|
||||
@page "/"
|
||||
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
@ -13,64 +13,64 @@
|
||||
@if (response is null)
|
||||
{
|
||||
@for (uint i = 0; i < 3; i++)
|
||||
{
|
||||
<MudItem xs="12" md="6" lg="4">
|
||||
<MudCard Outlined="true">
|
||||
<MudCardContent>
|
||||
<MudSkeleton Width="30%" Height="42px;" Class="mb-5"/>
|
||||
<MudSkeleton Width="80%"/>
|
||||
<MudSkeleton Width="100%"/>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudStack Row="true" Style="width:100%" Spacing="4" Justify="Justify.FlexEnd">
|
||||
<MudSkeleton Width="64px" Height="40px"/>
|
||||
<MudSkeleton Width="64px" Height="40px"/>
|
||||
</MudStack>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
}
|
||||
{
|
||||
<MudItem xs="12" md="6" lg="4">
|
||||
<MudCard Outlined="true">
|
||||
<MudCardContent>
|
||||
<MudSkeleton Width="30%" Height="42px;" Class="mb-5"/>
|
||||
<MudSkeleton Width="80%"/>
|
||||
<MudSkeleton Width="100%"/>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudStack Row="true" Style="width:100%" Spacing="4" Justify="Justify.FlexEnd">
|
||||
<MudSkeleton Width="64px" Height="40px"/>
|
||||
<MudSkeleton Width="64px" Height="40px"/>
|
||||
</MudStack>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
}
|
||||
else if(response.Users.Count != 0)
|
||||
}
|
||||
else if (response.Users.Count != 0)
|
||||
{
|
||||
@foreach (var user in response.Users)
|
||||
{
|
||||
<MudItem xs="12" md="6" lg="4">
|
||||
<MudCard Outlined="true">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight:bold">@user.Baid</MudText>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<MudText Style="font-weight:bold">Access Code</MudText>
|
||||
<MudText Style="font-family:monospace">@user.AccessCode</MudText>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudStack Row="true" Style="width:100%" Spacing="4" Justify="Justify.FlexEnd">
|
||||
<MudButton Size="Size.Small" Variant="Variant.Text" StartIcon="@Icons.Material.Filled.Delete"
|
||||
<MudItem xs="12" md="6" lg="4">
|
||||
<MudCard Outlined="true">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight:bold">@user.Baid</MudText>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<MudText Style="font-weight:bold">Access Code</MudText>
|
||||
<MudText Style="font-family:monospace">@user.AccessCode</MudText>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudStack Row="true" Style="width:100%" Spacing="4" Justify="Justify.FlexEnd">
|
||||
<MudButton Size="Size.Small" Variant="Variant.Text" StartIcon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="_ => DeleteCard(user)">
|
||||
Delete
|
||||
</MudButton>
|
||||
<MudButton OnClick="() => NavigateToProfile(user.Baid)"
|
||||
Delete
|
||||
</MudButton>
|
||||
<MudButton OnClick="() => NavigateToProfile(user.Baid)"
|
||||
Size="Size.Small" Variant="Variant.Text" StartIcon="@Icons.Material.Filled.Edit"
|
||||
Color="Color.Primary">
|
||||
Edit
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
Edit
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudItem xs="12">
|
||||
<MudText Align="Align.Center" Class="my-8">
|
||||
No data.
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Align="Align.Center" Class="my-8">
|
||||
No data.
|
||||
</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
</MudGrid>
|
||||
|
||||
@ -93,9 +93,9 @@
|
||||
private async Task DeleteCard(User user)
|
||||
{
|
||||
var parameters = new DialogParameters
|
||||
{
|
||||
["user"] = user
|
||||
};
|
||||
{
|
||||
["user"] = user
|
||||
};
|
||||
|
||||
var dialog = DialogService.Show<CardDeleteConfirmDialog>("Delete Card", parameters);
|
||||
var result = await dialog.Result;
|
||||
|
@ -1,62 +0,0 @@
|
||||
@page "/fetchdata"
|
||||
@inject HttpClient Http
|
||||
@using TaikoWebUI.Shared
|
||||
|
||||
<PageTitle>Weather forecast</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h3" GutterBottom="true">Weather forecast</MudText>
|
||||
<MudText Class="mb-8">This component demonstrates fetching data from the server.</MudText>
|
||||
@if (forecasts == null)
|
||||
{
|
||||
<MudProgressCircular Color="Color.Default" Indeterminate="true"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="forecasts" Hover="true" SortLabel="Sort By" Elevation="0">
|
||||
<HeaderContent>
|
||||
<MudTh>
|
||||
<MudTableSortLabel InitialDirection="SortDirection.Ascending" SortBy="new Func<WeatherForecast, object>(x=>x.Date)">Date</MudTableSortLabel>
|
||||
</MudTh>
|
||||
<MudTh>
|
||||
<MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureC)">Temp. (C)</MudTableSortLabel>
|
||||
</MudTh>
|
||||
<MudTh>
|
||||
<MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureF)">Temp. (F)</MudTableSortLabel>
|
||||
</MudTh>
|
||||
<MudTh>
|
||||
<MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.Summary!)">Summary</MudTableSortLabel>
|
||||
</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Date">@context.Date</MudTd>
|
||||
<MudTd DataLabel="Temp. (C)">@context.TemperatureC</MudTd>
|
||||
<MudTd DataLabel="Temp. (F)">@context.TemperatureF</MudTd>
|
||||
<MudTd DataLabel="Summary">@context.Summary</MudTd>
|
||||
</RowTemplate>
|
||||
<PagerContent>
|
||||
<MudTablePager PageSizeOptions="new int[]{50, 100}"/>
|
||||
</PagerContent>
|
||||
</MudTable>
|
||||
}
|
||||
|
||||
|
||||
@code {
|
||||
private WeatherForecast[]? forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
|
||||
}
|
||||
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public string? Summary { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
@page "/"
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h3" GutterBottom="true">Hello, world!</MudText>
|
||||
<MudText Class="mb-8">Welcome to your new app, powered by MudBlazor!</MudText>
|
||||
<MudAlert Severity="Severity.Normal">
|
||||
You can find documentation and examples on our website here:
|
||||
<MudLink Href="https://mudblazor.com" Typo="Typo.body2" Color="Color.Inherit">
|
||||
<b>www.mudblazor.com</b>
|
||||
</MudLink>
|
||||
</MudAlert>
|
@ -1,6 +1,3 @@
|
||||
<MudNavMenu>
|
||||
@* <MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
|
||||
<MudNavLink Href="counter" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Counter</MudNavLink>
|
||||
<MudNavLink Href="fetchdata" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Fetch data</MudNavLink>*@
|
||||
<MudNavLink Href="Dashboard" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Dashboard">Dashboard</MudNavLink>
|
||||
<MudNavLink Href="" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Dashboard">Dashboard</MudNavLink>
|
||||
</MudNavMenu>
|
@ -1,27 +0,0 @@
|
||||
[
|
||||
{
|
||||
"date": "2018-05-06",
|
||||
"temperatureC": 1,
|
||||
"summary": "Freezing"
|
||||
},
|
||||
{
|
||||
"date": "2018-05-07",
|
||||
"temperatureC": 14,
|
||||
"summary": "Bracing"
|
||||
},
|
||||
{
|
||||
"date": "2018-05-08",
|
||||
"temperatureC": -13,
|
||||
"summary": "Freezing"
|
||||
},
|
||||
{
|
||||
"date": "2018-05-09",
|
||||
"temperatureC": -16,
|
||||
"summary": "Balmy"
|
||||
},
|
||||
{
|
||||
"date": "2018-05-10",
|
||||
"temperatureC": -2,
|
||||
"summary": "Chilly"
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user