feat(Ui): First stable ui
This commit is contained in:
1 parent
a5e4244ed4
commit
65698c0a2a
3 files changed
+446
-385
No files matched your search
@@ -0,0 +1,49 @@
|
|||||||
|
use std::env;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
{
|
||||||
|
// Check for X11 libraries
|
||||||
|
println!("cargo:rustc-link-lib=X11");
|
||||||
|
println!("cargo:rustc-link-lib=Xrandr");
|
||||||
|
println!("cargo:rustc-link-lib=Xinerama");
|
||||||
|
println!("cargo:rustc-link-lib=Xcursor");
|
||||||
|
println!("cargo:rustc-link-lib=Xi");
|
||||||
|
|
||||||
|
// Check for Wayland libraries (optional)
|
||||||
|
if env::var("CARGO_FEATURE_WAYLAND").is_ok() {
|
||||||
|
println!("cargo:rustc-link-lib=wayland-client");
|
||||||
|
println!("cargo:rustc-link-lib=wayland-egl");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set library search paths
|
||||||
|
let lib_paths = vec![
|
||||||
|
"/usr/lib/x86_64-linux-gnu",
|
||||||
|
"/usr/lib64",
|
||||||
|
"/usr/lib",
|
||||||
|
];
|
||||||
|
|
||||||
|
for path in lib_paths {
|
||||||
|
println!("cargo:rustc-link-search={}", path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set pkg-config for better detection
|
||||||
|
if let Ok(pkg_config) = which::which("pkg-config") {
|
||||||
|
println!("cargo:rustc-env=PKG_CONFIG_PATH={}", pkg_config.display());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
println!("cargo:rustc-link-lib=user32");
|
||||||
|
println!("cargo:rustc-link-lib=shell32");
|
||||||
|
println!("cargo:rustc-link-lib=gdi32");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
println!("cargo:rustc-link-lib=framework=Cocoa");
|
||||||
|
println!("cargo:rustc-link-lib=framework=Foundation");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,3 +24,20 @@ pub fn stats(app: &RcloneApp) -> Result<Value, String> {
|
|||||||
serde_json::from_str(&output).map_err(|e| format!("Ошибка парсинга статистики: {}", e))?;
|
serde_json::from_str(&output).map_err(|e| format!("Ошибка парсинга статистики: {}", e))?;
|
||||||
Ok(stats)
|
Ok(stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Получить список поддерживаемых бэкендов (типов хранилищ)
|
||||||
|
pub fn backends(app: &RcloneApp) -> Result<Vec<String>, String> {
|
||||||
|
let output = app.run_command(&["help", "backends"])?;
|
||||||
|
let mut backends = Vec::new();
|
||||||
|
for line in output.lines() {
|
||||||
|
let line = line.trim();
|
||||||
|
if line.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Формат строки: " drive Google Drive"
|
||||||
|
if let Some(first_word) = line.split_whitespace().next() {
|
||||||
|
backends.push(first_word.to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(backends)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user