feat(nacos): add Nacos dashboard metrics

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-27 12:16:39 +08:00
1 parent 98bf3d1dfd
commit f9c2fb27d3
41 files changed
+3268 -36

No files matched your search

+17
View File
@@ -109,6 +109,13 @@ pub(crate) struct InstanceUpdateReq {
req: dbx_core::nacos::NacosInstanceUpdate,
}
#[derive(serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct DashboardReq {
connection_id: String,
query: dbx_core::nacos::NacosDashboardQuery,
}
#[derive(serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct RawReq {
@@ -322,6 +329,16 @@ pub async fn update_instance(
Ok(Json(()))
}
pub async fn get_dashboard(
State(state): State<Arc<WebState>>,
Json(req): Json<DashboardReq>,
) -> Result<Json<dbx_core::nacos::NacosDashboardSnapshot>, AppError> {
let result = dbx_core::nacos::service::nacos_get_dashboard_core(&state.app, &req.connection_id, req.query)
.await
.map_err(AppError::from)?;
Ok(Json(result))
}
pub async fn raw_request(
State(state): State<Arc<WebState>>,
Json(req): Json<RawReq>,