diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9fea971..088c22e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -12,8 +12,14 @@ struct CheckForUpdatesPayload {} fn main() { let _ = fix_path_env::fix(); + + let ctx = tauri::generate_context!(); + + let mut builder = tauri::Builder::default(); - let metadata = AboutMetadata::new() + #[cfg(target_os = "macos")] + { + let metadata = AboutMetadata::new() .authors(vec!["@unxsist".to_string()]) .website(String::from("https://www.jet-pilot.app")) .license(String::from("MIT")); @@ -45,24 +51,19 @@ fn main() { ]), ); let mut menu = Menu::new().add_submenu(submenu); + menu = menu.add_submenu(copyPasteMenu); - #[cfg(target_os = "macos")] - { - menu = menu.add_submenu(copyPasteMenu); - } - - let ctx = tauri::generate_context!(); - tauri::Builder::default() - .menu(menu) - .on_menu_event(|event| { + builder = builder.menu(menu).on_menu_event(|event| { match event.menu_item_id() { "check_for_updates" => { event.window().emit("check_for_updates", CheckForUpdatesPayload {}).unwrap(); } _ => {} - } - }) - .invoke_handler(tauri::generate_handler![ + } + }); + } + + builder.invoke_handler(tauri::generate_handler![ kubernetes::client::set_current_kubeconfig, kubernetes::client::list_contexts, kubernetes::client::get_context_auth_info, diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json new file mode 100644 index 0000000..4bf7993 --- /dev/null +++ b/src-tauri/tauri.linux.conf.json @@ -0,0 +1,11 @@ +{ + "tauri": { + "windows": [ + { + "title": "JET Pilot", + "decorations": false, + "transparent": true + } + ] + } +} diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue index 91b567e..118c7ab 100644 --- a/src/components/Navigation.vue +++ b/src/components/Navigation.vue @@ -11,14 +11,14 @@ import { GlobalShortcutRegisterShortcutsKey } from "@/providers/GlobalShortcutPr import { injectStrict } from "@/lib/utils"; import { V1APIResource } from "@kubernetes/client-node"; import pluralize from "pluralize"; -import { platform as getPlatform } from "@tauri-apps/api/os"; +import { type as getOsType } from "@tauri-apps/api/os"; import { getCurrent as getWindow } from "@tauri-apps/api/window"; import { exit } from "@tauri-apps/api/process"; import CloseIcon from "@/assets/icons/close.svg"; import FullScreenIcon from "@/assets/icons/full_screen.svg"; import MinimizeIcon from "@/assets/icons/minimize.svg"; -const targetPlatform = ref(""); +const targetOs = ref(""); const { context, namespace, @@ -226,8 +226,8 @@ const unpinResource = (resource: { name: string; kind: string }) => { onMounted(() => { fetchResources(); - getPlatform().then((platform) => { - targetPlatform.value = platform; + getOsType().then((os) => { + targetOs.value = os; }); }); @@ -239,7 +239,7 @@ watch([context, namespace, clusterAuthenticated], () => {