mirror of
https://github.com/tonytins/amtkstat.git
synced 2025-03-23 23:19:05 +00:00
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:
parent
c24378ffad
commit
09746c2315
3 changed files with 12 additions and 8 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn greet(name: &str) -> String {
|
fn station(name: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={}",
|
"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={}",
|
||||||
name
|
name
|
||||||
|
@ -12,7 +12,7 @@ fn greet(name: &str) -> String {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.invoke_handler(tauri::generate_handler![greet])
|
.invoke_handler(tauri::generate_handler![station])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "AMTK Status",
|
"productName": "AMTK Status",
|
||||||
"version": "0.1.101"
|
"version": "0.1.102"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
@ -22,8 +22,12 @@
|
||||||
{
|
{
|
||||||
"title": "Amtrak Status Boards",
|
"title": "Amtrak Status Boards",
|
||||||
"resizable": true,
|
"resizable": true,
|
||||||
"width": 1450,
|
"width": 1100,
|
||||||
"height": 950
|
"height": 768,
|
||||||
|
"minWidth": 1100,
|
||||||
|
"minHeight": 768,
|
||||||
|
"maxWidth": 1450,
|
||||||
|
"maxHeight": 950
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"security": {
|
"security": {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<img src="img/amtkstat.svg" class="logo" alt="Amtrak Status" />
|
<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" />
|
<input id="greet-input" placeholder="3-character Station Code" @bind="CodeInput" />
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -21,9 +21,9 @@
|
||||||
|
|
||||||
private string? StationCode { get; set; }
|
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);
|
NavigationManager.NavigateTo(StationCode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue