diff --git a/apps/onelauncher/frontend/src/routes/app/cluster/index.tsx b/apps/onelauncher/frontend/src/routes/app/cluster/index.tsx index 804f6fe4..364edbc0 100644 --- a/apps/onelauncher/frontend/src/routes/app/cluster/index.tsx +++ b/apps/onelauncher/frontend/src/routes/app/cluster/index.tsx @@ -43,7 +43,7 @@ function RouteComponent() { setEdit(!edit); } - + /* const { set, remove } = useNotifications(); useEffect(() => { @@ -55,20 +55,23 @@ function RouteComponent() { const { cluster_name } = e.ingress_type.PrepareCluster; let cid = `cluster-${cluster_name}`; + if (e.percent === null) { + remove(cid); + return; + } + set(cid, { title: 'Preparing Cluster', message: e.message, + fraction: e.percent, }); - - if (e.percent === e.total) - remove(cid); } }); })(); return () => unlisten?.(); }, [set, remove]); - +*/ return (

Overview

diff --git a/apps/onelauncher/frontend/src/routes/app/index.tsx b/apps/onelauncher/frontend/src/routes/app/index.tsx index 234ad819..d39a6aa9 100644 --- a/apps/onelauncher/frontend/src/routes/app/index.tsx +++ b/apps/onelauncher/frontend/src/routes/app/index.tsx @@ -155,6 +155,7 @@ function ClusterCard({ mc_loader, mc_version, icon_url, + stage, }: ClusterModel) { const launch = useCommand('launchCluster', () => bindings.core.launchCluster(id, null), { enabled: false, @@ -183,9 +184,11 @@ function ClusterCard({ return ( <>
LauncherResult { } } - tracing::warn!("no java installations found on the system, please install java manually or use the launcher to download it"); + tracing::warn!("no java installations found on the system, attempting to download java {}", major); - // TODO: java runtime not found - should prob download + let java_path = install_java_from_major(major).await?; + let java_info = check_java_runtime(&java_path, false).await?; + + dao::insert_java(java_path, java_info).await?; + + if let Some(java) = dao::get_latest_java_by_major(major).await? { + send_ingress(&id, 100.0).await?; + return Ok(java); + } Err(JavaError::MissingJava.into()) } @@ -409,6 +417,7 @@ pub async fn install_java_package(package: JavaPackage) -> LauncherResult>().join("."); base_path = base_path .join(format!("zulu-{java_version}.jre")) .join("Contents")