From f03a4c0bc6ce3ef11b2de37632236a6cccf4f44a Mon Sep 17 00:00:00 2001 From: Matthew Hasselfield Date: Mon, 30 Mar 2026 12:38:18 -0400 Subject: [PATCH 1/3] HostManager: new docker functionality --- src/panels/HostManager.vue | 87 +++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/src/panels/HostManager.vue b/src/panels/HostManager.vue index dabbed9..6529dd6 100644 --- a/src/panels/HostManager.vue +++ b/src/panels/HostManager.vue @@ -7,14 +7,32 @@
Host Manager -

Connection

+

Status

- - + + + + + +
@@ -33,8 +51,9 @@ target set-target
-
- {{ item.instance_id }} +
+ {{ item.instance_id }}{{ item.restart_indicator }} {{ item.agent_class }} {{ item.next_action }} {{ item.target_state }} @@ -62,7 +81,24 @@ +
+ + +
+ + + + + + + +
@@ -75,12 +111,17 @@ return { panel: {}, children: [], + restartCount: 0, + pullCount: 0, + orphanCount: 0, ops: window.ocs_bundle.web.ops_data_init({ 'manager': {}, 'update': { params: {reload_config: false}, }, 'die': {}, + 'docker_pull': {}, + 'remove_orphans': {}, }), } }, @@ -88,10 +129,13 @@ address: String, }, methods: { - update_child_states(op_name, method, stat, msg, session) { + update_from_session_data(op_name, method, stat, msg, session) { if (!session.data || session.status != 'running') return; + this.orphanCount = Object.keys(session.data.orphans).length; + this.pullCount = Object.keys(session.data.new_tags).length; + function sortKey(state) { return [state.agent_class.toUpperCase(), state.agent_class, @@ -103,6 +147,17 @@ .map(state => [sortKey(state), state]) .toSorted() .map(([,state]) => state); + let rc = 0; + for (const child of this.children) { + if (child.restart_required) { + child.restart_indicator = ' *update-pending*'; + rc += 1; + } else { + child.restart_indicator = ''; + } + } + + this.restartCount = rc; }, set_target(child, updn) { child.target_state = '(' + updn + ')'; @@ -111,11 +166,17 @@ }); }, refresh_config() { - window.ocs_bundle.ui_start_proc(this.address, 'update', - {'reload_config': true}); + window.ocs_bundle.ui_start_proc(this.address, 'update', + {'reload_config': true}); + }, + remove_orphans() { + window.ocs_bundle.ui_start_proc(this.address, 'remove_orphans', {}); + }, + docker_pull() { + window.ocs_bundle.ui_start_proc(this.address, 'docker_pull', {}); }, startListening() { - this.panel.client.add_watcher('manager', 5., this.update_child_states); + this.panel.client.add_watcher('manager', 5., this.update_from_session_data); }, }, } @@ -142,6 +203,10 @@ padding: 10px 0px; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; + } + .hm_row_emph { + font-style: italic; } .hm_header { border-bottom: 1px solid black; From 867e12078465d5d79eb12c7a030511ec8f5f8a39 Mon Sep 17 00:00:00 2001 From: Matthew Hasselfield Date: Mon, 30 Mar 2026 12:47:51 -0400 Subject: [PATCH 2/3] Make sure that last works with old HM too. --- src/panels/HostManager.vue | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/panels/HostManager.vue b/src/panels/HostManager.vue index 6529dd6..a0639d0 100644 --- a/src/panels/HostManager.vue +++ b/src/panels/HostManager.vue @@ -21,16 +21,19 @@ caption="Restarts" tip="Indicates whether running agents have an update pending; if red, consider restarting agents (as marked in list)." :value="this.restartCount <= 0" + v-if="this.sessionSchema > 0" /> @@ -89,10 +92,14 @@ + :op_data="ops.docker_pull" + v-if="this.sessionSchema > 0" + /> + :op_data="ops.remove_orphans" + v-if="this.sessionSchema > 0" + /> 0) { + this.orphanCount = Object.keys(session.data.orphans).length; + this.pullCount = Object.keys(session.data.new_tags).length; + } function sortKey(state) { return [state.agent_class.toUpperCase(), @@ -149,7 +164,7 @@ .map(([,state]) => state); let rc = 0; for (const child of this.children) { - if (child.restart_required) { + if (child?.restart_required) { child.restart_indicator = ' *update-pending*'; rc += 1; } else { From c62e62e7ce74d165ea6ba481dd6b6b8959723767 Mon Sep 17 00:00:00 2001 From: Matthew Hasselfield Date: Mon, 30 Mar 2026 13:30:08 -0400 Subject: [PATCH 3/3] Update HostManager fake agent. --- agent/hostmanager.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/agent/hostmanager.yaml b/agent/hostmanager.yaml index 9ac446b..cb34fad 100644 --- a/agent/hostmanager.yaml +++ b/agent/hostmanager.yaml @@ -7,55 +7,64 @@ processes: 'timestamp_field': 'timestamp' } data: { + "orphans": {}, + "new_tags": {}, "child_states": [ { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "ocs-aggregator" + "instance_id": "ocs-aggregator", + "restart_required": false }, { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "ocs-influx-publisher" + "instance_id": "ocs-influx-publisher", + "restart_required": true }, { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "ocs-registry" + "instance_id": "ocs-registry", + "restart_required": false }, { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "hk-agent-01" + "instance_id": "hk-agent-01", + "restart_required": false }, { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "ocs-ups-satp-c2-01" + "instance_id": "ocs-ups-satp-c2-01", + "restart_required": false }, { "next_action": "up", "target_state": "up", "stability": 1, "agent_class": "[docker]", - "instance_id": "ocs-ups-satp-c1-01" + "instance_id": "ocs-ups-satp-c1-01", + "restart_required": false }, { "next_action": "down", "target_state": "down", "stability": 0.9978726211941876, "agent_class": "[docker]", - "instance_id": "ocs-latr-pfeiffer-01" + "instance_id": "ocs-latr-pfeiffer-01", + "restart_required": false } ] }