Skip the key step when SSH already works, and read the install path live on both sides

This commit is contained in:
Gmer4Lfe
2026-08-17 07:04:46 -04:00
parent 7e7d845f61
commit d8e3c09b57
4 changed files with 60 additions and 33 deletions
+18
View File
@@ -203,6 +203,24 @@ function vvPrompt(text, def, opts) {
//
// Not in js/varaverk.js: that loads below the tab include, and the wizard returns before it.
// Where Varaverk is installed on THIS host, read live rather than baked into the page.
//
// Two reasons it cannot be a render-time constant. The wizard can move it: choosing appdata in
// step 1 triggers a migration and step 2 renders in the same page load, so PHP's value names the
// pre-migration location. And each host chooses independently — the owner may be on flash while
// the mirror is on appdata — so a panel rendered on either side must ask, not assume.
//
// It matters because the value ends up in a command the operator pastes into a root terminal.
// api/setup.php?action=detect re-reads varaverk.cfg. Cached; the panels re-render often.
let _vvScriptsDir = null;
function vvScriptsDir(fallback) {
if (_vvScriptsDir) return Promise.resolve(_vvScriptsDir);
return fetch('/plugins/varaverk/api/setup.php?action=detect&_=' + Date.now())
.then(r => r.json())
.then(d => (_vvScriptsDir = (d && d.scripts_dir) || fallback))
.catch(() => (_vvScriptsDir = fallback));
}
// api/run.php answers when a job is LAUNCHED, not finished. An empty body is never success —
// Unraid's CSRF guard exits with one, and so does a PHP fatal.
function _vvPtRun(id, extraArgs) {