mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-15 17:21:19 +10:00
fix: macos and ui
This commit is contained in:
@ -49,7 +49,10 @@
|
|||||||
Admin Dashboard
|
Admin Dashboard
|
||||||
</a>
|
</a>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem v-for="(nav, navIdx) in navigation" v-slot="{ active, close }">
|
<MenuItem
|
||||||
|
v-for="(nav, navIdx) in navigation"
|
||||||
|
v-slot="{ active, close }"
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
@click="() => navigate(close, nav)"
|
@click="() => navigate(close, nav)"
|
||||||
:href="nav.route"
|
:href="nav.route"
|
||||||
@ -58,8 +61,8 @@
|
|||||||
'transition text-left block px-4 py-2 text-sm',
|
'transition text-left block px-4 py-2 text-sm',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
{{ nav.label }}</button
|
{{ nav.label }}
|
||||||
>
|
</button>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</div>
|
</div>
|
||||||
</PanelWidget>
|
</PanelWidget>
|
||||||
@ -80,12 +83,12 @@ const open = ref(false);
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
})
|
});
|
||||||
|
|
||||||
const state = useAppState();
|
const state = useAppState();
|
||||||
const profilePictureUrl: string = await invoke("gen_drop_url", {
|
const profilePictureUrl: string = await useObject(
|
||||||
path: `/api/v1/object/${state.value.user?.profilePicture}`,
|
state.value.user?.profilePicture ?? ""
|
||||||
});
|
);
|
||||||
const adminUrl: string = await invoke("gen_drop_url", {
|
const adminUrl: string = await invoke("gen_drop_url", {
|
||||||
path: "/admin",
|
path: "/admin",
|
||||||
});
|
});
|
||||||
@ -110,6 +113,6 @@ const navigation: NavigationItem[] = [
|
|||||||
label: "Quit Drop",
|
label: "Quit Drop",
|
||||||
route: "/quit",
|
route: "/quit",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -126,6 +126,7 @@ import { invoke } from "@tauri-apps/api/core";
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const error = ref<string | undefined>();
|
const error = ref<string | undefined>();
|
||||||
|
|
||||||
|
let offerManualTimeout: NodeJS.Timeout | undefined;
|
||||||
const offerManual = ref(false);
|
const offerManual = ref(false);
|
||||||
const manualToken = ref("");
|
const manualToken = ref("");
|
||||||
const manualLoading = ref(false);
|
const manualLoading = ref(false);
|
||||||
@ -139,8 +140,9 @@ function authWrapper_wrapper() {
|
|||||||
auth().catch((e) => {
|
auth().catch((e) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
error.value = e;
|
error.value = e;
|
||||||
|
if(offerManualTimeout) clearTimeout(offerManualTimeout);
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
offerManualTimeout = setTimeout(() => {
|
||||||
offerManual.value = true;
|
offerManual.value = true;
|
||||||
}, 10000);
|
}, 10000);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,6 +250,7 @@ impl GameDownloadAgent {
|
|||||||
let completed_indexes_loop_arc = completed_indexes.clone();
|
let completed_indexes_loop_arc = completed_indexes.clone();
|
||||||
|
|
||||||
let contexts = self.contexts.lock().unwrap();
|
let contexts = self.contexts.lock().unwrap();
|
||||||
|
debug!("{:#?}", contexts);
|
||||||
pool.scope(|scope| {
|
pool.scope(|scope| {
|
||||||
let client = &reqwest::blocking::Client::new();
|
let client = &reqwest::blocking::Client::new();
|
||||||
for (index, context) in contexts.iter().enumerate() {
|
for (index, context) in contexts.iter().enumerate() {
|
||||||
|
|||||||
@ -16,7 +16,8 @@ use umu_wrapper_lib::command_builder::UmuCommandBuilder;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
database::db::{
|
database::db::{
|
||||||
borrow_db_mut_checked, ApplicationTransientStatus, GameDownloadStatus, GameVersion, DATA_ROOT_DIR
|
borrow_db_mut_checked, ApplicationTransientStatus, GameDownloadStatus, GameVersion,
|
||||||
|
DATA_ROOT_DIR,
|
||||||
},
|
},
|
||||||
download_manager::downloadable_metadata::{DownloadType, DownloadableMetadata},
|
download_manager::downloadable_metadata::{DownloadType, DownloadableMetadata},
|
||||||
error::process_error::ProcessError,
|
error::process_error::ProcessError,
|
||||||
@ -39,11 +40,14 @@ impl ProcessManager<'_> {
|
|||||||
drop(root_dir_lock);
|
drop(root_dir_lock);
|
||||||
|
|
||||||
ProcessManager {
|
ProcessManager {
|
||||||
current_platform: if cfg!(windows) {
|
#[cfg(target_os = "windows")]
|
||||||
Platform::Windows
|
current_platform: Platform::Windows,
|
||||||
} else {
|
|
||||||
Platform::Linux
|
#[cfg(target_os = "macos")]
|
||||||
},
|
current_platform: Platform::macOS,
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
current_platform: Platform::Linux,
|
||||||
|
|
||||||
app_handle,
|
app_handle,
|
||||||
processes: HashMap::new(),
|
processes: HashMap::new(),
|
||||||
@ -58,6 +62,10 @@ impl ProcessManager<'_> {
|
|||||||
(Platform::Linux, Platform::Linux),
|
(Platform::Linux, Platform::Linux),
|
||||||
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
|
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
(Platform::macOS, Platform::macOS),
|
||||||
|
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
|
||||||
|
),
|
||||||
(
|
(
|
||||||
(Platform::Linux, Platform::Windows),
|
(Platform::Linux, Platform::Windows),
|
||||||
&UMULauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
|
&UMULauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
|
||||||
@ -66,7 +74,11 @@ impl ProcessManager<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_command(&self, install_dir: &String, command: Vec<String>) -> (PathBuf, Vec<String>) {
|
fn process_command(
|
||||||
|
&self,
|
||||||
|
install_dir: &String,
|
||||||
|
command: Vec<String>,
|
||||||
|
) -> (PathBuf, Vec<String>) {
|
||||||
let root = &command[0];
|
let root = &command[0];
|
||||||
|
|
||||||
let install_dir = Path::new(install_dir);
|
let install_dir = Path::new(install_dir);
|
||||||
@ -198,7 +210,6 @@ impl ProcessManager<'_> {
|
|||||||
_ => return Err(ProcessError::NotDownloaded),
|
_ => return Err(ProcessError::NotDownloaded),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
let game_version = db_lock
|
let game_version = db_lock
|
||||||
.applications
|
.applications
|
||||||
.game_versions
|
.game_versions
|
||||||
@ -216,14 +227,14 @@ impl ProcessManager<'_> {
|
|||||||
} => {
|
} => {
|
||||||
command.extend([game_version.launch_command.clone()]);
|
command.extend([game_version.launch_command.clone()]);
|
||||||
command.extend(game_version.launch_args.clone());
|
command.extend(game_version.launch_args.clone());
|
||||||
},
|
}
|
||||||
GameDownloadStatus::SetupRequired {
|
GameDownloadStatus::SetupRequired {
|
||||||
version_name: _,
|
version_name: _,
|
||||||
install_dir: _,
|
install_dir: _,
|
||||||
} => {
|
} => {
|
||||||
command.extend([game_version.setup_command.clone()]);
|
command.extend([game_version.setup_command.clone()]);
|
||||||
command.extend(game_version.setup_args.clone());
|
command.extend(game_version.setup_args.clone());
|
||||||
},
|
}
|
||||||
_ => panic!("unreachable code"),
|
_ => panic!("unreachable code"),
|
||||||
};
|
};
|
||||||
info!("Command: {:?}", &command);
|
info!("Command: {:?}", &command);
|
||||||
@ -326,6 +337,7 @@ impl ProcessManager<'_> {
|
|||||||
pub enum Platform {
|
pub enum Platform {
|
||||||
Windows,
|
Windows,
|
||||||
Linux,
|
Linux,
|
||||||
|
macOS,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ProcessHandler: Send + 'static {
|
pub trait ProcessHandler: Send + 'static {
|
||||||
@ -374,8 +386,11 @@ impl ProcessHandler for UMULauncher {
|
|||||||
) -> Result<Child, Error> {
|
) -> Result<Child, Error> {
|
||||||
debug!("Game override: \"{:?}\"", &game_version.umu_id_override);
|
debug!("Game override: \"{:?}\"", &game_version.umu_id_override);
|
||||||
let game_id = match &game_version.umu_id_override {
|
let game_id = match &game_version.umu_id_override {
|
||||||
Some(game_override) => game_override.is_empty().then_some(game_version.game_id.clone()).unwrap_or(game_override.clone()) ,
|
Some(game_override) => game_override
|
||||||
None => game_version.game_id.clone()
|
.is_empty()
|
||||||
|
.then_some(game_version.game_id.clone())
|
||||||
|
.unwrap_or(game_override.clone()),
|
||||||
|
None => game_version.game_id.clone(),
|
||||||
};
|
};
|
||||||
info!("Game ID: {}", game_id);
|
info!("Game ID: {}", game_id);
|
||||||
UmuCommandBuilder::new(UMU_LAUNCHER_EXECUTABLE, launch_command)
|
UmuCommandBuilder::new(UMU_LAUNCHER_EXECUTABLE, launch_command)
|
||||||
|
|||||||
Reference in New Issue
Block a user