f538a03bd5
gates / gates (push) Successful in 25s
10-localisation.md §7 goes from [DESIGN, proposed] to [FACT], with the numbers it was specced against corrected — and one correction chose an instrument rather than a footnote. The catalog has 1 032 copy strings, not 835. 832 carry a Hungarian letter, which was right. But the ASCII-ONLY Hungarian is ~120 strings, not three: „Aldomain" appears 53 times and „A szerver domain neve" 53 times, and the three the plan named („Igen"/„Nem"/„Nincs") do not occur in this catalog at all. An accent-only gate passes every one of them inside an English block — R-565's blind spot arriving again in a different repo. New §10.6 records what was proven live rather than reasoned about: the English pages show English; the seven Hungarian pages are byte-identical before and after the push apart from the per-session CSRF token; and a 0.255.0 box with the block synced onto it renders identically and logs no warning, in a 93-line window that contains the sync's own lines, so the absence is evidence and not a dead log. Rows R-589 (the update badge is Hungarian on an English page), R-590 (the data-folder card's backup promise, likewise, and it is a promise about the customer's files), R-591 (Stack.Copy() deep-copies five Meta fields and not the new I18n map — safe today, which is precisely why it is a row), R-592 (three defects inside the new catalog gate, closed the same session, each found by its own decoy). R-560 updated: Parts A and B done, Part C waiting on the operator's read of the pilot. STATUS asks for that read, and for the floor to 0.257.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
1313 lines
71 KiB
HTML
1313 lines
71 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html lang="en" class="no-js">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>RomM — Settings — Felhom.eu</title>
|
||
|
||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=0.257.0">
|
||
<link rel="stylesheet" href="/static/style.css?v=0.257.0">
|
||
<meta name="csrf-token" content="94e1e5fec41889e5ee1092e87fe0d3bf75c72923202771e7b3d360a9eacebc9c">
|
||
<script>
|
||
|
||
|
||
document.documentElement.className=document.documentElement.className.replace('no-js','js');
|
||
function csrfHeaders(){var el=document.querySelector('meta[name="csrf-token"]');return el?{'X-CSRF-Token':el.content}:{};}
|
||
|
||
|
||
|
||
|
||
|
||
function felhomConfirm(el,question,onYes){
|
||
if(!el||el.dataset.fcOpen)return;
|
||
el.dataset.fcOpen='1';
|
||
var wrap=document.createElement('span');wrap.className='inline-confirm';
|
||
var q=document.createElement('span');q.className='inline-confirm-q';q.textContent=question;
|
||
var yes=document.createElement('button');yes.type='button';yes.className='btn btn-xs btn-danger';yes.textContent='Yes';
|
||
var no=document.createElement('button');no.type='button';no.className='btn btn-xs btn-outline';no.textContent='Cancel';
|
||
wrap.appendChild(q);wrap.appendChild(yes);wrap.appendChild(no);
|
||
el.style.display='none';el.parentNode.insertBefore(wrap,el.nextSibling);
|
||
function close(){wrap.remove();el.style.display='';delete el.dataset.fcOpen;}
|
||
no.addEventListener('click',close);
|
||
yes.addEventListener('click',function(){close();onYes();});
|
||
}
|
||
document.addEventListener('click',function(e){
|
||
var btn=e.target.closest?e.target.closest('[data-confirm]'):null;
|
||
if(!btn)return;
|
||
e.preventDefault();
|
||
felhomConfirm(btn,btn.getAttribute('data-confirm'),function(){
|
||
var form=btn.closest('form');
|
||
if(form){if(form.requestSubmit)form.requestSubmit(btn);else form.submit();}
|
||
});
|
||
});
|
||
|
||
|
||
document.addEventListener('click',function(e){
|
||
var btn=e.target.closest?e.target.closest('.nav-group-toggle'):null;
|
||
if(!btn)return;
|
||
var group=btn.closest('.nav-group');
|
||
if(!group)return;
|
||
var willOpen=!group.classList.contains('is-open');
|
||
document.querySelectorAll('.nav-group.is-open').forEach(function(g){
|
||
g.classList.remove('is-open');
|
||
var t=g.querySelector('.nav-group-toggle');
|
||
if(t)t.setAttribute('aria-expanded','false');
|
||
});
|
||
if(willOpen){group.classList.add('is-open');btn.setAttribute('aria-expanded','true');}
|
||
});
|
||
function showAlert(msg){var o=document.createElement('div');o.className='modal-overlay';o.id='alert-modal';o.addEventListener('click',function(e){if(e.target===o)o.remove();});var c=document.createElement('div');c.className='modal-card';c.innerHTML='<h3>Message</h3><pre style="white-space:pre-wrap;word-break:break-word;background:var(--bg-2);padding:.75rem;border-radius:.375rem;font-size:.85rem;max-height:60vh;overflow-y:auto;user-select:text;cursor:text">'+msg.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')+'</pre><div class="modal-actions"><button class="btn btn-primary" onclick="document.getElementById(\'alert-modal\').remove()">OK</button></div>';o.appendChild(c);document.body.appendChild(o);}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<svg xmlns="http://www.w3.org/2000/svg" style="display:none" aria-hidden="true">
|
||
<symbol id="i-hard-drive" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 16h.01" /> <path d="M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" /> <path d="M21.946 12.013H2.054" /> <path d="M6 16h.01" /></symbol>
|
||
<symbol id="i-cpu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20v2" /> <path d="M12 2v2" /> <path d="M17 20v2" /> <path d="M17 2v2" /> <path d="M2 12h2" /> <path d="M2 17h2" /> <path d="M2 7h2" /> <path d="M20 12h2" /> <path d="M20 17h2" /> <path d="M20 7h2" /> <path d="M7 20v2" /> <path d="M7 2v2" /> <rect x="4" y="4" width="16" height="16" rx="2" /> <rect x="8" y="8" width="8" height="8" rx="1" /></symbol>
|
||
<symbol id="i-memory-stick" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 12v-2" /> <path d="M12 18v-2" /> <path d="M16 12v-2" /> <path d="M16 18v-2" /> <path d="M2 11h1.5" /> <path d="M20 18v-2" /> <path d="M20.5 11H22" /> <path d="M4 18v-2" /> <path d="M8 12v-2" /> <path d="M8 18v-2" /> <rect x="2" y="6" width="20" height="10" rx="2" /></symbol>
|
||
<symbol id="i-thermometer" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z" /></symbol>
|
||
<symbol id="i-triangle-alert" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /> <path d="M12 9v4" /> <path d="M12 17h.01" /></symbol>
|
||
<symbol id="i-lock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" /></symbol>
|
||
<symbol id="i-cloud" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" /></symbol>
|
||
<symbol id="i-square" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" /></symbol>
|
||
<symbol id="i-rotate-cw" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /></symbol>
|
||
<symbol id="i-file-text" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" /></symbol>
|
||
<symbol id="i-external-link" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6" /> <path d="M10 14 21 3" /> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /></symbol>
|
||
<symbol id="i-shield" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /></symbol>
|
||
<symbol id="i-server" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="2" rx="2" ry="2" /> <rect width="20" height="8" x="2" y="14" rx="2" ry="2" /> <line x1="6" x2="6.01" y1="6" y2="6" /> <line x1="6" x2="6.01" y1="18" y2="18" /></symbol>
|
||
<symbol id="i-share" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3" /> <circle cx="6" cy="12" r="3" /> <circle cx="18" cy="19" r="3" /> <line x1="8.59" x2="15.42" y1="13.51" y2="17.49" /> <line x1="15.41" x2="8.59" y1="6.51" y2="10.49" /></symbol>
|
||
<symbol id="i-layout-grid" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" /></symbol>
|
||
<symbol id="i-rocket" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91 0z" /> <path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z" /> <path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0" /> <path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" /></symbol>
|
||
<symbol id="i-settings" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" /> <circle cx="12" cy="12" r="3" /></symbol>
|
||
<symbol id="i-bell" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.268 21a2 2 0 0 0 3.464 0" /> <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" /></symbol>
|
||
<symbol id="i-x" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18" /> <path d="m6 6 12 12" /></symbol>
|
||
<symbol id="i-check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></symbol>
|
||
<symbol id="i-pencil" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" /> <path d="m15 5 4 4" /></symbol>
|
||
<symbol id="i-info" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /> <path d="M12 16v-4" /> <path d="M12 8h.01" /></symbol>
|
||
<symbol id="i-download" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15V3" /> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /> <path d="m7 10 5 5 5-5" /></symbol>
|
||
<symbol id="i-upload" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12" /> <path d="m17 8-5-5-5 5" /> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /></symbol>
|
||
<symbol id="i-trash-2" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 11v6" /> <path d="M14 11v6" /> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> <path d="M3 6h18" /> <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /></symbol>
|
||
<symbol id="i-wrench" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" /></symbol>
|
||
<symbol id="i-link" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /> <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" /></symbol>
|
||
<symbol id="i-search" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" /></symbol>
|
||
<symbol id="i-plus" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14" /> <path d="M12 5v14" /></symbol>
|
||
<symbol id="i-chevron-down" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6" /></symbol>
|
||
<symbol id="i-play" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" /></symbol>
|
||
<symbol id="i-pause" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="14" y="3" width="5" height="18" rx="1" /> <rect x="5" y="3" width="5" height="18" rx="1" /></symbol>
|
||
<symbol id="i-menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16" /> <path d="M4 6h16" /> <path d="M4 18h16" /></symbol>
|
||
</svg>
|
||
<header class="mobile-topbar">
|
||
<a href="/" class="mobile-topbar-logo"><img src="/static/felhom-logo.svg?v=0.257.0" alt="Felhom.eu"></a>
|
||
<button type="button" class="nav-burger" aria-expanded="false" aria-controls="sidebar" aria-label="Menu">
|
||
<svg class="ico"><use href="#i-menu"/></svg>
|
||
</button>
|
||
</header>
|
||
<div class="nav-backdrop" hidden></div>
|
||
<nav class="sidebar" id="sidebar">
|
||
<div class="sidebar-header">
|
||
<img src="/static/felhom-logo.svg?v=0.257.0" alt="Felhom.eu" class="sidebar-logo">
|
||
</div>
|
||
<ul class="nav-links">
|
||
<li><a href="/launcher" class=""><svg class="ico"><use href="#i-rocket"/></svg>Launcher</a></li>
|
||
<li><a href="/dashboard" class=""><svg class="ico"><use href="#i-layout-grid"/></svg>Dashboard</a></li>
|
||
<li><a href="/stacks" class=""><svg class="ico"><use href="#i-cloud"/></svg>Apps</a></li>
|
||
|
||
<li class="nav-group">
|
||
<button type="button" class="nav-group-toggle" aria-expanded="false" aria-controls="nav-group-storage"><svg class="ico"><use href="#i-hard-drive"/></svg>Storage<svg class="ico nav-chevron"><use href="#i-chevron-down"/></svg></button>
|
||
<ul id="nav-group-storage" class="nav-links nav-links-sub nav-links-nested">
|
||
<li><a href="/storage" class="">Drives</a></li>
|
||
<li><a href="/storage/network" class="">Network storage</a></li>
|
||
</ul>
|
||
</li>
|
||
|
||
<li class="nav-group">
|
||
<button type="button" class="nav-group-toggle" aria-expanded="false" aria-controls="nav-group-backups"><svg class="ico"><use href="#i-shield"/></svg>Backup<svg class="ico nav-chevron"><use href="#i-chevron-down"/></svg></button>
|
||
<ul id="nav-group-backups" class="nav-links nav-links-sub nav-links-nested">
|
||
<li><a href="/backups" class="">Overview</a></li>
|
||
<li><a href="/backups/remote" class="">Remote backup</a></li>
|
||
<li><a href="/backups/apps" class="">Apps</a></li>
|
||
<li><a href="/backups/restore" class="">Restore</a></li>
|
||
</ul>
|
||
</li>
|
||
|
||
<li class="nav-group">
|
||
<button type="button" class="nav-group-toggle" aria-expanded="false" aria-controls="nav-group-sharing"><svg class="ico"><use href="#i-share"/></svg>Sharing<svg class="ico nav-chevron"><use href="#i-chevron-down"/></svg></button>
|
||
<ul id="nav-group-sharing" class="nav-links nav-links-sub nav-links-nested">
|
||
<li><a href="/sharing" class="">Network sharing</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="/monitoring" class=""><svg class="ico"><use href="#i-cpu"/></svg>System monitor</a></li>
|
||
<li><a href="/debug" class=""><svg class="ico"><use href="#i-wrench"/></svg>Debug</a></li>
|
||
</ul>
|
||
<div class="sidebar-bottom">
|
||
<div class="nav-group-label">Settings</div>
|
||
<ul class="nav-links nav-links-sub">
|
||
<li><a href="/settings" class=""><svg class="ico"><use href="#i-settings"/></svg>System</a></li>
|
||
<li><a href="/settings/notifications" class=""><svg class="ico"><use href="#i-bell"/></svg>Notifications</a></li>
|
||
<li><a href="/settings/security" class=""><svg class="ico"><use href="#i-lock"/></svg>Security and access</a></li>
|
||
</ul>
|
||
<div class="sidebar-footer">
|
||
<span class="version">0.257.0</span><details class="lang-globe">
|
||
<summary class="lang-globe-btn" aria-label="Language" title="Language"><svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10" /><path d="M2 12h20" /><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg></summary>
|
||
<ul class="lang-globe-menu">
|
||
<li><form method="POST" action="/settings/language"><input type="hidden" name="_csrf" value="94e1e5fec41889e5ee1092e87fe0d3bf75c72923202771e7b3d360a9eacebc9c"><input type="hidden" name="back" value="/stacks/romm/deploy"><button type="submit" name="lang" value="hu" lang="hu" class="lang-globe-item">Magyar</button></form></li>
|
||
<li><form method="POST" action="/settings/language"><input type="hidden" name="_csrf" value="94e1e5fec41889e5ee1092e87fe0d3bf75c72923202771e7b3d360a9eacebc9c"><input type="hidden" name="back" value="/stacks/romm/deploy"><button type="submit" name="lang" value="en" lang="en" class="lang-globe-item current" aria-current="true">English</button></form></li>
|
||
</ul>
|
||
</details>
|
||
<a href="/logout" class="logout-link">Sign out ↗</a>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
<main class="content">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="page-header">
|
||
<div style="display:flex;align-items:center;gap:.5rem">
|
||
<a href="/stacks" class="btn btn-sm btn-outline">← Back</a>
|
||
<h2>RomM — Settings</h2>
|
||
</div>
|
||
<div style="display:flex;align-items:center;gap:.5rem">
|
||
|
||
|
||
<button class="btn btn-sm btn-warning" onclick="stackAction(event, 'romm', 'restart')">Restart</button>
|
||
<button class="btn btn-sm btn-danger" onclick="stackAction(event, 'romm', 'stop')">Stop</button>
|
||
|
||
|
||
<a href="https://jatek.enkisfelhom.hu" target="_blank" class="btn btn-sm btn-outline">Open ↗</a>
|
||
|
||
|
||
<a href="/apps/romm" class="btn btn-sm btn-outline"><svg class="ico ico-sm"><use href="#i-info"/></svg> Details</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="deploy-container">
|
||
|
||
|
||
<div class="deploy-info">
|
||
<img class="deploy-logo" src="/static/assets/romm-logo.svg" alt="" data-fallback="/static/app-placeholder.svg"
|
||
onerror="if(!this.dataset.step){this.dataset.step='1';this.src='\/static\/assets\/romm-logo.png';}else if(this.dataset.fallback&&this.dataset.step==='1'){this.dataset.step='2';this.src=this.dataset.fallback;}else{this.onerror=null;this.style.visibility='hidden';}">
|
||
<div>
|
||
<h3>RomM</h3>
|
||
<p>Retro game collection manager</p>
|
||
<div class="metarows">
|
||
<span class="metarow"><svg class="ico"><use href="#i-memory-stick"/></svg><span class="mono">~300M</span></span>
|
||
|
||
<span class="metarow"><svg class="ico"><use href="#i-hard-drive"/></svg>Needs a hard drive</span>
|
||
|
||
</div>
|
||
<a href="/apps/romm" class="btn btn-sm btn-outline" style="margin-top:0.5rem">
|
||
Full description, screenshots
|
||
</a>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="alert alert-info">
|
||
This app is already installed. The settings below are read-only.
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
<div class="deploy-cross-drive">
|
||
<h4>Backup</h4>
|
||
|
||
<div class="cross-drive-nightly">
|
||
<span class="form-hint" style="display:block;margin-top:.25rem">
|
||
The app’s database and Docker volumes go into the nightly backup automatically.
|
||
<a href="/backups" style="color:var(--blue)">Backup status →</a> · <a href="/stacks/romm/backup" style="color:var(--blue)">Backup settings →</a>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="app-optional-config">
|
||
<h3>Optional settings</h3>
|
||
|
||
<div class="config-group">
|
||
<h4>Metadata providers</h4>
|
||
<p class="config-group-desc">So that cover art, descriptions and ratings download themselves. IGDB is the one worth setting up first. All of them are free after you sign up.</p>
|
||
|
||
<div class="config-fields">
|
||
|
||
<div class="config-field">
|
||
<label for="opt-IGDB_CLIENT_ID">IGDB Client ID</label>
|
||
<p class="config-field-help">1) Sign up or sign in on the Twitch developer portal (dev.twitch.tv). 2) Create a new application (any name will do). 3) Copy the Client ID across.</p>
|
||
<p class="config-field-help"><a href="https://api-docs.igdb.com/#getting-started" target="_blank">Sign-up guide ↗</a></p>
|
||
<input type="text"
|
||
id="opt-IGDB_CLIENT_ID"
|
||
name="IGDB_CLIENT_ID"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="IGDB Client ID"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
<div class="config-field">
|
||
<label for="opt-IGDB_CLIENT_SECRET">IGDB Client Secret</label>
|
||
<p class="config-field-help">The Client Secret of your Twitch application (the "New Secret" button makes one).</p>
|
||
|
||
<input type="password"
|
||
id="opt-IGDB_CLIENT_SECRET"
|
||
name="IGDB_CLIENT_SECRET"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="IGDB Client Secret"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
<div class="config-field">
|
||
<label for="opt-STEAMGRIDDB_API_KEY">SteamGridDB API Key</label>
|
||
<p class="config-field-help">Sign up on SteamGridDB, then select the "Generate API key" button under Preferences -> API.</p>
|
||
<p class="config-field-help"><a href="https://www.steamgriddb.com/profile/preferences/api" target="_blank">Sign-up guide ↗</a></p>
|
||
<input type="text"
|
||
id="opt-STEAMGRIDDB_API_KEY"
|
||
name="STEAMGRIDDB_API_KEY"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="SteamGridDB API Key"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
<div class="config-field">
|
||
<label for="opt-SCREENSCRAPER_USER">ScreenScraper user name</label>
|
||
<p class="config-field-help">Sign up on screenscraper.fr. Your account name is the API user name.</p>
|
||
<p class="config-field-help"><a href="https://www.screenscraper.fr/" target="_blank">Sign-up guide ↗</a></p>
|
||
<input type="text"
|
||
id="opt-SCREENSCRAPER_USER"
|
||
name="SCREENSCRAPER_USER"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="ScreenScraper user name"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
<div class="config-field">
|
||
<label for="opt-SCREENSCRAPER_PASSWORD">ScreenScraper password</label>
|
||
<p class="config-field-help">The password of your screenscraper.fr account.</p>
|
||
|
||
<input type="password"
|
||
id="opt-SCREENSCRAPER_PASSWORD"
|
||
name="SCREENSCRAPER_PASSWORD"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="ScreenScraper password"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
<div class="config-field">
|
||
<label for="opt-MOBYGAMES_API_KEY">MobyGames API Key</label>
|
||
<p class="config-field-help">Sign up on MobyGames, then ask for a key on the API page. It gives detailed game information and credits.</p>
|
||
<p class="config-field-help"><a href="https://www.mobygames.com/info/api/" target="_blank">Sign-up guide ↗</a></p>
|
||
<input type="text"
|
||
id="opt-MOBYGAMES_API_KEY"
|
||
name="MOBYGAMES_API_KEY"
|
||
class="config-input"
|
||
value=""
|
||
placeholder="MobyGames API Key"
|
||
autocomplete="off">
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="config-actions">
|
||
<button class="btn btn-primary" id="save-optional-config" onclick="saveOptionalConfig('romm')">
|
||
Save
|
||
</button>
|
||
<span id="config-save-status" class="config-save-status"></span>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
async function saveOptionalConfig(stackName) {
|
||
var btn = document.getElementById('save-optional-config');
|
||
var status = document.getElementById('config-save-status');
|
||
var inputs = document.querySelectorAll('.config-input');
|
||
|
||
var values = {};
|
||
inputs.forEach(function(input) {
|
||
values[input.name] = input.value;
|
||
});
|
||
|
||
btn.disabled = true;
|
||
btn.textContent = 'Saving...';
|
||
status.textContent = '';
|
||
status.className = 'config-save-status';
|
||
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + stackName + '/optional-config', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()),
|
||
body: JSON.stringify({values: values})
|
||
});
|
||
var data = await resp.json();
|
||
|
||
if (data.ok) {
|
||
status.textContent = (data.message || 'Saved');
|
||
status.className = 'config-save-status config-save-ok';
|
||
} else {
|
||
status.textContent = (data.error || 'Error');
|
||
status.className = 'config-save-status config-save-err';
|
||
}
|
||
} catch(err) {
|
||
status.textContent = 'Network error';
|
||
status.className = 'config-save-status config-save-err';
|
||
}
|
||
|
||
btn.disabled = false;
|
||
btn.textContent = 'Save';
|
||
|
||
setTimeout(function() { status.textContent = ''; }, 5000);
|
||
}
|
||
</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<form id="deploy-form" class="deploy-form">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="form-section">
|
||
<h4>Automatically generated values</h4>
|
||
|
||
<p class="form-section-desc">These values were created automatically at install.</p>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="form-group form-group-auto">
|
||
<label>Domain </label>
|
||
|
||
|
||
<input type="text" id="auto-field-DOMAIN" class="form-control" value="enkisfelhom.hu" readonly>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-group form-group-auto">
|
||
<label>Database password <span class="auto-generated-badge"><svg class="ico ico-sm"><use href="#i-check"/></svg> Generated automatically</span></label>
|
||
|
||
|
||
|
||
|
||
<div class="input-with-button">
|
||
<input type="password" id="auto-field-DB_PASSWORD" class="form-control" value="" placeholder="••••••••••••" readonly>
|
||
<button type="button" class="btn btn-sm btn-outline" onclick="revealAutoField('romm','DB_PASSWORD', this)">Show</button>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-group form-group-auto">
|
||
<label>MariaDB root password <span class="auto-generated-badge"><svg class="ico ico-sm"><use href="#i-check"/></svg> Generated automatically</span></label>
|
||
|
||
|
||
|
||
|
||
<div class="input-with-button">
|
||
<input type="password" id="auto-field-MYSQL_ROOT_PASSWORD" class="form-control" value="" placeholder="••••••••••••" readonly>
|
||
<button type="button" class="btn btn-sm btn-outline" onclick="revealAutoField('romm','MYSQL_ROOT_PASSWORD', this)">Show</button>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-group form-group-auto">
|
||
<label>Sign-in encryption key <span class="auto-generated-badge"><svg class="ico ico-sm"><use href="#i-check"/></svg> Generated automatically</span></label>
|
||
|
||
|
||
|
||
|
||
<div class="input-with-button">
|
||
<input type="password" id="auto-field-ROMM_AUTH_SECRET_KEY" class="form-control" value="" placeholder="••••••••••••" readonly>
|
||
<button type="button" class="btn btn-sm btn-outline" onclick="revealAutoField('romm','ROMM_AUTH_SECRET_KEY', this)">Show</button>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div class="form-section">
|
||
<h4>Settings</h4>
|
||
|
||
<div class="form-group">
|
||
<label for="field-SUBDOMAIN">
|
||
Subdomain
|
||
<span class="required">*</span>
|
||
<span class="locked-hint">cannot be changed after install</span>
|
||
</label>
|
||
|
||
|
||
<div class="subdomain-input-group">
|
||
<input type="text" id="field-SUBDOMAIN" name="SUBDOMAIN"
|
||
class="form-control subdomain-input"
|
||
|
||
value="jatek"
|
||
placeholder="subdomain"
|
||
pattern="[a-z0-9]([a-z0-9-]*[a-z0-9])?"
|
||
required
|
||
disabled
|
||
oninput="this.value=this.value.toLowerCase().replace(/[^a-z0-9-]/g,'')">
|
||
<span class="subdomain-suffix">.enkisfelhom.hu</span>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="field-HDD_PATH">
|
||
Data storage path
|
||
<span class="required">*</span>
|
||
<span class="locked-hint">cannot be changed after install</span>
|
||
</label>
|
||
|
||
|
||
|
||
<select id="field-HDD_PATH" name="HDD_PATH" class="form-control"
|
||
disabled
|
||
onchange="checkStorageSpace(this)">
|
||
|
||
<option value="/mnt/felhom-drives/hdd_1" data-free-percent="93"
|
||
|
||
|
||
selected>
|
||
NVME 1TB — 874.9 GB free (default)
|
||
</option>
|
||
|
||
|
||
</select>
|
||
<div id="storage-space-warn" class="form-hint" style="color:var(--warn);display:none">
|
||
<svg class="ico ico-sm"><use href="#i-triangle-alert"/></svg> The chosen storage is almost full.
|
||
</div>
|
||
<div class="form-hint" style="margin-top:.4rem;opacity:.8">
|
||
<svg class="ico ico-sm"><use href="#i-info"/></svg> The chosen drive stores the app’s <strong>files</strong> (media, documents).
|
||
The <strong>database runs on the fast internal SSD</strong> — and it is backed up together with the app.
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<span class="form-hint">The path to the external hard drive where the ROMs and cover art are kept</span>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</form>
|
||
|
||
<div id="deploy-progress" class="deploy-progress" style="display:none">
|
||
<h3>Installing...</h3>
|
||
<div class="deploy-steps">
|
||
<div class="deploy-step active" id="step-config">
|
||
<span class="step-icon"><svg class="ico"><use href="#i-rotate-cw"/></svg></span>
|
||
<span class="step-text">Saving the configuration...</span>
|
||
</div>
|
||
<div class="deploy-step" id="step-containers">
|
||
<span class="step-icon"><svg class="ico"><use href="#i-rotate-cw"/></svg></span>
|
||
<span class="step-text">Starting the container(s)...</span>
|
||
</div>
|
||
<div class="deploy-step" id="step-health">
|
||
<span class="step-icon"><svg class="ico"><use href="#i-rotate-cw"/></svg></span>
|
||
<span class="step-text">Initialising the app...</span>
|
||
</div>
|
||
</div>
|
||
<div id="deploy-warning" class="alert alert-warning" style="display:none"></div>
|
||
<div id="deploy-result" style="display:none"></div>
|
||
<p class="deploy-elapsed" id="deploy-elapsed"></p>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
var postDeployInfo = {
|
||
firstSteps: ["Open arcade.DOMAIN in your browser","Sign in with the default admin / admin account","Change the password straight away, in the Settings menu","Upload the ROM files into the roms/ folder in the File manager (FileBrowser), sorted into platform folders (for example roms/gba/, roms/snes/)","Start a Scan from the menu on the left to read the ROMs in","Optional: set up metadata providers so cover art and descriptions download themselves (see below)"],
|
||
defaultCreds: "admin / admin",
|
||
docsURL: "https://github.com/rommapp/romm/wiki",
|
||
domain: "enkisfelhom.hu",
|
||
displayName: "RomM",
|
||
deployFields: [{"env_var":"DOMAIN","label":"Domain","type":"domain","generate":"","default":"","required":true,"placeholder":"","description":"The server domain name","locked_after_deploy":true},{"env_var":"SUBDOMAIN","label":"Subdomain","type":"subdomain","generate":"","default":"arcade","required":true,"placeholder":"","description":"The subdomain this app answers on","locked_after_deploy":true},{"env_var":"DB_PASSWORD","label":"Database password","type":"secret","generate":"password:24","default":"","required":false,"placeholder":"","description":"","locked_after_deploy":true},{"env_var":"MYSQL_ROOT_PASSWORD","label":"MariaDB root password","type":"secret","generate":"password:24","default":"","required":false,"placeholder":"","description":"","locked_after_deploy":true},{"env_var":"ROMM_AUTH_SECRET_KEY","label":"Sign-in encryption key","type":"secret","generate":"hex:32","default":"","required":false,"placeholder":"","description":"","locked_after_deploy":true},{"env_var":"HDD_PATH","label":"Data storage path","type":"path","generate":"","default":"","required":true,"placeholder":"/mnt/felhom-drives/hdd_1","description":"The path to the external hard drive where the ROMs and cover art are kept","locked_after_deploy":true}]
|
||
};
|
||
|
||
function buildPostDeployCard(stackName) {
|
||
var subdomain = '';
|
||
var sdField = document.getElementById('field-SUBDOMAIN');
|
||
if (sdField) subdomain = sdField.value.trim();
|
||
if (!subdomain && 'arcade') subdomain = 'arcade';
|
||
|
||
var html = '';
|
||
|
||
|
||
if (subdomain && postDeployInfo.domain) {
|
||
var appURL = 'https://' + subdomain + '.' + postDeployInfo.domain;
|
||
html += '<div style="text-align:center;margin:1.5rem 0">' +
|
||
'<a href="' + appURL + '" target="_blank" class="btn btn-primary btn-lg">Open the app ↗</a>' +
|
||
'</div>';
|
||
}
|
||
|
||
|
||
if (postDeployInfo.firstSteps && postDeployInfo.firstSteps.length > 0) {
|
||
html += '<div class="app-info-card" style="margin-top:1rem"><h4>First steps</h4><ol class="app-info-list">';
|
||
for (var i = 0; i < postDeployInfo.firstSteps.length; i++) {
|
||
var step = postDeployInfo.firstSteps[i].replace(/DOMAIN/g, postDeployInfo.domain);
|
||
html += '<li>' + step + '</li>';
|
||
}
|
||
html += '</ol></div>';
|
||
}
|
||
|
||
|
||
var credRows = '';
|
||
var hasUserCredFields = false;
|
||
if (postDeployInfo.deployFields) {
|
||
for (var i = 0; i < postDeployInfo.deployFields.length; i++) {
|
||
var f = postDeployInfo.deployFields[i];
|
||
|
||
var isPassword = f.type === 'secret' || f.type === 'password';
|
||
var isUsername = false;
|
||
if (!isPassword && f.type === 'text') {
|
||
var ev = f.env_var.toUpperCase();
|
||
isUsername = ev.indexOf('USER') >= 0 || ev.indexOf('ADMIN') >= 0 || ev.indexOf('LOGIN') >= 0 || ev.indexOf('EMAIL') >= 0;
|
||
}
|
||
if (!isPassword && !isUsername) continue;
|
||
|
||
var evUp = f.env_var.toUpperCase();
|
||
if (evUp.indexOf('DB_PASSWORD') >= 0 || evUp.indexOf('MYSQL_ROOT') >= 0 || evUp.indexOf('SECRET_KEY') >= 0) continue;
|
||
if (isPassword || isUsername) hasUserCredFields = true;
|
||
|
||
var el = document.getElementById('auto-field-' + f.env_var) || document.getElementById('field-' + f.env_var);
|
||
var val = el ? el.value : '';
|
||
if (!val) continue;
|
||
if (isPassword) {
|
||
var credId = 'postdeploy-cred-' + i;
|
||
credRows += '<tr><td style="padding:.25rem .75rem .25rem 0;color:var(--text-3);white-space:nowrap">' + f.label + '</td>' +
|
||
'<td style="padding:.25rem 0;display:flex;align-items:center;gap:.5rem">' +
|
||
'<code id="' + credId + '" style="font-family:var(--font-data);letter-spacing:1px">••••••••••••</code>' +
|
||
'<button type="button" class="btn btn-sm btn-outline" onclick="togglePostDeployCred(this,\'' + credId + '\',\'' + val.replace(/'/g, "\\'") + '\')" style="padding:.15rem .4rem;font-size:.75rem">Show</button>' +
|
||
'<button type="button" class="btn btn-sm btn-outline" onclick="copyPostDeployCred(this,\'' + val.replace(/'/g, "\\'") + '\')" style="padding:.15rem .4rem;font-size:.75rem">Copy</button>' +
|
||
'</td></tr>';
|
||
} else {
|
||
credRows += '<tr><td style="padding:.25rem .75rem .25rem 0;color:var(--text-3);white-space:nowrap">' + f.label + '</td>' +
|
||
'<td style="padding:.25rem 0;font-family:var(--font-data);user-select:all">' + val + '</td></tr>';
|
||
}
|
||
}
|
||
}
|
||
if (credRows) {
|
||
html += '<div class="app-info-card" style="margin-top:1rem"><h4>Sign-in</h4>' +
|
||
'<table style="margin:.5rem 0">' + credRows + '</table></div>';
|
||
} else if (postDeployInfo.defaultCreds) {
|
||
var creds = postDeployInfo.defaultCreds.replace(/DOMAIN/g, postDeployInfo.domain);
|
||
html += '<div class="app-info-card" style="margin-top:1rem"><h4>Sign-in</h4>' +
|
||
'<p class="app-info-creds">' + creds + '</p></div>';
|
||
}
|
||
|
||
|
||
if (postDeployInfo.docsURL) {
|
||
html += '<div style="margin-top:1rem"><a href="' + postDeployInfo.docsURL + '" target="_blank" class="btn btn-sm btn-outline">Documentation ↗</a></div>';
|
||
}
|
||
|
||
|
||
html += '<div style="display:flex;gap:.75rem;margin-top:1.5rem;flex-wrap:wrap">' +
|
||
'<a href="/stacks/' + stackName + '/deploy" class="btn btn-outline">View settings and passwords</a>' +
|
||
'<a href="/stacks" class="btn btn-sm btn-outline">← Apps</a>' +
|
||
'</div>';
|
||
|
||
return html;
|
||
}
|
||
|
||
function checkStorageSpace(sel) {
|
||
var opt = sel.options[sel.selectedIndex];
|
||
var warn = document.getElementById('storage-space-warn');
|
||
if (!warn) return;
|
||
var freePct = parseFloat(opt.getAttribute('data-free-percent') || '100');
|
||
warn.style.display = freePct < 20 ? 'block' : 'none';
|
||
}
|
||
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
var sel = document.querySelector('select[onchange="checkStorageSpace(this)"]');
|
||
if (sel) checkStorageSpace(sel);
|
||
});
|
||
|
||
|
||
|
||
function revealAutoField(stackName, envVar, btn) {
|
||
var el = document.getElementById('auto-field-' + envVar);
|
||
if (!el) return;
|
||
if (btn.dataset.shown === '1') {
|
||
el.value = '';
|
||
el.type = 'password';
|
||
btn.dataset.shown = '';
|
||
btn.textContent = 'Show';
|
||
return;
|
||
}
|
||
btn.disabled = true;
|
||
fetch('/stacks/' + encodeURIComponent(stackName) + '/auto-field/reveal', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/x-www-form-urlencoded'}, csrfHeaders()),
|
||
credentials: 'same-origin',
|
||
body: 'env_var=' + encodeURIComponent(envVar)
|
||
}).then(function (r) { return r.json(); }).then(function (j) {
|
||
btn.disabled = false;
|
||
if (!j.ok) { showAlert(j.error || 'The request failed.'); return; }
|
||
el.value = j.data.value;
|
||
el.type = 'text';
|
||
btn.dataset.shown = '1';
|
||
btn.textContent = 'Hide';
|
||
}).catch(function () { btn.disabled = false; showAlert('The request failed.'); });
|
||
}
|
||
function toggleAutoField(fieldId, btn) {
|
||
var el = document.getElementById(fieldId);
|
||
if (!el) return;
|
||
el.type = el.type === 'password' ? 'text' : 'password';
|
||
btn.textContent = el.type === 'password' ? 'Show' : 'Hide';
|
||
}
|
||
function generatePassword(fieldId, confirmFieldId) {
|
||
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||
let pass = '';
|
||
const arr = new Uint8Array(16);
|
||
crypto.getRandomValues(arr);
|
||
for (let i = 0; i < 16; i++) {
|
||
pass += chars[arr[i] % chars.length];
|
||
}
|
||
document.getElementById(fieldId).value = pass;
|
||
if (confirmFieldId) {
|
||
var ce = document.getElementById(confirmFieldId);
|
||
if (ce) ce.value = pass;
|
||
}
|
||
}
|
||
function togglePasswordField(fieldId, confirmFieldId, btn) {
|
||
var el = document.getElementById(fieldId);
|
||
if (!el) return;
|
||
var newType = el.type === 'password' ? 'text' : 'password';
|
||
el.type = newType;
|
||
var ce = document.getElementById(confirmFieldId);
|
||
if (ce) ce.type = newType;
|
||
btn.title = newType === 'password' ? 'Show' : 'Hide';
|
||
}
|
||
|
||
function togglePostDeployCred(btn, credId, val) {
|
||
var el = document.getElementById(credId);
|
||
if (!el) return;
|
||
if (el.textContent === val) {
|
||
el.textContent = '••••••••••••';
|
||
btn.textContent = 'Show';
|
||
} else {
|
||
el.textContent = val;
|
||
btn.textContent = 'Hide';
|
||
}
|
||
}
|
||
function copyPostDeployCred(btn, val) {
|
||
if (navigator.clipboard) {
|
||
navigator.clipboard.writeText(val).then(function() {
|
||
var orig = btn.textContent;
|
||
btn.textContent = 'Copied!';
|
||
setTimeout(function() { btn.textContent = orig; }, 1500);
|
||
});
|
||
}
|
||
}
|
||
|
||
function deleteStaleData(stackName, stalePath, btn) {
|
||
|
||
felhomConfirm(btn, 'Delete the earlier data? Storage: ' + stalePath + ' — WARNING: this cannot be undone! First make sure the app works properly from the new storage.', function () {
|
||
felhomConfirm(btn, 'LAST WARNING! The deletion cannot be undone. Continue?', function () {
|
||
deleteStaleDataRun(stackName, stalePath, btn);
|
||
});
|
||
});
|
||
}
|
||
|
||
function deleteStaleDataRun(stackName, stalePath, btn) {
|
||
btn.disabled = true;
|
||
btn.textContent = 'Deleting...';
|
||
|
||
fetch('/api/storage/stale-cleanup', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()),
|
||
body: JSON.stringify({stack_name: stackName, stale_path: stalePath})
|
||
})
|
||
.then(function(r) { return r.json(); })
|
||
.then(function(data) {
|
||
if (!data.ok) {
|
||
showAlert('Error: ' + (data.error || 'Unknown error'));
|
||
btn.disabled = false;
|
||
btn.textContent = 'Delete earlier data';
|
||
return;
|
||
}
|
||
var msg = 'Earlier data deleted!\n\nSpace freed: ' + (data.freed_human || '?');
|
||
if (data.errors && data.errors.length > 0) {
|
||
msg += '\n\nSome errors occurred:\n' + data.errors.join('\n');
|
||
}
|
||
showAlert(msg);
|
||
|
||
var item = btn.closest('.stale-data-item');
|
||
if (item) item.remove();
|
||
|
||
var container = document.querySelector('.deploy-stale-data');
|
||
if (container && container.querySelectorAll('.stale-data-item').length === 0) {
|
||
container.remove();
|
||
}
|
||
})
|
||
.catch(function(e) {
|
||
showAlert('Network error: ' + e.message);
|
||
btn.disabled = false;
|
||
btn.textContent = 'Delete earlier data';
|
||
});
|
||
}
|
||
|
||
document.getElementById('deploy-form').addEventListener('submit', async function(e) {
|
||
e.preventDefault();
|
||
|
||
|
||
const passwordFields = e.target.querySelectorAll('input[data-field-type="password"]');
|
||
for (const pf of passwordFields) {
|
||
if (!pf.disabled && pf.value.trim() === '') {
|
||
const label = pf.closest('.form-group').querySelector('label').textContent.trim();
|
||
showAlert('Required field: ' + label + '\nUse the Generate button or type a password.');
|
||
pf.focus();
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
const confirmInputs = e.target.querySelectorAll('input[data-confirm-for]');
|
||
for (const ci of confirmInputs) {
|
||
const mainEl = document.getElementById(ci.getAttribute('data-confirm-for'));
|
||
if (mainEl && !mainEl.disabled && ci.value !== mainEl.value) {
|
||
const label = mainEl.closest('.form-group').querySelector('label').textContent.trim();
|
||
showAlert('The two passwords do not match: ' + label);
|
||
ci.focus();
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
const subdomainField = e.target.querySelector('.subdomain-input');
|
||
if (subdomainField && !subdomainField.disabled) {
|
||
const sd = subdomainField.value.trim().toLowerCase();
|
||
if (!sd || !/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(sd)) {
|
||
showAlert('The subdomain may contain only lowercase letters, digits and hyphens, and cannot start or end with a hyphen.');
|
||
subdomainField.focus();
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
const requiredFields = e.target.querySelectorAll('input[required], select[required]');
|
||
for (const rf of requiredFields) {
|
||
if (!rf.disabled && rf.value.trim() === '') {
|
||
const label = rf.closest('.form-group').querySelector('label').textContent.trim();
|
||
showAlert('Required field: ' + label);
|
||
rf.focus();
|
||
return;
|
||
}
|
||
}
|
||
|
||
const btn = e.target.querySelector('[type=submit]');
|
||
btn.disabled = true;
|
||
btn.textContent = 'Installing...';
|
||
|
||
const values = {};
|
||
const inputs = e.target.querySelectorAll('input, select');
|
||
inputs.forEach(function(el) {
|
||
if (el.name && !el.disabled) {
|
||
if (el.type === 'checkbox') {
|
||
values[el.name] = el.checked ? 'true' : 'false';
|
||
} else {
|
||
values[el.name] = el.value;
|
||
}
|
||
}
|
||
});
|
||
|
||
var stackName = 'romm';
|
||
var progressEl = document.getElementById('deploy-progress');
|
||
var formEl = document.getElementById('deploy-form');
|
||
var stepConfig = document.getElementById('step-config');
|
||
var stepContainers = document.getElementById('step-containers');
|
||
var stepHealth = document.getElementById('step-health');
|
||
var warningEl = document.getElementById('deploy-warning');
|
||
var resultEl = document.getElementById('deploy-result');
|
||
var elapsedEl = document.getElementById('deploy-elapsed');
|
||
|
||
function setStep(el, status, text) {
|
||
el.className = 'deploy-step ' + status;
|
||
if (text) el.querySelector('.step-text').textContent = text;
|
||
var icon = el.querySelector('.step-icon');
|
||
if (status === 'done') icon.innerHTML = '<svg class="ico"><use href="#i-check"/></svg>';
|
||
else if (status === 'error') icon.innerHTML = '<svg class="ico"><use href="#i-x"/></svg>';
|
||
else if (status === 'warn') icon.innerHTML = '<svg class="ico"><use href="#i-triangle-alert"/></svg>';
|
||
else if (status === 'active') icon.innerHTML = '<svg class="ico ico-spin"><use href="#i-rotate-cw"/></svg>';
|
||
}
|
||
|
||
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + stackName + '/deploy', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()),
|
||
body: JSON.stringify({values: values})
|
||
});
|
||
var data = await resp.json();
|
||
if (!data.ok) {
|
||
showAlert('Error: ' + data.error);
|
||
btn.textContent = 'Start install';
|
||
btn.disabled = false;
|
||
return;
|
||
}
|
||
|
||
|
||
formEl.style.display = 'none';
|
||
progressEl.style.display = 'block';
|
||
setStep(stepConfig, 'done', 'Configuration saved');
|
||
setStep(stepContainers, 'active', 'Starting the container(s)...');
|
||
|
||
if (data.data && data.data.warning) {
|
||
warningEl.textContent = data.data.warning;
|
||
warningEl.style.display = 'block';
|
||
}
|
||
|
||
|
||
var startTime = Date.now();
|
||
var pollTimeout = 120000;
|
||
var pollTimer = setInterval(async function() {
|
||
var elapsed = Math.round((Date.now() - startTime) / 1000);
|
||
elapsedEl.textContent = elapsed + ' seconds ago...';
|
||
|
||
if (Date.now() - startTime > pollTimeout) {
|
||
clearInterval(pollTimer);
|
||
setStep(stepHealth, 'warn', 'Timed out — the app may still be starting');
|
||
resultEl.innerHTML = '<div class="alert alert-warning" style="margin-top:1rem">' +
|
||
'The install timed out. The app may still be starting.' +
|
||
'</div>' + buildPostDeployCard(stackName);
|
||
resultEl.style.display = 'block';
|
||
return;
|
||
}
|
||
|
||
try {
|
||
var sr = await fetch('/api/stacks/' + stackName);
|
||
var sd = await sr.json();
|
||
if (!sd.ok || !sd.data) return;
|
||
var state = sd.data.state;
|
||
var deployError = sd.data.deploy_error;
|
||
|
||
if (deployError) {
|
||
|
||
clearInterval(pollTimer);
|
||
setStep(stepContainers, 'error', 'Install failed');
|
||
setStep(stepHealth, 'error');
|
||
progressEl.querySelector('h3').textContent = 'Install failed';
|
||
resultEl.innerHTML = '<div class="alert alert-error" style="margin-top:1rem">' +
|
||
'The install failed: ' + deployError +
|
||
'</div><a href="/stacks/' + stackName + '/logs" class="btn btn-outline" style="margin-top:.75rem">View logs</a>' +
|
||
' <a href="/stacks" class="btn btn-primary" style="margin-top:.75rem">Apps</a>';
|
||
resultEl.style.display = 'block';
|
||
} else if (state === 'deploying') {
|
||
|
||
setStep(stepContainers, 'active', 'Downloading images, starting containers...');
|
||
} else if (state === 'running') {
|
||
clearInterval(pollTimer);
|
||
setStep(stepContainers, 'done', 'Containers started');
|
||
setStep(stepHealth, 'done', 'App ready!');
|
||
progressEl.querySelector('h3').textContent = 'Install succeeded!';
|
||
resultEl.innerHTML = '<div class="alert alert-info" style="margin-top:1rem">' +
|
||
'The app is installed and running!' +
|
||
'</div>' + buildPostDeployCard(stackName);
|
||
resultEl.style.display = 'block';
|
||
} else if (state === 'starting') {
|
||
setStep(stepContainers, 'done', 'Containers started');
|
||
setStep(stepHealth, 'active', 'Initialising the app...');
|
||
} else if (state === 'unhealthy') {
|
||
clearInterval(pollTimer);
|
||
setStep(stepContainers, 'done', 'Containers started');
|
||
setStep(stepHealth, 'warn', 'Health check: still initialising');
|
||
progressEl.querySelector('h3').textContent = 'Install succeeded!';
|
||
resultEl.innerHTML = '<div class="alert alert-warning" style="margin-top:1rem">' +
|
||
'The app started, but it is still initialising. ' +
|
||
'This is normal in the first minutes — the app may already be reachable.' +
|
||
'</div>' + buildPostDeployCard(stackName);
|
||
resultEl.style.display = 'block';
|
||
} else if (state === 'exited' || state === 'stopped') {
|
||
clearInterval(pollTimer);
|
||
setStep(stepContainers, 'error', 'The container stopped');
|
||
setStep(stepHealth, 'error');
|
||
progressEl.querySelector('h3').textContent = 'Install failed';
|
||
resultEl.innerHTML = '<div class="alert alert-error" style="margin-top:1rem">' +
|
||
'The container stopped. Check the logs.' +
|
||
'</div><a href="/stacks/' + stackName + '/logs" class="btn btn-outline" style="margin-top:.75rem">View logs</a>' +
|
||
' <a href="/stacks" class="btn btn-primary" style="margin-top:.75rem">Apps</a>';
|
||
resultEl.style.display = 'block';
|
||
}
|
||
} catch(pollErr) {}
|
||
}, 3000);
|
||
|
||
} catch (err) {
|
||
showAlert('Network error: ' + err.message);
|
||
btn.textContent = 'Start install';
|
||
btn.disabled = false;
|
||
}
|
||
});
|
||
</script>
|
||
|
||
|
||
</main>
|
||
<script>
|
||
|
||
|
||
|
||
(function(){
|
||
var burger=document.querySelector('.nav-burger');
|
||
var sidebar=document.getElementById('sidebar');
|
||
var backdrop=document.querySelector('.nav-backdrop');
|
||
if(!burger||!sidebar||!backdrop)return;
|
||
function setOpen(open){
|
||
sidebar.classList.toggle('is-open',open);
|
||
document.body.classList.toggle('nav-open',open);
|
||
backdrop.hidden=!open;
|
||
burger.setAttribute('aria-expanded',open?'true':'false');
|
||
}
|
||
burger.addEventListener('click',function(){setOpen(!sidebar.classList.contains('is-open'));});
|
||
backdrop.addEventListener('click',function(){setOpen(false);});
|
||
document.addEventListener('keydown',function(e){
|
||
if(e.key==='Escape'&&sidebar.classList.contains('is-open'))setOpen(false);
|
||
});
|
||
})();
|
||
document.addEventListener('click', function(e) {
|
||
if (e.target.closest('a, button, .btn, input, select, textarea, .app-row-actions, .stack-detail-actions')) return;
|
||
var card = e.target.closest('[data-href]');
|
||
if (card) window.location.href = card.dataset.href;
|
||
});
|
||
async function checkBeforeDeploy(e, name) {
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + name);
|
||
var data = await resp.json();
|
||
if (data.ok && data.data && data.data.deployed) {
|
||
e.preventDefault();
|
||
showAlert('This app is already installed.');
|
||
window.location.reload();
|
||
return false;
|
||
}
|
||
} catch(err) {}
|
||
return true;
|
||
}
|
||
async function syncTemplates() {
|
||
const btn = document.getElementById('sync-btn');
|
||
const toast = document.getElementById('sync-toast');
|
||
if (!btn) return;
|
||
const origText = btn.innerHTML;
|
||
btn.disabled = true;
|
||
btn.innerHTML = '↻ Refreshing...';
|
||
btn.classList.add('loading');
|
||
try {
|
||
const resp = await fetch('/api/sync', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders())
|
||
});
|
||
const data = await resp.json();
|
||
if (toast) {
|
||
toast.textContent = data.ok ? (data.message || 'Templates refreshed') : ('Error: ' + (data.error || 'Unknown error'));
|
||
toast.className = 'sync-toast ' + (data.ok ? 'sync-toast-ok' : 'sync-toast-err');
|
||
toast.style.display = 'block';
|
||
setTimeout(function() { toast.style.display = 'none'; }, 5000);
|
||
}
|
||
if (data.ok && data.data && (data.data.new_apps && data.data.new_apps.length > 0 || data.data.updated && data.data.updated.length > 0)) {
|
||
setTimeout(function() { window.location.reload(); }, 1500);
|
||
}
|
||
} catch (err) {
|
||
if (toast) {
|
||
toast.textContent = 'Network error: ' + err.message;
|
||
toast.className = 'sync-toast sync-toast-err';
|
||
toast.style.display = 'block';
|
||
setTimeout(function() { toast.style.display = 'none'; }, 5000);
|
||
}
|
||
}
|
||
btn.innerHTML = origText;
|
||
btn.disabled = false;
|
||
btn.classList.remove('loading');
|
||
}
|
||
async function stackAction(event, name, action) {
|
||
const btn = event.currentTarget;
|
||
const origText = btn.textContent;
|
||
btn.disabled = true;
|
||
btn.textContent = 'In progress...';
|
||
btn.classList.add('loading');
|
||
try {
|
||
const resp = await fetch('/api/stacks/' + name + '/' + action, {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders())
|
||
});
|
||
const data = await resp.json();
|
||
if (!data.ok) {
|
||
showAlert('Error: ' + (data.error || 'Unknown error'));
|
||
btn.textContent = origText;
|
||
btn.disabled = false;
|
||
btn.classList.remove('loading');
|
||
return;
|
||
}
|
||
|
||
|
||
|
||
if (action === 'update') {
|
||
followUpdate(name, btn);
|
||
return;
|
||
}
|
||
window.location.reload();
|
||
} catch (err) {
|
||
showAlert('Network error: ' + err.message);
|
||
btn.textContent = origText;
|
||
btn.disabled = false;
|
||
btn.classList.remove('loading');
|
||
}
|
||
}
|
||
function followUpdate(name, btn) {
|
||
var started = Date.now();
|
||
var timer = setInterval(async function() {
|
||
if (Date.now() - started > 30 * 60 * 1000) { clearInterval(timer); window.location.reload(); return; }
|
||
try {
|
||
var r = await fetch('/api/stacks/' + name);
|
||
var d = await r.json();
|
||
if (!d.ok || !d.data) return;
|
||
if (d.data.update_phase_label) btn.textContent = d.data.update_phase_label;
|
||
if (!d.data.updating) { clearInterval(timer); window.location.reload(); }
|
||
} catch (e) {}
|
||
}, 3000);
|
||
}
|
||
async function deleteOrphanStack(name) {
|
||
var modal = document.createElement('div');
|
||
modal.className = 'modal-overlay';
|
||
modal.id = 'delete-modal';
|
||
modal.innerHTML = '<div class="modal-card"><h3>Loading...</h3></div>';
|
||
modal.addEventListener('click', function(e) { if (e.target === modal) closeDeleteModal(); });
|
||
document.body.appendChild(modal);
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + name + '/hdd-data');
|
||
var data = await resp.json();
|
||
var hddInfo = '';
|
||
var checkboxHTML = '';
|
||
if (data.ok && data.data && data.data.has_hdd_data) {
|
||
hddInfo = '<div class="modal-hdd-info"><strong>Your data on the hard drive:</strong>';
|
||
data.data.hdd_paths.forEach(function(p) {
|
||
hddInfo += '<div class="modal-hdd-path">' + p.path + ' (' + (p.exists ? p.size_human : 'does not exist') + ')</div>';
|
||
});
|
||
hddInfo += '</div>';
|
||
checkboxHTML = '<label class="modal-checkbox"><input type="checkbox" id="delete-hdd-check"> Delete your data from the hard drive</label>';
|
||
}
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Delete app: ' + name + '</h3>' +
|
||
'<p style="color:var(--text-2);font-size:.9rem;margin-bottom:.75rem">This removes the containers, the volumes and the configuration files.</p>' +
|
||
'<div class="alert alert-warning" style="margin-bottom:.75rem">You cannot undo this!</div>' +
|
||
hddInfo + checkboxHTML +
|
||
'<div class="modal-actions">' +
|
||
'<button class="btn btn-outline" onclick="closeDeleteModal()">Cancel</button>' +
|
||
'<button class="btn btn-danger" id="confirm-delete-btn" onclick="confirmDelete(\'' + name + '\')">Delete</button>' +
|
||
'</div>';
|
||
} catch (err) {
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Error</h3><p style="color:var(--text-2)">Could not load the details: ' + err.message + '</p>' +
|
||
'<div class="modal-actions"><button class="btn btn-outline" onclick="closeDeleteModal()">Close</button></div>';
|
||
}
|
||
}
|
||
function closeDeleteModal() {
|
||
var modal = document.getElementById('delete-modal');
|
||
if (modal) modal.remove();
|
||
}
|
||
async function confirmDelete(name) {
|
||
var btn = document.getElementById('confirm-delete-btn');
|
||
var checkbox = document.getElementById('delete-hdd-check');
|
||
var removeHDD = checkbox ? checkbox.checked : false;
|
||
btn.disabled = true;
|
||
btn.textContent = 'Deleting...';
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + name, {
|
||
method: 'DELETE',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()),
|
||
body: JSON.stringify({remove_hdd_data: removeHDD})
|
||
});
|
||
var data = await resp.json();
|
||
if (data.ok) {
|
||
var modal = document.getElementById('delete-modal');
|
||
var removedInfo = '';
|
||
if (data.data && data.data.hdd_paths_removed && data.data.hdd_paths_removed.length > 0) {
|
||
removedInfo = '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Deleted data: ' + data.data.hdd_paths_removed.join(', ') + '</p>';
|
||
}
|
||
var preservedInfo = '';
|
||
if (data.data && data.data.hdd_paths_preserved && data.data.hdd_paths_preserved.length > 0) {
|
||
preservedInfo = '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Kept data: ' + data.data.hdd_paths_preserved.join(', ') + '</p>';
|
||
}
|
||
if (data.data && data.data.hdd_note) {
|
||
preservedInfo += '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">' + data.data.hdd_note + '</p>';
|
||
}
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Deleted!</h3>' +
|
||
'<p style="color:var(--text-2)">The app (' + name + ') was deleted.</p>' +
|
||
removedInfo + preservedInfo +
|
||
'<div class="modal-actions"><button class="btn btn-primary" onclick="window.location.href=\'/stacks\'">Close</button></div>';
|
||
} else {
|
||
showAlert('Error: ' + (data.error || 'Unknown error'));
|
||
btn.disabled = false;
|
||
btn.textContent = 'Delete';
|
||
}
|
||
} catch (err) {
|
||
showAlert('Network error: ' + err.message);
|
||
btn.disabled = false;
|
||
btn.textContent = 'Delete';
|
||
}
|
||
}
|
||
async function removeStack(name) {
|
||
var modal = document.createElement('div');
|
||
modal.className = 'modal-overlay';
|
||
modal.id = 'remove-modal';
|
||
modal.innerHTML = '<div class="modal-card"><h3>Loading...</h3></div>';
|
||
modal.addEventListener('click', function(e) { if (e.target === modal) closeRemoveModal(); });
|
||
document.body.appendChild(modal);
|
||
try {
|
||
var [hddResp, backupResp] = await Promise.all([
|
||
fetch('/api/stacks/' + name + '/hdd-data').then(function(r) { return r.json(); }),
|
||
fetch('/api/stacks/' + name + '/backup-data').then(function(r) { return r.json(); })
|
||
]);
|
||
var sections = '';
|
||
|
||
sections += '<div class="modal-section">' +
|
||
'<strong>Always deleted:</strong>' +
|
||
'<ul style="margin:.25rem 0;padding-left:1.2rem;color:var(--text-2);font-size:.85rem">' +
|
||
'<li>Docker volumes (database, app configuration)</li>' +
|
||
'<li>Install configuration (app.yaml)</li>' +
|
||
'<li>Secondary backup schedule</li>' +
|
||
'</ul></div>';
|
||
|
||
var hddCheckbox = '';
|
||
if (hddResp.ok && hddResp.data && hddResp.data.has_hdd_data) {
|
||
var hddPaths = '';
|
||
hddResp.data.hdd_paths.forEach(function(p) {
|
||
hddPaths += '<div class="modal-hdd-path">' + p.path + ' (' + (p.exists ? p.size_human : 'does not exist') + ')</div>';
|
||
});
|
||
sections += '<div class="modal-section">' +
|
||
'<strong>Your data on the hard drive:</strong>' + hddPaths +
|
||
'<label class="modal-checkbox"><input type="checkbox" id="remove-hdd-check"> Delete your data</label>' +
|
||
'<div class="alert alert-info" style="margin-top:.5rem;font-size:.8rem" id="remove-hdd-keep-warning">' +
|
||
'If you reinstall the app, you need to import the data again, because the database is deleted. Data you keep is NOT backed up automatically any more.' +
|
||
'</div></div>';
|
||
hddCheckbox = '\x3Cscript>document.getElementById("remove-hdd-check").addEventListener("change",function(){document.getElementById("remove-hdd-keep-warning").style.display=this.checked?"none":"";});<\/script>';
|
||
}
|
||
|
||
var backupCheckbox = '';
|
||
if (backupResp.ok && backupResp.data && backupResp.data.has_backups) {
|
||
var bkPaths = '';
|
||
backupResp.data.backup_paths.forEach(function(p) {
|
||
if (p.exists) bkPaths += '<div class="modal-hdd-path">' + p.path + ' (' + p.size_human + ')</div>';
|
||
});
|
||
if (bkPaths) {
|
||
sections += '<div class="modal-section">' +
|
||
'<strong>Backup data:</strong>' + bkPaths +
|
||
'<label class="modal-checkbox"><input type="checkbox" id="remove-backup-check"> Delete backup data</label>' +
|
||
'<div class="alert alert-info" style="margin-top:.5rem;font-size:.8rem">' +
|
||
'The nightly restic snapshots cannot be deleted one by one — they expire automatically under the retention rules.' +
|
||
'</div></div>';
|
||
}
|
||
}
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Remove app: ' + name + '</h3>' +
|
||
'<p style="color:var(--text-2);font-size:.9rem;margin-bottom:.75rem">The app goes back to "Not installed". The template stays, and you can install it again.</p>' +
|
||
'<div class="alert alert-warning" style="margin-bottom:.75rem">You cannot undo this!</div>' +
|
||
sections +
|
||
'<div class="modal-actions">' +
|
||
'<button class="btn btn-outline" onclick="closeRemoveModal()">Cancel</button>' +
|
||
'<button class="btn btn-danger" id="confirm-remove-btn" onclick="confirmRemoveStack(\'' + name + '\')">Remove</button>' +
|
||
'</div>' + hddCheckbox;
|
||
} catch (err) {
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Error</h3><p style="color:var(--text-2)">Could not load the details: ' + err.message + '</p>' +
|
||
'<div class="modal-actions"><button class="btn btn-outline" onclick="closeRemoveModal()">Close</button></div>';
|
||
}
|
||
}
|
||
function closeRemoveModal() {
|
||
var modal = document.getElementById('remove-modal');
|
||
if (modal) modal.remove();
|
||
}
|
||
async function confirmRemoveStack(name) {
|
||
var btn = document.getElementById('confirm-remove-btn');
|
||
var hddCheck = document.getElementById('remove-hdd-check');
|
||
var backupCheck = document.getElementById('remove-backup-check');
|
||
var removeHDD = hddCheck ? hddCheck.checked : false;
|
||
var removeBackups = backupCheck ? backupCheck.checked : false;
|
||
btn.disabled = true;
|
||
btn.textContent = 'Removing...';
|
||
try {
|
||
var resp = await fetch('/api/stacks/' + name + '/remove', {
|
||
method: 'POST',
|
||
headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()),
|
||
body: JSON.stringify({remove_hdd_data: removeHDD, remove_backups: removeBackups})
|
||
});
|
||
var data = await resp.json();
|
||
if (data.ok) {
|
||
var modal = document.getElementById('remove-modal');
|
||
var removedInfo = '';
|
||
if (data.data && data.data.hdd_paths_removed && data.data.hdd_paths_removed.length > 0) {
|
||
removedInfo += '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Deleted data: ' + data.data.hdd_paths_removed.join(', ') + '</p>';
|
||
}
|
||
if (data.data && data.data.backup_paths_removed && data.data.backup_paths_removed.length > 0) {
|
||
removedInfo += '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Deleted backups: ' + data.data.backup_paths_removed.join(', ') + '</p>';
|
||
}
|
||
var preservedInfo = '';
|
||
if (data.data && data.data.hdd_paths_preserved && data.data.hdd_paths_preserved.length > 0) {
|
||
preservedInfo = '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Kept data: ' + data.data.hdd_paths_preserved.join(', ') + '</p>';
|
||
}
|
||
if (data.data && data.data.hdd_note) {
|
||
preservedInfo += '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">' + data.data.hdd_note + '</p>';
|
||
}
|
||
if (data.data && data.data.backup_paths_refused && data.data.backup_paths_refused.length > 0) {
|
||
preservedInfo += '<p style="color:var(--text-2);font-size:.85rem;margin-top:.5rem">Backups not deleted: ' + data.data.backup_paths_refused.join('; ') + '</p>';
|
||
}
|
||
modal.querySelector('.modal-card').innerHTML =
|
||
'<h3>Removed!</h3>' +
|
||
'<p style="color:var(--text-2)">The app (' + name + ') was removed. You can install it again with the Install button.</p>' +
|
||
removedInfo + preservedInfo +
|
||
'<div class="modal-actions"><button class="btn btn-primary" onclick="window.location.href=\'/stacks\'">Close</button></div>';
|
||
} else {
|
||
showAlert('Error: ' + (data.error || 'Unknown error'));
|
||
btn.disabled = false;
|
||
btn.textContent = 'Remove';
|
||
}
|
||
} catch (err) {
|
||
showAlert('Network error: ' + err.message);
|
||
btn.disabled = false;
|
||
btn.textContent = 'Remove';
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|
||
|