Fix keys editor blocking render after save of new game. Do full page redirect after adding game. Fixes #13
This commit is contained in:
parent
44644b7ac9
commit
b28f4f78b1
2 changed files with 50 additions and 45 deletions
|
@ -1,53 +1,58 @@
|
|||
@inject KeyService KeyService
|
||||
@inject IMessageService MessageService
|
||||
|
||||
<Row>
|
||||
<Col Span="8">
|
||||
<Statistic Title="Available" Value="Keys.Count - AllocatedKeys" Style="text-align: center;" />
|
||||
</Col>
|
||||
<Col Span="8">
|
||||
<Statistic Title="Allocated" Value="AllocatedKeys" Style="text-align: center;" />
|
||||
</Col>
|
||||
<Col Span="8">
|
||||
<Statistic Title="Total" Value="Keys.Count" Style="text-align: center;" />
|
||||
</Col>
|
||||
</Row>
|
||||
@if (Keys != null)
|
||||
{
|
||||
<GridRow>
|
||||
<GridCol Span="8">
|
||||
<Statistic Title="Available" Value="Keys.Count - AllocatedKeys" Style="text-align: center;" />
|
||||
</GridCol>
|
||||
<GridCol Span="8">
|
||||
<Statistic Title="Allocated" Value="AllocatedKeys" Style="text-align: center;" />
|
||||
</GridCol>
|
||||
<GridCol Span="8">
|
||||
<Statistic Title="Total" Value="Keys.Count" Style="text-align: center;" />
|
||||
</GridCol>
|
||||
</GridRow>
|
||||
|
||||
<Modal Title="View Keys" Visible="ViewModalVisible" Maximizable="false" DefaultMaximized="true" OnCancel="() => ViewModalVisible = false" OnOk="() => ViewModalVisible = false">
|
||||
<Table TItem="Key" DataSource="@Keys" Bordered>
|
||||
<PropertyColumn Property="k => k.Value">
|
||||
<InputPassword @bind-Value="@context.Value" />
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="k => k.AllocationMethod" />
|
||||
<Column TData="string">
|
||||
@switch (context.AllocationMethod)
|
||||
{
|
||||
case KeyAllocationMethod.MacAddress:
|
||||
<text>@context.ClaimedByMacAddress</text>
|
||||
break;
|
||||
<Modal Title="View Keys" Visible="ViewModalVisible" Maximizable="false" DefaultMaximized="true" OnCancel="() => ViewModalVisible = false" OnOk="() => ViewModalVisible = false">
|
||||
<Table TItem="Key" DataSource="@Keys" Bordered>
|
||||
<PropertyColumn Property="k => k.Value">
|
||||
<InputPassword @bind-Value="@context.Value" />
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="k => k.AllocationMethod" />
|
||||
<Column TData="string">
|
||||
@switch (context.AllocationMethod)
|
||||
{
|
||||
case KeyAllocationMethod.MacAddress:
|
||||
<text>@context.ClaimedByMacAddress</text>
|
||||
break;
|
||||
|
||||
case KeyAllocationMethod.UserAccount:
|
||||
<text>@context.ClaimedByUser?.UserName</text>
|
||||
break;
|
||||
}
|
||||
</Column>
|
||||
<PropertyColumn Property="g => g.ClaimedOn" Format="MM/dd/yyyy hh:mm tt" Sortable />
|
||||
<ActionColumn Title="">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
@if (context.IsAllocated())
|
||||
{
|
||||
<Button OnClick="() => Release(context)">Release</Button>
|
||||
}
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</Table>
|
||||
</Modal>
|
||||
|
||||
<Modal Title="Edit Keys" Visible="EditModalVisible" Maximizable="false" DefaultMaximized="true" OnCancel="() => EditModalVisible = false" OnOk="Save">
|
||||
<StandaloneCodeEditor @ref="Editor" Id="editor" ConstructionOptions="EditorConstructionOptions" />
|
||||
</Modal>
|
||||
}
|
||||
|
||||
case KeyAllocationMethod.UserAccount:
|
||||
<text>@context.ClaimedByUser?.UserName</text>
|
||||
break;
|
||||
}
|
||||
</Column>
|
||||
<PropertyColumn Property="g => g.ClaimedOn" Format="MM/dd/yyyy hh:mm tt" Sortable />
|
||||
<ActionColumn Title="">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
@if (context.IsAllocated())
|
||||
{
|
||||
<Button OnClick="() => Release(context)">Release</Button>
|
||||
}
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</Table>
|
||||
</Modal>
|
||||
|
||||
<Modal Title="Edit Keys" Visible="EditModalVisible" Maximizable="false" DefaultMaximized="true" OnCancel="() => EditModalVisible = false" OnOk="Save">
|
||||
<StandaloneCodeEditor @ref="Editor" Id="editor" ConstructionOptions="EditorConstructionOptions" />
|
||||
</Modal>
|
||||
|
||||
<style>
|
||||
.monaco-editor-container {
|
||||
|
|
|
@ -197,7 +197,7 @@
|
|||
|
||||
await MessageService.Success("Game added!");
|
||||
|
||||
NavigationManager.NavigateTo($"/Games/{Game.Id}/Edit");
|
||||
NavigationManager.NavigateTo($"/Games/{Game.Id}/Edit", true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Loading…
Add table
Reference in a new issue