diff --git a/src/http/error.rs b/src/http/error.rs index ebb5d33..717aae1 100644 --- a/src/http/error.rs +++ b/src/http/error.rs @@ -51,11 +51,6 @@ impl IntoResponse for AppError { code: "file-error".to_string(), message: err.to_string(), }, - AppError::DockerError(err) => ErrorInfo { - status: StatusCode::INTERNAL_SERVER_ERROR, - code: "docker-error".to_string(), - message: err.to_string(), - }, AppError::Template(err) => ErrorInfo { status: StatusCode::INTERNAL_SERVER_ERROR, code: "template-error".to_string(), @@ -70,7 +65,21 @@ impl IntoResponse for AppError { code: code.to_string(), message: message.to_string(), }, - + AppError::DockerError(err) => match err { + bollard::errors::Error::DockerResponseServerError { + status_code, + message, + } => ErrorInfo { + status: StatusCode::from_u16(status_code).unwrap(), + code: "docker-error".to_string(), + message, + }, + _ => ErrorInfo { + status: StatusCode::INTERNAL_SERVER_ERROR, + code: "docker-error".to_string(), + message: err.to_string(), + }, + }, AppError::JSONFormat(rejection) => { let status = match rejection { JsonRejection::JsonDataError(_) => StatusCode::UNPROCESSABLE_ENTITY, diff --git a/templates/container/get-one.html b/templates/container/get-one.html index 79fbbf4..ace0dd1 100644 --- a/templates/container/get-one.html +++ b/templates/container/get-one.html @@ -11,7 +11,7 @@
ID
{{ info.id }}
Status
-
{{ info.state }}
+
{{ info.state }}
Image
{{ info.image }}
Image ID
@@ -129,6 +129,22 @@ word-break: break-all; } + dd[data-state] { + background-color: #202248; + } + + dd[data-state="running"] { + background-color: #113B29; + color: #3DD68C; + } + + dd[data-state="stopped"], + dd[data-state="exited"], + dd[data-state="dead"] { + background-color: #500F1C; + color: #FF9592; + } + dd:after { content: ""; diff --git a/templates/home.html b/templates/home.html index c44447c..e017b5f 100644 --- a/templates/home.html +++ b/templates/home.html @@ -7,8 +7,8 @@

All stacks

@@ -24,12 +24,11 @@ align-items: center; margin-bottom: 0.5rem; gap: 0.5rem; + border-left: 5px solid #E5484D; + padding-left: 0.5ch; - .stopped { - background-color: #E5484D; - padding: 2px 4px; - border-radius: 4px; - font-size: 11pt; + &.active { + border-left-color: #33B074; } }