Minimum width and height for small(ish) screens

- Maximum height and width now matches the web app's
- Finally, renamed the "greet" functions to "station"
This commit is contained in:
Tony Bark 2024-09-09 22:23:41 -04:00
parent c24378ffad
commit 09746c2315
3 changed files with 12 additions and 8 deletions

View file

@ -3,7 +3,7 @@
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
fn station(name: &str) -> String {
format!(
"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={}",
name
@ -12,7 +12,7 @@ fn greet(name: &str) -> String {
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![station])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View file

@ -8,7 +8,7 @@
},
"package": {
"productName": "AMTK Status",
"version": "0.1.101"
"version": "0.1.102"
},
"tauri": {
"allowlist": {
@ -22,8 +22,12 @@
{
"title": "Amtrak Status Boards",
"resizable": true,
"width": 1450,
"height": 950
"width": 1100,
"height": 768,
"minWidth": 1100,
"minHeight": 768,
"maxWidth": 1450,
"maxHeight": 950
}
],
"security": {

View file

@ -4,7 +4,7 @@
<div class="container">
<img src="img/amtkstat.svg" class="logo" alt="Amtrak Status" />
<form class="row" @onsubmit="GreetAsync" @onsubmit:preventDefault="true">
<form class="row" @onsubmit="StationAsync" @onsubmit:preventDefault="true">
<input id="greet-input" placeholder="3-character Station Code" @bind="CodeInput" />
<button type="submit">Submit</button>
</form>
@ -21,9 +21,9 @@
private string? StationCode { get; set; }
private async Task GreetAsync()
private async Task StationAsync()
{
StationCode = await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "greet", new { name = CodeInput });
StationCode = await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "station", new { name = CodeInput });
NavigationManager.NavigateTo(StationCode);
}