diff --git a/plugins/endpoints/api/siteagent.py b/plugins/endpoints/api/siteagent.py index 3604aa7b..edabe28d 100644 --- a/plugins/endpoints/api/siteagent.py +++ b/plugins/endpoints/api/siteagent.py @@ -568,8 +568,16 @@ def package_siteagent(): archive.write(certpath, 'server.crt') buffer.seek(0) + # Stamp the staged agent version into the download filename so a DT operator + # can see which agent build a package carries at a glance. This is cosmetic: + # install.ps1 finds the exe by its fixed name inside the ZIP, so the download + # name never affects the install. Falls back to the unversioned name when no + # managed version is current (only a legacy flat file is staged). + agentversion = agentstore.current_version('agent') + download_name = ('shopdb-endpoint-agent-{0}.zip'.format(agentversion) + if agentversion else 'shopdb-endpoint-agent.zip') return send_file( buffer, mimetype='application/zip', as_attachment=True, - download_name='shopdb-endpoint-agent.zip') + download_name=download_name) diff --git a/plugins/endpoints/frontend/views/AgentKeySettings.vue b/plugins/endpoints/frontend/views/AgentKeySettings.vue index f213c234..a3b659f3 100644 --- a/plugins/endpoints/frontend/views/AgentKeySettings.vue +++ b/plugins/endpoints/frontend/views/AgentKeySettings.vue @@ -106,8 +106,9 @@
-

How it works

-
@@ -308,13 +312,15 @@ and roll the current pointer back to a retained version. Staging only changes what a FUTURE download contains; it does not touch any running endpoint. Pushing to live endpoints is a separate, - heavier grant handled elsewhere. - ============================================================= --> -
+ heavier grant handled elsewhere. Collapsed by default - binary + management is infrequent next to building a package. --> +
+

Upload New/Legacy Agents

+

{{ binary.label }}

Upload {{ binary.name }} updated EXE. Uploading here will update the @@ -361,7 +367,7 @@ roll back to. WARNING copy per intent: the version must be confirmed from the EXE properties before uploading. -->

WARNING: confirm agent version before uploading from the EXE @@ -454,7 +460,8 @@

-
+ + @@ -555,6 +562,12 @@ function formatDate(value) { return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleString() } +function filenameFromResponse(response, fallback) { + const disposition = response.headers?.['content-disposition'] || '' + const match = /filename\*?=(?:UTF-8'')?"?([^";]+)"?/i.exec(disposition) + return match ? decodeURIComponent(match[1]) : fallback +} + function applyStatus(data) { key.value = data.key || null envkeyfallback.value = !!data.envkeyfallback @@ -716,7 +729,10 @@ async function buildSiteAgent() { const url = window.URL.createObjectURL(response.data) const link = document.createElement('a') link.href = url - link.download = 'shopdb-endpoint-agent.zip' + // Honor the server's versioned download name (shopdb-endpoint-agent-.zip) + // from Content-Disposition so operators see the agent version in the file + // name; fall back to the fixed name when the header is absent. + link.download = filenameFromResponse(response, 'shopdb-endpoint-agent.zip') document.body.appendChild(link) link.click() link.remove() @@ -904,6 +920,25 @@ function editConfiguration() { } .binary-upload .form-control[type="text"] { max-width: 12rem; } .previous-versions { margin-top: 0.5rem; } +.collapsible { margin: 0.5rem 0; } +.collapsible > summary { + cursor: pointer; + list-style: none; + display: flex; + align-items: center; + gap: 0.4rem; + user-select: none; +} +.collapsible > summary::-webkit-details-marker { display: none; } +.collapsible > summary::before { + content: "\25be"; + display: inline-block; + transform: rotate(-90deg); + transition: transform 0.15s ease; + color: var(--color-text-muted, #888); +} +.collapsible[open] > summary::before { transform: rotate(0deg); } +.collapsible > summary h4 { margin: 0; } .field-warning { margin: 0.25rem 0 0.5rem; padding: 0.5rem 0.75rem;