diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..7dd1437 --- /dev/null +++ b/changelog.md @@ -0,0 +1,23 @@ +# Change Log + +## 0.104.2 + +- Clickable links that open the default broswer. + +### Version sceheme change + +Three digits in the version were moved from the patch to the minor section (i.e., `0.Y.100` to `0.100.Z`) due to the difference in ways of desktop applications are developed, which I never needed to account for until now. It was easier to get away with putting it in the patch for CLI tools and libraries because the core user experience never changed, despite frequent internal changes. + +## 0.104.0 (0.1.104) + +- New buttons for major terminals and rail cams. +- Version displayed above credits. + +## 0.102.0 (0.1.102) + +- Redesigned icons +- Added banner above form + +## 0.100.0 (0.1.101) + +- First public prototype \ No newline at end of file diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 882530c..eb2a657 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -55,6 +55,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "webbrowser", ] [[package]] @@ -168,6 +169,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "brotli" version = "6.0.0" @@ -330,7 +340,7 @@ dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", - "core-foundation", + "core-foundation 0.9.4", "core-graphics", "foreign-types", "libc", @@ -345,7 +355,7 @@ checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ "bitflags 1.3.2", "block", - "core-foundation", + "core-foundation 0.9.4", "core-graphics-types", "libc", "objc", @@ -383,6 +393,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -396,7 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "core-graphics-types", "foreign-types", "libc", @@ -409,7 +429,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "libc", ] @@ -1177,6 +1197,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "html5ever" version = "0.26.0" @@ -1374,6 +1403,22 @@ dependencies = [ "walkdir", ] +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -1659,6 +1704,40 @@ dependencies = [ "objc_exception", ] +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", +] + [[package]] name = "objc_exception" version = "0.1.2" @@ -2576,7 +2655,7 @@ dependencies = [ "cairo-rs", "cc", "cocoa", - "core-foundation", + "core-foundation 0.9.4", "core-graphics", "crossbeam-channel", "dispatch", @@ -2591,7 +2670,7 @@ dependencies = [ "gtk", "image", "instant", - "jni", + "jni 0.20.0", "lazy_static", "libc", "log", @@ -3257,6 +3336,34 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5f07fb9bc8de2ddfe6b24a71a75430673fd679e568c48b52716cef1cfae923" +dependencies = [ + "block2", + "core-foundation 0.10.0", + "home", + "jni 0.21.1", + "log", + "ndk-context", + "objc2", + "objc2-foundation", + "url", + "web-sys", +] + [[package]] name = "webkit2gtk" version = "0.18.2" @@ -3446,6 +3553,15 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -3473,6 +3589,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index df1962e..fce9891 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -14,6 +14,7 @@ tauri-build = { version = "1", features = [] } tauri = { version = "1", features = ["shell-open"] } serde = { version = "1", features = ["derive"] } serde_json = "1" +webbrowser = "1.0.2" [features] # This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!! diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index 3e1a65f..bef8a57 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index 79afb8d..6d9abe8 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index de5e3f7..bbc120c 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png index 2d6bb3b..f538494 100644 Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png index a4be116..baf7af3 100644 Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png index 689dc77..97c4bf1 100644 Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png index c7061ea..87452ff 100644 Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png index 55d5077..c70fec2 100644 Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png index 41c30f0..512e617 100644 Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png index ffb72d3..c9adf6b 100644 Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png index badbec5..200988d 100644 Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png index 323ec9f..221ef0f 100644 Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png index e083bde..e6561c4 100644 Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns index bafc61d..a0f9c6b 100644 Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index f579f0d..a0c7d9c 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index d5bab95..b088ccd 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9ef4ff7..3c09876 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,18 +1,15 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +use webbrowser; -// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command #[tauri::command] -fn station(name: &str) -> String { - format!( - "https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={}", - name - ) +fn open_browser(address: &str) { + webbrowser::open(address).expect("Failed to open defualt browser."); } fn main() { tauri::Builder::default() - .invoke_handler(tauri::generate_handler![station]) + .invoke_handler(tauri::generate_handler![open_browser]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0802c3e..83b2dfb 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "AMTK Status", - "version": "0.105.10" + "version": "0.104.2" }, "tauri": { "allowlist": { diff --git a/src/Components/LaunchBrowser.razor b/src/Components/LaunchBrowser.razor new file mode 100644 index 0000000..cccffc3 --- /dev/null +++ b/src/Components/LaunchBrowser.razor @@ -0,0 +1,18 @@ +@inject IJSRuntime JsRuntime + +@Text + +@code { + + [Parameter] + [Required] + public string? Text { get; set; } + + [Parameter] + [Required] + public string? Address { get; set; } + private async Task OpenBrowserAsync() + { + await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "open_browser", new { address = Address }); + } +} \ No newline at end of file diff --git a/src/Components/StationBtn.razor b/src/Components/StationBtn.razor index 0e66808..e83d475 100644 --- a/src/Components/StationBtn.razor +++ b/src/Components/StationBtn.razor @@ -1,17 +1,21 @@ @inject IJSRuntime JsRuntime @inject NavigationManager NavigationManager - + @code { - [Parameter] public string? Name { get; set; } + [Parameter] + [Required] + public string? Name { get; set; } - [Parameter] public string? Code { get; set; } + [Parameter] + [Required] + public string? Code { get; set; } - private async Task RedirectToStat() + private void AddrRedirect() { - var address = await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "station", new { name = Code }); + var address = $"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={Code}"; NavigationManager.NavigateTo(address); } diff --git a/src/Components/StationInput.razor b/src/Components/StationInput.razor index f554c28..c072e35 100644 --- a/src/Components/StationInput.razor +++ b/src/Components/StationInput.razor @@ -1,19 +1,19 @@ @inject IJSRuntime JsRuntime @inject NavigationManager NavigationManager -
- + +
@code { - private string? CodeInput { get; set; } + private string? Code { get; set; } - private async Task AddrRedirectAsync() + private void AddrRedirect() { - var address = await JsRuntime.InvokeAsync("__TAURI__.tauri.invoke", "station", new { name = CodeInput }); + var address = $"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={Code}"; NavigationManager.NavigateTo(address); } -} +} \ No newline at end of file diff --git a/src/Gitinfo.txt b/src/Gitinfo.txt index d0864bd..302bfef 100644 --- a/src/Gitinfo.txt +++ b/src/Gitinfo.txt @@ -1 +1 @@ -0.105.10 \ No newline at end of file +0.104.2 \ No newline at end of file diff --git a/src/Pages/Home.razor b/src/Pages/Home.razor index 980b997..85cc228 100644 --- a/src/Pages/Home.razor +++ b/src/Pages/Home.razor @@ -3,6 +3,9 @@
+

