Skip to content

Commit d409e2d

Browse files
committed
Merge branch 'oneclient/main' into refactor/cleanup
2 parents 2ac340f + 29c9c19 commit d409e2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1735
-418
lines changed

.gemini/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
code_review:
2+
comment_severity_threshold: LOW
3+
ignore_patterns:
4+
- '**/*.gen.ts'

Cargo.lock

Lines changed: 122 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ tauri-plugin-clipboard-manager = { version = "=2.2.2" }
4949
tauri-plugin-deep-link = { version = "=2.2.1" }
5050
tauri-plugin-dialog = { version = "=2.2.1" }
5151
tauri-plugin-fs = { version = "=2.2.1" }
52+
tauri-plugin-os = { version = "=2.2.1" }
5253
tauri-plugin-single-instance = { version = "=2.2.3" }
5354
tauri-plugin-updater = { version = "=2.7.1" }
5455
tauri-plugin-window-state = { version = "=2.2.2" }

apps/oneclient/desktop/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ tauri-plugin-updater = { workspace = true }
3737
tauri-plugin-clipboard-manager = { workspace = true }
3838
tauri-plugin-dialog = { workspace = true }
3939
tauri-plugin-fs = { workspace = true }
40+
tauri-plugin-os = { workspace = true }
4041
tauri-plugin-deep-link = { workspace = true }
4142

4243
# code gen

apps/oneclient/desktop/build.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
use std::process::Command;
2+
use std::time::{SystemTime, UNIX_EPOCH};
3+
14
fn main() {
5+
let output = Command::new("git")
6+
.args(&["rev-parse", "HEAD"])
7+
.output()
8+
.unwrap();
9+
let git_hash = String::from_utf8(output.stdout).unwrap();
10+
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
11+
12+
let start = SystemTime::now();
13+
let timestamp = start
14+
.duration_since(UNIX_EPOCH)
15+
.expect("Time went backwards")
16+
.as_secs();
17+
println!("cargo:rustc-env=BUILD_TIMESTAMP={}", timestamp);
18+
219
tauri_build::build();
320
}

apps/oneclient/desktop/capabilities/default.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"fs:allow-download-read",
3737
"fs:allow-download-write",
3838
"fs:allow-data-read-recursive",
39-
"fs:allow-data-write-recursive"
39+
"fs:allow-data-write-recursive",
40+
41+
"os:default"
4042
]
4143
}

apps/oneclient/desktop/src/api/commands.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,27 @@ use onelauncher_core::api::cluster::dao::ClusterId;
44
use onelauncher_core::api::packages::modpack::data::ModpackArchive;
55
use onelauncher_core::entity::clusters;
66
use onelauncher_core::error::LauncherResult;
7-
use tauri::Runtime;
87

98
use crate::oneclient::bundles::BundlesManager;
9+
use crate::oneclient::clusters::{OnlineClusterManifest, get_data_storage_versions};
1010

1111
#[taurpc::procedures(path = "oneclient", export_to = "../frontend/src/bindings.gen.ts")]
1212
pub trait OneClientApi {
13-
#[taurpc(alias = "openDevTools")]
14-
async fn open_dev_tools<R: Runtime>(webview_window: tauri::WebviewWindow<R>);
15-
1613
#[taurpc(alias = "getClustersGroupedByMajor")]
1714
async fn get_clusters_grouped_by_major() -> LauncherResult<HashMap<u32, Vec<clusters::Model>>>;
1815

1916
#[taurpc(alias = "getBundlesFor")]
2017
async fn get_bundles_for(cluster_id: ClusterId) -> LauncherResult<Vec<ModpackArchive>>;
18+
19+
#[taurpc(alias = "getVersions")]
20+
async fn get_versions() -> LauncherResult<OnlineClusterManifest>;
2121
}
2222

2323
#[taurpc::ipc_type]
2424
pub struct OneClientApiImpl;
2525

2626
#[taurpc::resolvers]
2727
impl OneClientApi for OneClientApiImpl {
28-
async fn open_dev_tools<R: Runtime>(self, webview_window: tauri::WebviewWindow<R>) {
29-
#[cfg(feature = "devtools")]
30-
webview_window.open_devtools();
31-
}
32-
3328
async fn get_clusters_grouped_by_major(
3429
self,
3530
) -> LauncherResult<HashMap<u32, Vec<clusters::Model>>> {
@@ -72,4 +67,8 @@ impl OneClientApi for OneClientApiImpl {
7267

7368
Ok(bundles)
7469
}
70+
71+
async fn get_versions(self) -> LauncherResult<OnlineClusterManifest> {
72+
get_data_storage_versions().await
73+
}
7574
}

0 commit comments

Comments
 (0)