Convert every POST off multipart — 21 call sites across 7 tabs
A multipart POST to the plugin API hangs and never completes on this host: no status code, and no server-side trace of any kind. The correlation was exact — every page using URLSearchParams worked, every page using FormData hung, which is why scheduler and partnership appeared fine while docker, rsync, settings, auth, arrs, fallback and monitor did not. URLSearchParams has the same append API and fetch sets the urlencoded content type for it, so each site is a one-token change with the payload logic untouched.
This commit is contained in:
@@ -1004,7 +1004,7 @@ function vvRyWinSave(key) {
|
||||
if (btn) { btn.disabled = true; btn.textContent = 'Saving…'; }
|
||||
if (fb) fb.textContent = '';
|
||||
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('action', 'save');
|
||||
fd.append('win_key', key);
|
||||
fd.append('scripts', JSON.stringify(state.scripts));
|
||||
@@ -1247,7 +1247,7 @@ function _vvRyLoadProfiles(key) {
|
||||
function vvRyToggle(trackEl, name) {
|
||||
const on = !trackEl.classList.contains('on');
|
||||
trackEl.classList.toggle('on', on);
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('name', name);
|
||||
fd.append('enabled', on ? '1' : '0');
|
||||
fetch('/plugins/varaverk/api/flag_toggle.php', { method: 'POST', body: fd })
|
||||
@@ -1269,7 +1269,7 @@ function vvRySaveDefaults() {
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Saving…';
|
||||
fb.textContent = '';
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('id', 'rsync');
|
||||
fd.append('changes', JSON.stringify(changes));
|
||||
fetch('/plugins/varaverk/api/confform.php', { method: 'POST', body: fd })
|
||||
@@ -1441,7 +1441,7 @@ function vvRpSave() {
|
||||
const btn = document.querySelector('#vv-rp-card .vv-ry-save-btn');
|
||||
btn.disabled = true; btn.textContent = 'Saving…'; fb.textContent = '';
|
||||
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('action', 'save');
|
||||
fd.append('name', name);
|
||||
fd.append('rsync_opts', document.getElementById('vv-rp-rsync_opts')?.value?.trim() || '');
|
||||
@@ -1478,7 +1478,7 @@ function vvRpDelete() {
|
||||
const del = document.getElementById('vv-rp-del-btn');
|
||||
del.disabled = true; fb.textContent = '';
|
||||
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('action', 'delete');
|
||||
fd.append('name', name);
|
||||
|
||||
@@ -1521,7 +1521,7 @@ function vvMsStop() {
|
||||
if (!token) return;
|
||||
const btn = document.getElementById('vv-ms-stop-btn');
|
||||
btn.textContent = '⟳ Stopping…'; btn.disabled = true;
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('action', 'stop');
|
||||
fd.append('token', token);
|
||||
fetch('/plugins/varaverk/api/manual_sync.php', { method: 'POST', body: fd })
|
||||
@@ -1768,7 +1768,7 @@ function vvMsRun() {
|
||||
badge.style.color = '#4a9eff';
|
||||
badge.style.border = '1px solid #1a3a5a';
|
||||
|
||||
const fd = new FormData();
|
||||
const fd = new URLSearchParams();
|
||||
fd.append('action', 'run');
|
||||
fd.append('local', local);
|
||||
fd.append('host', slot);
|
||||
|
||||
Reference in New Issue
Block a user