Fix GST operator agent localhost HTTPS detection

This commit is contained in:
A R R R Associates
2026-09-11 11:49:47 +05:30
parent 3e660ec0b9
commit 26c998023d
6 changed files with 90 additions and 30 deletions
@@ -136,7 +136,7 @@
<script>
(() => {
const port = {{ operator_agent_port|int }};
const base = `http://127.0.0.1:${port}`;
const base = `https://localhost:${port}`;
const statusEl = document.getElementById('gst-agent-status');
const panel = document.getElementById('gst-job-panel');
const bar = document.getElementById('gst-job-bar');
@@ -154,8 +154,9 @@
statusEl.className = 'font-semibold text-emerald-700';
return true;
} catch (e) {
statusEl.textContent = 'Not installed / not running';
statusEl.className = 'font-semibold text-red-600';
statusEl.textContent = 'Browser cannot reach local agent';
statusEl.className = 'font-semibold text-amber-700';
statusEl.title = e && e.message ? e.message : 'Local HTTPS connection failed';
return false;
}
}
@@ -194,7 +195,7 @@
if (msg) msg.textContent = 'Starting visible GST login on this workstation…';
try {
const online = await agentStatus();
if (!online) throw new Error('Install/start the GST Operator Agent using the button above, then retry Start GST Download.');
if (!online) throw new Error('The GST Operator Agent is not reachable over local HTTPS. Install/update the agent using the button above, then refresh this page.');
const r = await fetch(base + '/api/gst/start', {
method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({token:prepared.token})
});