diff --git a/src/server/websocket/websocketServer.go b/src/server/websocket/websocketServer.go index 6aa8a21..97ce6ae 100644 --- a/src/server/websocket/websocketServer.go +++ b/src/server/websocket/websocketServer.go @@ -338,9 +338,9 @@ var executeCommand http.HandlerFunc = func(w http.ResponseWriter, r *http.Reques for i := 0; i < len(agentNames); i++ { res := <- resultsChan if res.Err != nil { - combined.WriteString(fmt.Sprintf("[%s] ERROR: %s\n", res.AgentName, res.Err.Error())) + combined.WriteString(fmt.Sprintf("\n[%s] ERROR: %s\n", res.AgentName, res.Err.Error())) } else { - combined.WriteString(fmt.Sprintf("[%s] %s\n", res.AgentName, res.Payload)) + combined.WriteString(fmt.Sprintf("\n[%s]\n%s", res.AgentName, res.Payload)) } } diff --git a/static/gontrol-helper.js b/static/gontrol-helper.js index 655eb16..8aa7bcd 100644 --- a/static/gontrol-helper.js +++ b/static/gontrol-helper.js @@ -12,8 +12,12 @@ document.addEventListener('DOMContentLoaded', () => { if (event.target.id === "agentList") { restoreCheckboxState(); updateAgentDropdown(); + bindRowClicks(); } }); + + bindRowClicks(); + restoreCheckboxState(); }); function prepareAgentNames(event) { @@ -37,6 +41,8 @@ function toggleAllCheckboxes() { const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked); checkboxes.forEach(checkbox => checkbox.checked = !allChecked); + saveCheckboxState(); + } function saveCheckboxState() { @@ -54,6 +60,24 @@ function restoreCheckboxState() { }); } +function bindRowClicks() { + const rows = document.querySelectorAll('#agentList tbody tr'); + rows.forEach(row => { + const agentName = row.dataset.agentName || row.cells[1]?.textContent?.trim(); + row.dataset.agentName = agentName; + + row.addEventListener('click', (e) => { + if (e.target.tagName === "BUTTON" || e.target.type === "checkbox") return; + + const checkbox = row.querySelector(`input.agent-checkbox[data-agent-name="${agentName}"]`); + if (checkbox) { + checkbox.checked = !checkbox.checked; + saveCheckboxState(); + } + }); + }); +} + function updateAgentDropdown() { const select = document.getElementById("agentName"); const optionValues = Array.from(select.options).map(opt => opt.value); diff --git a/static/stylesheet.css b/static/stylesheet.css index 4f7b160..43d6f91 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -13,9 +13,9 @@ #logs-container { height: 300px; /* or any fixed height you prefer */ overflow-y: auto; /* enables vertical scroll when content overflows */ - border: 1px solid #ccc; /* optional: for visual clarity */ + border: 1px solid #fff; /* optional: for visual clarity */ padding: 10px; /* optional: spacing inside the container */ - background-color: #f8f9fa; /* optional: subtle background for log readability */ + /* background-color: #f8f9fa; /1* optional: subtle background for log readability *1/ */ } .log-info, .log-warning, .log-error, .log-fatal, .log-debug{ @@ -42,3 +42,7 @@ #graph-container { margin: 0; padding: 0; } + +tr.selected-row { + background-color: var(--bs-table-hover-bg) !important; +} diff --git a/templates/index.html b/templates/index.html index 5cdd538..b8a4b96 100644 --- a/templates/index.html +++ b/templates/index.html @@ -27,7 +27,7 @@