mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-25 10:20:06 +08:00
chore: release v0.11.3
This commit is contained in:
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -351,7 +351,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clawpanel"
|
||||
version = "0.11.2"
|
||||
version = "0.11.3"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "clawpanel"
|
||||
version = "0.11.2"
|
||||
version = "0.11.3"
|
||||
edition = "2021"
|
||||
description = "ClawPanel - OpenClaw 可视化管理面板"
|
||||
authors = ["qingchencloud"]
|
||||
|
||||
@@ -101,6 +101,36 @@ fn panel_version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
||||
fn find_panel_policy_entry<'a>(policy: &'a VersionPolicy, current_version: &str) -> Option<&'a VersionPolicyEntry> {
|
||||
if let Some(entry) = policy.panels.get(current_version) {
|
||||
return Some(entry);
|
||||
}
|
||||
|
||||
let current_parts = parse_version(current_version);
|
||||
if current_parts.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
|
||||
policy
|
||||
.panels
|
||||
.iter()
|
||||
.filter_map(|(version, entry)| {
|
||||
let parts = parse_version(version);
|
||||
if parts.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
if parts[0] != current_parts[0] || parts[1] != current_parts[1] {
|
||||
return None;
|
||||
}
|
||||
if parts > current_parts {
|
||||
return None;
|
||||
}
|
||||
Some((parts, entry))
|
||||
})
|
||||
.max_by(|(left, _), (right, _)| left.cmp(right))
|
||||
.map(|(_, entry)| entry)
|
||||
}
|
||||
|
||||
fn parse_version(value: &str) -> Vec<u32> {
|
||||
value
|
||||
.split(|c: char| !c.is_ascii_digit())
|
||||
@@ -231,7 +261,7 @@ pub(crate) fn all_standalone_dirs() -> Vec<PathBuf> {
|
||||
|
||||
fn recommended_version_for(source: &str) -> Option<String> {
|
||||
let policy = load_version_policy();
|
||||
let panel_entry = policy.panels.get(panel_version());
|
||||
let panel_entry = find_panel_policy_entry(&policy, panel_version());
|
||||
match source {
|
||||
"official" => panel_entry
|
||||
.and_then(|entry| entry.official.recommended.clone())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-config-schema/schema.json",
|
||||
"productName": "ClawPanel",
|
||||
"version": "0.11.2",
|
||||
"version": "0.11.3",
|
||||
"identifier": "ai.openclaw.clawpanel",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
Reference in New Issue
Block a user