frontend login guard and page, deployment / build copy route

This commit is contained in:
mbecker20
2022-12-21 06:21:23 +00:00
parent 5ac3239f4f
commit 902bf0c981
22 changed files with 690 additions and 37 deletions

View File

@@ -41,6 +41,20 @@ impl MonitorClient {
.context(format!("failed at creating full build"))
}
pub async fn copy_build(
&self,
id: &str,
new_name: &str,
new_server_id: &str,
) -> anyhow::Result<Build> {
self.post(
&format!("/api/build/{id}/copy"),
json!({ "name": new_name, "server_id": new_server_id }),
)
.await
.context(format!("failed at copying build {id}"))
}
pub async fn delete_build(&self, id: &str) -> anyhow::Result<Build> {
self.delete::<(), _>(&format!("/api/build/{id}/delete"), None)
.await

View File

@@ -61,6 +61,20 @@ impl MonitorClient {
.context(format!("failed at creating full deployment"))
}
pub async fn copy_deployment(
&self,
id: &str,
new_name: &str,
new_server_id: &str,
) -> anyhow::Result<Deployment> {
self.post(
&format!("/api/deployment/{id}/copy"),
json!({ "name": new_name, "server_id": new_server_id }),
)
.await
.context(format!("failed at copying deployment {id}"))
}
pub async fn delete_deployment(&self, id: &str) -> anyhow::Result<Deployment> {
self.delete::<(), _>(&format!("/api/deployment/{id}/delete"), None)
.await