service: clarify metis replacement coverage

This commit is contained in:
Brad Stein 2026-03-31 19:21:26 -03:00
parent dfb7b9dcc0
commit a6ef5a0ff6

View File

@ -516,6 +516,7 @@ var metisPage = template.Must(template.New("metis").Parse(`<!doctype html>
<select id="device-select"></select> <select id="device-select"></select>
</label> </label>
</div> </div>
<div class="microcopy" id="target-note"></div>
<div class="microcopy" id="host-note"></div> <div class="microcopy" id="host-note"></div>
<div class="microcopy" id="device-note"></div> <div class="microcopy" id="device-note"></div>
<div class="microcopy" id="artifact-note"></div> <div class="microcopy" id="artifact-note"></div>
@ -577,6 +578,7 @@ var metisPage = template.Must(template.New("metis").Parse(`<!doctype html>
const eventsEl = document.getElementById('events'); const eventsEl = document.getElementById('events');
const snapshotCountEl = document.getElementById('snapshot-count'); const snapshotCountEl = document.getElementById('snapshot-count');
const targetCountEl = document.getElementById('target-count'); const targetCountEl = document.getElementById('target-count');
const targetNoteEl = document.getElementById('target-note');
const hostNoteEl = document.getElementById('host-note'); const hostNoteEl = document.getElementById('host-note');
const deviceNoteEl = document.getElementById('device-note'); const deviceNoteEl = document.getElementById('device-note');
const artifactNoteEl = document.getElementById('artifact-note'); const artifactNoteEl = document.getElementById('artifact-note');
@ -693,6 +695,10 @@ var metisPage = template.Must(template.New("metis").Parse(`<!doctype html>
if(!nodeSelect.value && nodeNames.length){ if(!nodeSelect.value && nodeNames.length){
nodeSelect.value = nodeNames[0]; nodeSelect.value = nodeNames[0];
} }
const trackedNodes = Math.max((state.snapshots || []).length, (state.flash_hosts || []).length);
targetNoteEl.textContent = nodeNames.length
? 'Only nodes with full replacement definitions appear here. Current replacement coverage: ' + nodeNames.length + ' node(s)' + (trackedNodes ? ' across ' + trackedNodes + ' tracked cluster node(s).' : '.')
: 'No inventory-backed replacement nodes are loaded yet.';
setOptions(hostSelect, state.flash_hosts || [], null, 'No flash hosts available'); setOptions(hostSelect, state.flash_hosts || [], null, 'No flash hosts available');
if(state.selected_host && (state.flash_hosts || []).includes(state.selected_host)){ if(state.selected_host && (state.flash_hosts || []).includes(state.selected_host)){
@ -819,7 +825,7 @@ var metisPage = template.Must(template.New("metis").Parse(`<!doctype html>
await runAction('Starting image build', 'Queueing the node image build now.', async ()=>{ await runAction('Starting image build', 'Queueing the node image build now.', async ()=>{
await post('/api/jobs/build', {node: nodeSelect.value}); await post('/api/jobs/build', {node: nodeSelect.value});
await refreshState({silent:true}); await refreshState({silent:true});
banner('success', 'Image build queued', 'Metis started building the replacement image for ' + nodeSelect.value + '.'); banner('success', 'Image build queued', 'Metis started building the replacement image for ' + nodeSelect.value + '. Successful build-only runs land on ' + state.local_host + ' at /var/lib/metis/artifacts/' + nodeSelect.value + '.img.');
}); });
}); });