Files
AobaV2/AobaClient/src/views/settings.rs
Amatsugu 7061b4c313 Streamlined grpc auth
Added ShareX Destiation on client
2025-05-21 22:07:57 -04:00

35 lines
791 B
Rust

use dioxus::prelude::*;
use crate::rpc::get_rpc_client;
#[component]
pub fn Settings() -> Element {
let dst = use_resource(async move || {
let result = get_rpc_client().get_share_x_destination(()).await;
if let Ok(d) = result {
if let Some(r) = d.into_inner().dst_result {
return match r {
crate::rpc::aoba::share_x_response::DstResult::Destination(json) => json,
crate::rpc::aoba::share_x_response::DstResult::Error(err) => err,
};
}
return "No Result".to_string();
}
let err = result.err().unwrap();
let status = err.message();
return format!("Failed to load config: {status}").to_string();
});
let d = dst.cloned().unwrap_or("".to_string());
rsx! {
"this is settings"
div {
pre {
class: "codeSelect",
"test {d}"
}
}
}
}