// ========== SHIPDECK DEPLOYS (DC-130) ========== // Source deploys panel: drives the shipdeck CLI via the DashCaddy // /api/v1/deploys bridge proxy. Modal lists deployable repos + deployed // services, shows the journal, and runs deploy/rollback with live output. // // Follows the security-center.js modal pattern (injectModal + button in the // top bar) and the weather-modal visual language. // DC-133: pure repo-option builder. Remote Gitea fields are UNTRUSTED (a // hostile instance controls full_name/description/url), so every // interpolated value must be HTML-escaped before innerHTML. Exposed on // window so status/tests can pin the escaping with hostile payloads. window.__dc133_buildRepoOptions = function (repos, escFn) { var e = escFn || function (s) { return String(s).replace(/[&<>"']/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]; }); }; return '' + (repos || []).map(function (r) { return ''; }).join(''); }; // Three-state token semantics, exposed for VM tests: // anonymous=true -> explicit empty; typed value -> token; neither -> omitted. window.__dc133_requestToken = function (anonymous, typed) { if (anonymous) return ''; var t = String(typed || '').trim(); return t || undefined; }; (function () { injectModal('deploys-modal', `
| Service | Last action | When | Release | ' + ' |
|---|---|---|---|---|
| ' + esc(s.name) + ' | ' + '' + esc(s.last_action) + ' | ' + '' + esc(s.last_time) + ' | ' + '' + esc(s.last_epoch) + ' | ' + '' + ' | ' + '
| Time | Service | Action | Release | Duration | ' + '
|---|---|---|---|---|
| ' + esc(r.time) + ' | ' + esc(r.service) + ' | ' + esc(r.action) + ' | ' + esc(r.epoch) + ' | ' + esc(r.duration || '—') + ' |