-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29b1ec1
commit 5840272
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
src/Arius.Web/Components/Pages/CreateBackupConfiguration.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@page "/create-backup-configuration" | ||
@using Arius.Web.Application | ||
@using Arius.Web.Core | ||
@inject BackupConfigurationService BackupConfigurationService | ||
@inject NavigationManager Navigation | ||
|
||
<h3>Create Backup Configuration</h3> | ||
|
||
<EditForm Model="backupConfiguration" OnValidSubmit="HandleValidSubmit"> | ||
<DataAnnotationsValidator /> | ||
<ValidationSummary /> | ||
|
||
<div class="form-group"> | ||
<label for="path">Path</label> | ||
<InputText id="path" class="form-control" @bind-Value="backupConfiguration.Path" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="accountName">Account Name</label> | ||
<InputText id="accountName" class="form-control" @bind-Value="backupConfiguration.AccountName" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="accountKey">Account Key</label> | ||
<InputText id="accountKey" class="form-control" @bind-Value="backupConfiguration.AccountKey" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="passphrase">Passphrase</label> | ||
<InputText id="passphrase" class="form-control" @bind-Value="backupConfiguration.Passphrase" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="containerName">Container Name</label> | ||
<InputText id="containerName" class="form-control" @bind-Value="backupConfiguration.ContainerName" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="tier">Tier</label> | ||
<InputText id="tier" class="form-control" @bind-Value="backupConfiguration.Tier" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="removeLocal">Remove Local</label> | ||
<InputCheckbox id="removeLocal" class="form-check-input" @bind-Value="backupConfiguration.RemoveLocal" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="dedup">Deduplication</label> | ||
<InputCheckbox id="dedup" class="form-check-input" @bind-Value="backupConfiguration.Dedup" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="fastHash">Fast Hash</label> | ||
<InputCheckbox id="fastHash" class="form-check-input" @bind-Value="backupConfiguration.FastHash" /> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-primary">Save</button> | ||
</EditForm> | ||
|
||
@code { | ||
private BackupConfiguration backupConfiguration = new BackupConfiguration(); | ||
|
||
private async Task HandleValidSubmit() | ||
{ | ||
await BackupConfigurationService.AddBackupConfigurationAsync(backupConfiguration); | ||
Navigation.NavigateTo("/backup-configurations"); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/Arius.Web/Components/Pages/EditBackupConfiguration.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@page "/edit-backup-configuration/{id:int}" | ||
@using Arius.Web.Application | ||
@using Arius.Web.Core | ||
@inject BackupConfigurationService BackupConfigurationService | ||
@inject NavigationManager Navigation | ||
|
||
<h3>Edit Backup Configuration</h3> | ||
|
||
<EditForm Model="backupConfiguration" OnValidSubmit="HandleValidSubmit"> | ||
<DataAnnotationsValidator /> | ||
<ValidationSummary /> | ||
|
||
<div class="form-group"> | ||
<label for="path">Path</label> | ||
<InputText id="path" class="form-control" @bind-Value="backupConfiguration.Path" /> | ||
</div> | ||
<!-- Include all fields as in the creation form --> | ||
|
||
<button type="submit" class="btn btn-primary">Save</button> | ||
</EditForm> | ||
|
||
@code { | ||
private BackupConfiguration backupConfiguration = new BackupConfiguration(); | ||
|
||
[Parameter] | ||
public int Id { get; set; } | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
backupConfiguration = await BackupConfigurationService.GetBackupConfigurationAsync(Id); | ||
} | ||
|
||
private async Task HandleValidSubmit() | ||
{ | ||
await BackupConfigurationService.UpdateBackupConfigurationAsync(backupConfiguration); | ||
Navigation.NavigateTo("/backup-configurations"); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/Arius.Web/Components/Pages/ListBackupConfigurations.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@page "/backup-configurations" | ||
@using Arius.Web.Application | ||
@using Arius.Web.Core | ||
@inject BackupConfigurationService BackupConfigurationService | ||
|
||
<h3>Backup Configurations</h3> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Path</th> | ||
<th>Account Name</th> | ||
<th>Container Name</th> | ||
<th>Tier</th> | ||
<th>Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@if (backupConfigurations != null) | ||
{ | ||
@foreach (var config in backupConfigurations) | ||
{ | ||
<tr> | ||
<td>@config.Path</td> | ||
<td>@config.AccountName</td> | ||
<td>@config.ContainerName</td> | ||
<td>@config.Tier</td> | ||
<td> | ||
<a href="/edit-backup-configuration/@config.Id">Edit</a> | | ||
<a href="/delete-backup-configuration/@config.Id">Delete</a> | ||
</td> | ||
</tr> | ||
} | ||
} | ||
</tbody> | ||
</table> | ||
|
||
@code { | ||
private IEnumerable<BackupConfiguration> backupConfigurations; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
backupConfigurations = await BackupConfigurationService.GetBackupConfigurationsAsync(); | ||
} | ||
} |