Skip to content

Commit

Permalink
Highlight the active container in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Aug 13, 2023
1 parent a419ea5 commit d9d697b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rootfs/monitor-hub/static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ body {
flex-grow: 1;
}

.selected {
color: var(--text-highlight);
}

li:hover {
cursor: pointer;
color: var(--text-highlight);
Expand Down
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ function show_logs(name: any) {
// clear the log list
$("#container-logs").empty();

// loop through all of the li elements and remove the class "selected" and append the class "selected" if the id matches the name
$("#container-list li").each(function () {
if ($(this).attr("id") == name) {
$(this).addClass("selected");
} else {
$(this).removeClass("selected");
}
});

let logs = containers[name].logs;

// add the logs to the page
Expand Down

0 comments on commit d9d697b

Please sign in to comment.