mirror of
https://github.com/tonytins/amtkstat.git
synced 2026-02-10 12:54:47 -05:00
Initial migration to Tauri 2.0
- Updated package.json with project metadata and moves dependencies to devDependencies. - Adds .editorconfig for consistent code style - Updated VSCode and .NET project settings for improved development workflow.
This commit is contained in:
parent
81799106f8
commit
2cd45c4a6c
13 changed files with 1243 additions and 664 deletions
1560
src-tauri/Cargo.lock
generated
1560
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,16 +7,19 @@ edition = "2021"
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
[lib]
|
||||
# The `_lib` suffix may seem redundant but it is necessary
|
||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
||||
name = "entries_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-opener = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
webbrowser = "1.0.2"
|
||||
tauri-plugin-shell = "2"
|
||||
|
||||
[features]
|
||||
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
|
|
|||
33
src-tauri/src/lib.rs
Normal file
33
src-tauri/src/lib.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
use webbrowser;
|
||||
// use tauri::menu::MenuBuilder;
|
||||
|
||||
#[tauri::command]
|
||||
fn open_browser(address: &str) {
|
||||
webbrowser::open(address).expect("Failed to open defualt browser.");
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.invoke_handler(tauri::generate_handler![open_browser])
|
||||
.setup(|app| {
|
||||
// TODO: Redo menu bar to return to home screen
|
||||
/**
|
||||
let menu = MenuBuilder::new(app)
|
||||
.text("open", "Open")
|
||||
.text("close", "Close")
|
||||
.check("check_item", "Check Item")
|
||||
.separator()
|
||||
.text("disabled_item", "Disabled Item")
|
||||
.text("status", "Status: Processing...")
|
||||
.build()?;
|
||||
|
||||
app.set_menu(menu.clone())?;
|
||||
**/
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
|
@ -1,16 +1,6 @@
|
|||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
use webbrowser;
|
||||
|
||||
#[tauri::command]
|
||||
fn open_browser(address: &str) {
|
||||
webbrowser::open(address).expect("Failed to open defualt browser.");
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.invoke_handler(tauri::generate_handler![open_browser])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
entries_lib::run()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
{
|
||||
"build": {
|
||||
"beforeDevCommand": "dotnet watch run --project src/AmtrakStatus.csproj",
|
||||
"beforeBuildCommand": "dotnet publish -c release src/AmtrakStatus.csproj -o dist",
|
||||
"frontendDist": "../dist/wwwroot",
|
||||
"devUrl": "http://localhost:1420"
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
},
|
||||
"productName": "AMTK Status",
|
||||
"mainBinaryName": "AMTK Status",
|
||||
"version": "0.1.106",
|
||||
"identifier": "com.tonybark.amtkstat",
|
||||
"plugins": {},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Amtrak Status",
|
||||
"resizable": true,
|
||||
"width": 1100,
|
||||
"height": 768,
|
||||
"minWidth": 1100,
|
||||
"minHeight": 768,
|
||||
"maxWidth": 1450,
|
||||
"maxHeight": 950
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
}
|
||||
"build": {
|
||||
"beforeDevCommand": "dotnet watch run --project src/AmtrakStatus.csproj",
|
||||
"beforeBuildCommand": "dotnet publish -c release src/AmtrakStatus.csproj -o dist",
|
||||
"frontendDist": "../dist/wwwroot",
|
||||
"devUrl": "http://localhost:1420"
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
},
|
||||
"productName": "AMTK Status",
|
||||
"mainBinaryName": "AMTK Status",
|
||||
"version": "0.1.106",
|
||||
"identifier": "com.tonybark.amtkstat",
|
||||
"plugins": {},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Amtrak Status",
|
||||
"resizable": true,
|
||||
"width": 1100,
|
||||
"height": 768,
|
||||
"minWidth": 1100,
|
||||
"minHeight": 768,
|
||||
"maxWidth": 1450,
|
||||
"maxHeight": 950
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue