同步完整源码至远程:扁平化重构现状 + 未入库源文件

- 补入库:server/internal/db/dump.go、redis 分页/扫描预算测试、opsxdb-mcp main_test、
  packages/opsxdb-mcp package-lock、docs 审计与对比文档等 37 个新文件
- 含结构扁平化进行中的 80 处修改与 155 处旧结构删除(server/ src/ src-tauri/ 为当前有效源)
- 构建产物(bin/target/dist)与签名私钥仍按规则排除
This commit is contained in:
logan committed 2026-10-16 03:47:33 +08:00
1 parent 5c0be49217
commit 2c0bfafd8d
269 files changed
+10372 -16435

No files matched your search

+5283
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1,12 +1,12 @@
[package]
name = "opsxdb-desktop"
name = "opsxdb"
version = "0.1.0"
description = "OpsxDB Tauri desktop shell"
authors = ["OpsxDB"]
edition = "2021"
[lib]
name = "opsxdb_desktop_lib"
name = "opsxdb_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
+8
View File
@@ -0,0 +1,8 @@
# Sidecar binaries
`./run.sh package` 会把 `opsxdb-server` 复制为带目标三元组后缀的文件,例如:
- `opsxdb-server-aarch64-apple-darwin`
- `opsxdb-server-x86_64-apple-darwin`
Tauri `externalBin` 在构建时按当前 triple 解析。
+3
View File
@@ -1,3 +1,6 @@
fn main() {
// The Tauri CLI still passes this Windows-only legacy flag on macOS.
#[cfg(not(windows))]
std::env::remove_var("STATIC_VCRUNTIME");
tauri_build::build()
}
+1 -1
View File
@@ -1,3 +1,3 @@
fn main() {
opsxdb_desktop_lib::run();
opsxdb_lib::run();
}
+6 -4
View File
@@ -52,7 +52,7 @@ fn version_major(v: &str) -> &str {
v.split('.').next().unwrap_or("")
}
/// GET /health 并解析版本;失败或非 200 返回 None。
/// GET /health 并核对服务身份与版本;不能复用同族其他产品的端口。
fn health_version(addr: &str) -> Option<String> {
let resp = reqwest::blocking::Client::builder()
.timeout(Duration::from_secs(1))
@@ -65,6 +65,9 @@ fn health_version(addr: &str) -> Option<String> {
return None;
}
let v: serde_json::Value = resp.json().ok()?;
if v.get("service")?.as_str()? != "opsxdb" {
return None;
}
v.get("version")?.as_str().map(|s| s.to_string())
}
@@ -120,9 +123,8 @@ fn candidate_bins(app: &AppHandle) -> Vec<PathBuf> {
out.push(exe.join(&bin));
out.push(exe.join("binaries").join(&bin));
}
// 开发态:仓库 apps/server/bin
out.push(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../server/bin").join(&bin));
out.push(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../../apps/server/bin").join(&bin));
// 开发态:根目录 server/bin
out.push(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../server/bin").join(&bin));
out
}
+3 -2
View File
@@ -4,15 +4,16 @@
"version": "0.1.0",
"identifier": "com.opsx.db",
"build": {
"beforeDevCommand": "bash -lc 'curl -fsS http://127.0.0.1:5174 >/dev/null 2>&1 || npm run dev'",
"beforeDevCommand": "bash -lc 'curl -fsS http://127.0.0.1:5174 >/dev/null 2>&1 || npm run dev:ui'",
"devUrl": "http://127.0.0.1:5174",
"beforeBuildCommand": "bash -lc 'npm run build'",
"beforeBuildCommand": "npm run build:ui",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "OpsxDB",
"hiddenTitle": true,
"width": 1280,
"height": 800,
"minWidth": 960,