mirror of
https://github.com/tonytins/amtkstat.git
synced 2025-07-16 10:56:36 -04:00
New launch browser component
- Now possible to click links that launch the browser from the backend - Version scheme change to account for different methods with desktop applications
This commit is contained in:
parent
858762d54e
commit
80210156bb
28 changed files with 253 additions and 40 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue