aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-07 23:28:10 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-07 23:28:10 +0200
commit950c1c3fa52a083b23f6a8b2e6b86fe451784ca6 (patch)
tree81699612c99ac985b45e467dac015d70e902a4e1
parentbf75ee9f7e56dc1a110e97bb99f7612cb20cae73 (diff)
downloadFlightCore-950c1c3fa52a083b23f6a8b2e6b86fe451784ca6.tar.gz
FlightCore-950c1c3fa52a083b23f6a8b2e6b86fe451784ca6.zip
Show host OS next to FlightCore version
-rw-r--r--src-tauri/src/main.rs10
-rw-r--r--src-ui/src/main.ts5
2 files changed, 13 insertions, 2 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index d6cdbd63..c83ddaeb 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -4,6 +4,7 @@
)]
use std::{
+ env,
sync::{Arc, Mutex},
time::Duration,
};
@@ -48,7 +49,8 @@ fn main() {
get_version_number,
get_northstar_version_number_caller,
check_is_northstar_outdated,
- verify_install_location
+ verify_install_location,
+ get_host_os
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
@@ -146,3 +148,9 @@ fn verify_install_location(game_path: String) -> bool {
}
}
}
+
+#[tauri::command]
+/// Returns identifier of host OS FlightCore is running on
+fn get_host_os() -> String {
+ env::consts::OS.to_string()
+}
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index 0562aa0a..4a00f5a6 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -22,6 +22,7 @@ document.addEventListener("DOMContentLoaded", async function () {
let installLocationHolderEl = $("install-location-holder") as HTMLElement;
let versionNumberHolderEl = $("version-number-holder") as HTMLElement;
let omniButtonEl = document.getElementById("omni-button") as HTMLElement;
+ let hostOsHolderEl = $("host-os-holder") as HTMLElement;
// listen backend-ping event (from Tauri Rust App)
listen("backend-ping", function (evt: TauriEvent<any>) {
@@ -108,7 +109,9 @@ document.addEventListener("DOMContentLoaded", async function () {
// Run the following on initial page load
// Get version number
let version_number_string = await invoke("get_version_number") as string;
- versionNumberHolderEl.textContent = version_number_string;
+ // Get host OS
+ let host_os_string = await invoke("get_host_os") as string;
+ versionNumberHolderEl.textContent = `${version_number_string} (${host_os_string})`;
// Get install location
let install_location = await invoke("find_game_install_location_caller") as string;