Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add health status check #58

Merged
merged 4 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm run lint
# more things can be add later like tests etc..

6 changes: 5 additions & 1 deletion backend/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ export class Stack {
for (let line of lines) {
try {
let obj = JSON.parse(line);
statusList.set(obj.Service, obj.State);
if (obj.Health === "") {
statusList.set(obj.Service, obj.State);
} else {
statusList.set(obj.Service, obj.Health);
}
} catch (e) {
}
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ export default defineComponent({
},

bgStyle() {
if (this.status === "running") {
if (this.status === "running" || this.status === "healthy") {
return "bg-primary";
} else if (this.status === "unhealthy") {
return "bg-danger";
} else {
return "bg-secondary";
}
Expand Down
Loading