FIX refactor appVersion - add appSandbox
FIX add app version and sandbox indicator to top bar
This commit is contained in:
parent
2d9ee3c9ce
commit
7d0014923d
3 changed files with 39 additions and 5 deletions
32
Wonky.Client/Components/AppSandbox.razor
Normal file
32
Wonky.Client/Components/AppSandbox.razor
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
@* Copyright (C) 2022 FCS Frede's Computer Services.
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
||||||
|
*@
|
||||||
|
|
||||||
|
@using Wonky.Entity.Configuration
|
||||||
|
@using Microsoft.Extensions.Options
|
||||||
|
|
||||||
|
@if (_app!.Sandbox)
|
||||||
|
{
|
||||||
|
<div class="badge text-bg-danger mx-3">EDU DEMO</div>
|
||||||
|
}
|
||||||
|
@code
|
||||||
|
{
|
||||||
|
[Inject] IOptions<AppInfo?>? AppInfo { get; set; }
|
||||||
|
private AppInfo? _app;
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
_app = AppInfo?.Value;
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,21 +18,21 @@
|
||||||
|
|
||||||
@if (_production)
|
@if (_production)
|
||||||
{
|
{
|
||||||
<div class="badge text-bg-success mx-3">app version @_app?.Version</div>
|
<div class="badge text-bg-success mx-3">v.@_app?.Version</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="badge text-bg-info mx-3">app version @_app?.Version</div>
|
<div class="badge text-bg-info mx-3">v.@_app?.Version</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (_app!.Rc)
|
@if (_app!.Rc)
|
||||||
{
|
{
|
||||||
<div class="badge text-bg-warning mx-3">release candidate</div>
|
<div class="badge text-bg-warning mx-3">RC</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (_app!.Sandbox)
|
@if (_app!.Sandbox)
|
||||||
{
|
{
|
||||||
<div class="badge text-bg-danger mx-3">sandbox</div>
|
<div class="badge text-bg-danger mx-3">EDU DEMO</div>
|
||||||
}
|
}
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
</div>
|
</div>
|
||||||
<main>
|
<main>
|
||||||
<div class="top-row px-4 d-print-none">
|
<div class="top-row px-4 d-print-none">
|
||||||
|
<AppVersion />
|
||||||
|
<AppSandbox />
|
||||||
<TopbarNavigation/>
|
<TopbarNavigation/>
|
||||||
</div>
|
</div>
|
||||||
<div class="content px-4 d-print-none">
|
<div class="content px-4 d-print-none">
|
||||||
|
@ -31,6 +33,6 @@
|
||||||
<div class="content d-none d-print-block">
|
<div class="content d-none d-print-block">
|
||||||
@Body
|
@Body
|
||||||
</div>
|
</div>
|
||||||
<BlazoredToasts Position="ToastPosition.BottomRight" Timeout="10" />
|
<BlazoredToasts Position="ToastPosition.TopRight" Timeout="10" />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue