-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish implementing Serilog, LogManager, and full-screen loader.
- Loading branch information
Showing
22 changed files
with
463 additions
and
208 deletions.
There are no files selected for viewing
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
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,29 @@ | ||
@using Nihs.SimpleMessenger; | ||
@using Remotely.Server.Models.Messages; | ||
@inject IMessenger Messenger | ||
|
||
@if (_loaderShown) | ||
{ | ||
<LoadingSignal StatusMessage="@_statusMessage" /> | ||
} | ||
|
||
@code { | ||
private bool _loaderShown; | ||
private string _statusMessage = string.Empty; | ||
|
||
protected override Task OnAfterRenderAsync(bool firstRender) | ||
{ | ||
if (firstRender) | ||
{ | ||
Messenger.Register<ShowLoaderMessage>(this, HandleShowLoaderMessage); | ||
} | ||
return base.OnAfterRenderAsync(firstRender); | ||
} | ||
|
||
private async Task HandleShowLoaderMessage(ShowLoaderMessage message) | ||
{ | ||
_loaderShown = message.IsShown; | ||
_statusMessage = message.StatusMessage; | ||
await InvokeAsync(StateHasChanged); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,31 @@ | ||
@inject IClientAppState AppState | ||
|
||
|
||
@if (_theme == Theme.Dark) | ||
{ | ||
<div class="signal" style="border-color: whitesmoke"></div> | ||
} | ||
else if (_theme == Theme.Light) | ||
{ | ||
<div class="signal" style="border-color: #333"></div> | ||
} | ||
<div class="signal-background"> | ||
<div class="signal-wrapper text-center"> | ||
@if (!string.IsNullOrEmpty(StatusMessage)) | ||
{ | ||
<h4> | ||
@StatusMessage | ||
</h4> | ||
} | ||
<div class="signal @(GetSignalClass())"></div> | ||
</div> | ||
</div> | ||
|
||
@code { | ||
private Theme _theme; | ||
|
||
[Parameter] | ||
public string StatusMessage { get; set; } = string.Empty; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
await base.OnInitializedAsync(); | ||
_theme = await AppState.GetEffectiveTheme(); | ||
await base.OnInitializedAsync(); | ||
} | ||
|
||
private string GetSignalClass() | ||
{ | ||
return _theme == Theme.Dark ? "signal-dark" : "signal-light"; | ||
} | ||
} |
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
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
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
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,13 @@ | ||
namespace Remotely.Server.Models.Messages; | ||
|
||
public class ShowLoaderMessage | ||
{ | ||
public ShowLoaderMessage(bool isShown, string statusMessage) | ||
{ | ||
IsShown = isShown; | ||
StatusMessage = statusMessage; | ||
} | ||
|
||
public bool IsShown { get; } | ||
public string StatusMessage { get; } | ||
} |
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
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
Oops, something went wrong.