|
@@ -1,4 +1,8 @@
|
|
|
-@inject IEventBus EventBus;
|
|
|
+@using Color = MudBlazor.Color
|
|
|
+@using Size = MudBlazor.Size
|
|
|
+@using Microsoft.JSInterop
|
|
|
+@inject IEventBus EventBus;
|
|
|
+@inject IJSRuntime JSRuntime;
|
|
|
|
|
|
@* Required *@
|
|
|
<MudThemeProvider />
|
|
@@ -11,7 +15,6 @@
|
|
|
<MudSnackbarProvider />
|
|
|
|
|
|
@{
|
|
|
-
|
|
|
RenderFragment<ItemChild> RenderItemChild = (ItemChild child) => __builder=>
|
|
|
{
|
|
|
<MudPaper Class="pa-1 my-1">
|
|
@@ -21,7 +24,12 @@
|
|
|
<MudIcon Icon="@Icons.Material.Sharp.ConnectWithoutContact"></MudIcon>
|
|
|
<MudIcon Icon="@Icons.Custom.Uncategorized.AlertSuccess"></MudIcon>
|
|
|
</MudStack>
|
|
|
- <MudButton Color="MudBlazor.Color.Inherit" Class="pa-3 rounded-0 hideable" Style="min-width: 0;"><MudIcon Icon="@Icons.Material.Outlined.Menu" /></MudButton>
|
|
|
+ <MudMenu Icon="@Icons.Material.Outlined.Menu" Variant="Variant.Filled" AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight" Color="Color.Default" Size="Size.Large">
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.PrivateConnectivity">Connect</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.DisabledByDefault">Disconnect</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Edit">Edit...</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Delete" IconColor="Color.Error">Delete Trusted Peer</MudMenuItem>
|
|
|
+ </MudMenu>
|
|
|
</MudStack>
|
|
|
</MudPaper>
|
|
|
};
|
|
@@ -35,7 +43,12 @@
|
|
|
<MudIcon Icon="@Icons.Material.Sharp.Start"></MudIcon>
|
|
|
<MudIcon Icon="@Icons.Custom.Uncategorized.AlertSuccess"></MudIcon>
|
|
|
</MudStack>
|
|
|
- <MudButton Color="MudBlazor.Color.Inherit" Class="pa-3 rounded-0 hideable" Style="min-width: 0;"><MudIcon Icon="@Icons.Material.Outlined.Menu" /></MudButton>
|
|
|
+ <MudMenu Icon="@Icons.Material.Outlined.Menu" Variant="Variant.Filled" AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight" Color="Color.Default" Size="Size.Large">
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.PlayArrow" >Start Listener</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Stop" >Stop Listener</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Edit" >Edit...</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Delete" IconColor="Color.Error">Delete Local Peer</MudMenuItem>
|
|
|
+ </MudMenu>
|
|
|
</MudStack>
|
|
|
<MudDropContainer T="ItemChild" Items="@context.Children" ItemsSelector="(_, _) => true" Class="flex-grow-1">
|
|
|
<ChildContent>
|
|
@@ -54,7 +67,12 @@
|
|
|
<MudStack StretchItems="StretchItems.End" AlignItems="AlignItems.Stretch" Spacing="1" Style="width:100%;height:100%">
|
|
|
<MudStack Row AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Spacing="1" Class="mud-paper mud-paper-square stack-adorner">
|
|
|
<MudText Class="hideable">Contacts</MudText>
|
|
|
- <MudButton Color="MudBlazor.Color.Inherit" Class="pa-3 rounded-0 hideable" Style="min-width: 0;"><MudIcon Icon="@Icons.Material.Outlined.Menu" /></MudButton>
|
|
|
+ <MudMenu Icon="@Icons.Material.Outlined.Menu" Variant="Variant.Filled" AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight" Color="Color.Default" Size="Size.Large">
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Add">Add Local Peer...</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Settings">Settings...</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.Refresh" IconColor="Color.Warning" OnClick="@ReloadUI">Reload UI</MudMenuItem>
|
|
|
+ <MudMenuItem Icon="@Icons.Material.Sharp.ExitToApp" IconColor="Color.Error">Quit</MudMenuItem>
|
|
|
+ </MudMenu>
|
|
|
</MudStack>
|
|
|
<MudStack Row Class="mud-background-gray stack-adorner" Style="overflow-x: auto;">
|
|
|
<MudDropContainer T="Item" Items="_items" ItemsSelector="(_, _) =>true " Class="flex-grow-1">
|
|
@@ -69,28 +87,30 @@
|
|
|
</MudStack>
|
|
|
</MudStack>
|
|
|
};
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-<Splitter Direction="SplitterDirection.Horizontal" Style="height:100%">
|
|
|
- <SplitterSection Style="height:100%">
|
|
|
- @RenderContacts
|
|
|
- </SplitterSection>
|
|
|
- <SplitterSection>
|
|
|
- <Splitter Direction="SplitterDirection.Vertical">
|
|
|
- <SplitterSection>
|
|
|
- <div>Chat!</div>
|
|
|
- </SplitterSection>
|
|
|
- <SplitterSection>
|
|
|
- <div>Input!</div>
|
|
|
- </SplitterSection>
|
|
|
- </Splitter>
|
|
|
-
|
|
|
- </SplitterSection>
|
|
|
-</Splitter>
|
|
|
+@if (_isReloadingUI == false)
|
|
|
+{
|
|
|
+ <Splitter Direction="SplitterDirection.Horizontal">
|
|
|
+ <SplitterSection>
|
|
|
+ @RenderContacts
|
|
|
+ </SplitterSection>
|
|
|
+ <SplitterSection>
|
|
|
+ <Splitter Direction="SplitterDirection.Vertical">
|
|
|
+ <SplitterSection>
|
|
|
+ <div>Chat!</div>
|
|
|
+ </SplitterSection>
|
|
|
+ <SplitterSection>
|
|
|
+ <div>Input!</div>
|
|
|
+ </SplitterSection>
|
|
|
+ </Splitter>
|
|
|
+ </SplitterSection>
|
|
|
+ </Splitter>
|
|
|
+}
|
|
|
|
|
|
@code {
|
|
|
private bool _isUiShown = false;
|
|
|
+ private bool _isReloadingUI = false;
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
{
|
|
@@ -101,6 +121,14 @@
|
|
|
EventBus.Publish<UiShownEvent>();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void ReloadUI()
|
|
|
+ {
|
|
|
+ _isReloadingUI = true;
|
|
|
+ StateHasChanged();
|
|
|
+ JSRuntime.InvokeVoidAsync("window.location.reload");
|
|
|
+ }
|
|
|
+
|
|
|
private List<Item> _items = new()
|
|
|
{
|
|
|
new()
|