feat: more in depth statuses

This commit is contained in:
Strix 2023-10-16 01:36:02 +02:00
parent 8d2a69c366
commit 4decadebfa
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
3 changed files with 53 additions and 6 deletions

View file

@ -27,10 +27,24 @@ pub async fn get_hub_issues() -> HttpResponse {
.body(status_response.text().await.unwrap())
}
#[get("/hub_issue_timeline/{issue_id}")]
pub async fn get_hub_issue_timeline(info: web::Path<(u32,)>) -> HttpResponse {
let status_response = if let Ok(res) = reqwest::get(format!("https://git.ixvd.net/api/v1/repos/ixvd/hub/issues/{}/timeline", info.into_inner().0)).await {
res
} else {
return HttpResponse::build(StatusCode::INTERNAL_SERVER_ERROR)
.body("Failed to get status from forgejo");
};
HttpResponse::build(StatusCode::OK)
.body(status_response.text().await.unwrap())
}
pub fn configure(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/relay")
.service(get_gatus_services)
.service(get_hub_issues)
.service(get_hub_issue_timeline)
);
}