diff --git a/rootfs/monitor-hub/static/css/index.css b/rootfs/monitor-hub/static/css/index.css index 5bc8bc4..6df92ff 100644 --- a/rootfs/monitor-hub/static/css/index.css +++ b/rootfs/monitor-hub/static/css/index.css @@ -33,6 +33,10 @@ body { flex-grow: 1; } +.selected { + color: var(--text-highlight); +} + li:hover { cursor: pointer; color: var(--text-highlight); diff --git a/src/index.ts b/src/index.ts index 3a31440..99d8d6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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