diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index b9917cd..0802c3e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "AMTK Status", - "version": "0.1.105" + "version": "0.105.10" }, "tauri": { "allowlist": { diff --git a/src/Components/GitVersion.razor b/src/Components/GitVersion.razor new file mode 100644 index 0000000..f1a3586 --- /dev/null +++ b/src/Components/GitVersion.razor @@ -0,0 +1,19 @@ +@PrintVersion + +@code +{ + // 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}"; + } + } +} \ No newline at end of file diff --git a/src/Components/StationBtn.razor b/src/Components/StationBtn.razor new file mode 100644 index 0000000..0e66808 --- /dev/null +++ b/src/Components/StationBtn.razor @@ -0,0 +1,18 @@ +@inject IJSRuntime JsRuntime +@inject NavigationManager NavigationManager + +@Name + +@code +{ + [Parameter] public string? Name { get; set; } + + [Parameter] public string? Code { get; set; } + + private async Task RedirectToStat() + { + var address = await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "station", new { name = Code }); + + NavigationManager.NavigateTo(address); + } +} \ No newline at end of file diff --git a/src/Components/StationInput.razor b/src/Components/StationInput.razor new file mode 100644 index 0000000..af22f59 --- /dev/null +++ b/src/Components/StationInput.razor @@ -0,0 +1,20 @@ +@inject IJSRuntime JsRuntime +@inject NavigationManager NavigationManager + + + + Submit + + +@code +{ + private string? CodeInput { get; set; } + + + private async Task AddrRedirectAsync() + { + var address = await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "station", new { name = CodeInput }); + + NavigationManager.NavigateTo(address); + } +} diff --git a/src/Gitinfo.txt b/src/Gitinfo.txt index ee66a6c..d0864bd 100644 --- a/src/Gitinfo.txt +++ b/src/Gitinfo.txt @@ -1 +1 @@ -0.1.105 \ No newline at end of file +0.105.10 \ No newline at end of file diff --git a/src/Pages/Home.razor b/src/Pages/Home.razor index 6a22071..980b997 100644 --- a/src/Pages/Home.razor +++ b/src/Pages/Home.razor @@ -1,34 +1,29 @@ @page "/" -@inject IJSRuntime JsRuntime -@inject NavigationManager NavigationManager - - - Submit - + - + - + - + - - - + + + - - - + + + @@ -36,40 +31,10 @@ -@code -{ - private string? CodeInput { get; set; } - - 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("__TAURI__.tauri.invoke", "station", new { name = code }); - - NavigationManager.NavigateTo(StationCode); - } - private async Task StationAsync() - { - await RedirectToStat(CodeInput!); - } -} diff --git a/src/Pages/StationBtn.razor b/src/Pages/StationBtn.razor deleted file mode 100644 index 4a38946..0000000 --- a/src/Pages/StationBtn.razor +++ /dev/null @@ -1,18 +0,0 @@ -@inject IJSRuntime JsRuntime -@inject NavigationManager NavigationManager - -@Station - -@code -{ - [Parameter] public string? Station { get; set; } - - [Parameter] public string? Code { get; set; } - - private async Task RedirectToStat() - { - var code = await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "station", new { name = Code }); - - NavigationManager.NavigateTo(code); - } -} \ No newline at end of file diff --git a/src/_Imports.razor b/src/_Imports.razor index 4119212..b19a116 100644 --- a/src/_Imports.razor +++ b/src/_Imports.razor @@ -7,3 +7,4 @@ @using Microsoft.AspNetCore.Components.WebAssembly.Http @using Microsoft.JSInterop @using AmtrakStatus +@using AmtrakStatus.Components \ No newline at end of file