diff --git a/Plugin/unraid/pages/partnership.php b/Plugin/unraid/pages/partnership.php index 32e89da..27cc6f7 100644 --- a/Plugin/unraid/pages/partnership.php +++ b/Plugin/unraid/pages/partnership.php @@ -126,16 +126,10 @@ textarea.vv-pt-set-input { resize:vertical; white-space:pre; }
Loading…
- -
-
-

Mirror Sync

-
Loading…
-
-
-

Actions

-
Loading…
-
+ +
+

Actions

+
Loading…
@@ -682,17 +676,6 @@ function _renderOfflineWarn(cfg) { // ── Mirror sync health ────────────────────────────────────────────────────────── -function _syncToggle(gate, dimmed) { - if (!gate) return ''; - const on = gate.on; - const col = on ? '#4caf50' : '#f44336'; - const bg = on ? '#0a1a0a' : '#2a1212'; - const op = dimmed ? 'opacity:.4;' : ''; - return `${on ? 'ON' : 'OFF'}`; -} // ── Data transferred ────────────────────────────────────────────────────────── // @@ -752,101 +735,6 @@ function _renderXfer(x) {
`; } -function _renderSync(sync) { - const jobs = sync.jobs || {}; - const gates = sync.gates || {}; - const intervalMin = sync.interval_min || 30; - - const sCol = s => s === 'ok' ? '#4caf50' : s === 'running' ? '#4a9eff' - : s === 'warn' ? '#ff9800' : s === 'error' ? '#f44336' : '#555'; - const sLbl = s => s === 'ok' ? '✓' : s === 'running' ? '⟳' : s === 'warn' ? '⚠' : s === 'error' ? '✗' : '—'; - - function _dur(sec) { - if (!sec || sec < 0) return ''; - if (sec < 60) return sec + 's'; - if (sec < 3600) return Math.floor(sec / 60) + 'm ' + (sec % 60) + 's'; - return Math.floor(sec / 3600) + 'h ' + Math.floor((sec % 3600) / 60) + 'm'; - } - - function _countdown(ts) { - if (!ts) return null; - const sec = ts - Math.floor(Date.now() / 1000); - if (sec <= 0) return 'due'; - if (sec < 60) return 'in ' + sec + 's'; - if (sec < 3600) return 'in ' + Math.floor(sec / 60) + 'm'; - return 'in ' + Math.floor(sec / 3600) + 'h ' + Math.floor((sec % 3600) / 60) + 'm'; - } - - const globalOff = gates.global && !gates.global.on; - - // Wrap everything in a flex-column so the bottom section anchors naturally - let html = '
'; - - // Master toggle row - if (gates.global) { - html += `
- All mirroring - ${_syncToggle(gates.global, false)} -
`; - } - - // Per-tier rows - const tierMeta = { - critical: {label: 'Critical', sched: 'every 30 min', desc: 'appdata · partnership · play state'}, - daily: {label: 'Daily', sched: 'nightly', desc: 'media shares · arr sync · docker'}, - weekly: {label: 'Weekly', sched: 'weekly', desc: 'bulk shares · updates · cleanup'}, - }; - - // Critical next-run estimate - const critJob = jobs.critical; - const critNextTs = critJob && critJob.end && critJob.status !== 'running' - ? critJob.end + intervalMin * 60 : null; - - html += '
'; - - for (const key of ['critical', 'daily', 'weekly']) { - const j = jobs[key]; - const meta = tierMeta[key]; - const status = j ? j.status : null; - const when = j && j.start - ? (j.status === 'running' ? 'started ' + _relTime(j.start) : _relTime(j.end || j.start)) - : null; - const dur = j && j.start && j.end && j.status !== 'running' ? _dur(j.end - j.start) : ''; - const summary = j && j.summary ? j.summary : ''; - - html += `
-
- ${meta.label} - ${meta.sched} - - - ${sLbl(status)} - ${dur ? `${dur}` : ''} - ${when ? `${when}` : ''} - ${_syncToggle(gates[key], globalOff)} - -
-
${meta.desc}
- ${summary ? `
${_vvSetEsc(summary)}
` : ''} -
`; - } - - html += '
'; // flex:1 - - // Bottom info strip - const nextLabel = critNextTs ? _countdown(critNextTs) : null; - html += `
- interval: ${intervalMin}min - ${nextLabel ? `next critical ${nextLabel}` : ''} -
`; - - if (globalOff) { - html += `
⚠ All mirroring is off — per-tier switches have no effect until re-enabled.
`; - } - - html += '
'; // outer flex column - return html; -} // ── Config bar ──────────────────────────────────────────────────────────────── @@ -1404,7 +1292,6 @@ function _render(data) { // Mirror sync health _renderXfer(data.xfer || {}); - document.getElementById('vv-pt-sync-body').innerHTML = _renderSync(data.sync || {}); // Node grid — columns based on count const cols = nodes.length <= 2 ? nodes.length : nodes.length <= 4 ? 2 : 3;