diff --git a/source/summit/web/builders.d b/source/summit/web/builders.d index 99d2ec4..82225de 100644 --- a/source/summit/web/builders.d +++ b/source/summit/web/builders.d @@ -20,7 +20,7 @@ import moss.service.accounts; import vibe.d; import moss.service.models.endpoints; -/** +/** * BuilderWeb management */ @requiresAuth @path("/builders") public final class BuilderWeb @@ -29,7 +29,7 @@ import moss.service.models.endpoints; mixin AppAuthenticatorContext; - /** + /** * Construct new BuilderWeb * * Params: @@ -40,7 +40,7 @@ import moss.service.models.endpoints; this.context = context; } - /** + /** * Landing page for builders, rendered mostly with JS */ @noAuth void index() @safe @@ -48,7 +48,7 @@ import moss.service.models.endpoints; render!"builders/index.dt"; } - /** + /** * View an avalanche endpoint. * * Params: @@ -62,7 +62,7 @@ import moss.service.models.endpoints; render!("builders/view.dt", endpoint); } - /** + /** * Delete a builder completely (account, endpoint + tokens) * * Params: @@ -91,7 +91,7 @@ import moss.service.models.endpoints; redirect("/builders"); } - /** + /** * Try to repair the builder. * * At the moment this simply marks it operational again, and subsequent builds may @@ -111,6 +111,7 @@ import moss.service.models.endpoints; endpoint.status = EndpointStatus.Operational; endpoint.statusText = "Fully operational"; + endpoint.workStatus = WorkStatus.Idle; immutable svErr = context.appDB.update((scope tx) => endpoint.save(tx)); enforceHTTP(svErr.isNull, HTTPStatus.internalServerError, err.message); diff --git a/views/builders/actions.dt b/views/builders/actions.dt index 8233b32..608d2de 100644 --- a/views/builders/actions.dt +++ b/views/builders/actions.dt @@ -7,7 +7,7 @@ a.btn.btn-danger(href=format!"/builders/%s/delete"(endpoint.id)) svg.icon: use(xlink:href="/static/tabler/tabler-sprite.svg#tabler-trash") | Delete - - if (endpoint.status != EndpointStatus.Operational) + - if (endpoint.status != EndpointStatus.Operational || endpoint.workStatus != WorkStatus.Idle) - { a.btn.mx-2.btn-primary(href=format!"/builders/%s/repair"(endpoint.id)) svg.icon: use(xlink:href="/static/tabler/tabler-sprite.svg#tabler-hammer")