Search + +

@@ -32,9 +35,9 @@

-
Status Boards by Dixieland Software +
Status Boards by +

- diff --git a/src/wwwroot/css/app.css b/src/wwwroot/css/app.css index d0d6727..6b42ba1 100644 --- a/src/wwwroot/css/app.css +++ b/src/wwwroot/css/app.css @@ -33,6 +33,40 @@ footer { bottom: 0; } +/* The sidebar menu */ +.sidenav { + height: 100%; + /* Full-height: remove this if you want "auto" height */ + width: 160px; + /* Set the width of the sidebar */ + position: fixed; + /* Fixed Sidebar (stay in place on scroll) */ + z-index: 1; + /* Stay on top */ + top: 0; + /* Stay at the top */ + left: 0; + background-color: #111; + /* Black */ + overflow-x: hidden; + /* Disable horizontal scroll */ + padding-top: 20px; +} + +/* The navigation menu links */ +.sidenav a { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; +} + +/* When you mouse over the navigation links, change their color */ +.sidenav a:hover { + color: #f1f1f1; +} + .logo { height: 6em; padding: 1.5em; diff --git a/src/wwwroot/index.html b/src/wwwroot/index.html index 5904593..1bc4ca7 100644 --- a/src/wwwroot/index.html +++ b/src/wwwroot/index.html @@ -1,15 +1,17 @@ - - - - Tauri + Blazor - - - - -
- - - + + + + Tauri + Blazor + + + + + +
+ + + + \ No newline at end of file