Version printed on the front-end using Gitinfo

- Version printed on the front-end using Gitinfo. It is possible to get the native one from Tauri itself, but I haven't got that working yet.
- Added macOS and Android-style icons.
This commit is contained in:
Tony Bark 2024-09-12 21:26:21 -04:00
parent 761a822e27
commit 3ed751de7c
5 changed files with 21 additions and 1 deletions

BIN
assets/icon-square.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 181 KiB

View file

@ -7,6 +7,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GitInfo" Version="3.3.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
</ItemGroup>

1
src/Gitinfo.txt Normal file
View file

@ -0,0 +1 @@
0.1.104

View file

@ -36,7 +36,7 @@
<footer>
<sub>
<i>
<p>Status Boards by Dixieland Software</p>
<p>@PrintVersion<br>Status Boards by Dixieland Software</p>
</i>
</sub>
</footer>
@ -47,6 +47,21 @@
private string? StationCode { get; set; }
// Bit of a workaround until I get native version from Tauri.
// Regardless, it's useful for printing the commit hash alone.
private string PrintVersion
{
get
{
var major = ThisAssembly.Git.SemVer.Major;
var minor = ThisAssembly.Git.SemVer.Minor;
var patch = ThisAssembly.Git.SemVer.Patch;
var commit = ThisAssembly.Git.Commit;
return $"v{major}.{minor}.{patch}-{commit}";
}
}
private async Task RedirectToStat(string code)
{
StationCode = await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "station", new { name = code });