- FallBack tab: per-node tier inventory + active fallback card with duration, tier, handback strikes, running container status - Watchdog tab: live system health (RAM bar + thresholds, load, uptime, daemon), docker watchdog strikes + skip list + restart history, stability strikes + reboot log, resource pressure alert card, config inventory (mem limits, required, pause/stop lists) - Swapped partnership/arrs tab order; FallBack between partnership and watchdog - Plugin source tree moved from Plugin/usr/local/emhttp/plugins/varaverk/ to Plugin/unraid/ - Deployment/ conf templates added
22 lines
736 B
PHP
22 lines
736 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
|
|
$action = trim($_POST['action'] ?? '');
|
|
$name = trim($_POST['name'] ?? '');
|
|
|
|
if (!$name || !in_array($action, ['start', 'stop'], true)) {
|
|
echo json_encode(['ok' => false, 'error' => 'Invalid request']);
|
|
exit;
|
|
}
|
|
|
|
// Confirm container exists
|
|
$check = trim(shell_exec('docker ps -a --filter ' . escapeshellarg('name=^' . $name . '$') . " --format '{{.Names}}' 2>/dev/null") ?? '');
|
|
if ($check !== $name) {
|
|
echo json_encode(['ok' => false, 'error' => 'Container not found']);
|
|
exit;
|
|
}
|
|
|
|
exec(($action === 'start' ? 'docker start' : 'docker stop') . ' ' . escapeshellarg($name) . ' 2>&1', $out, $rc);
|
|
|
|
echo json_encode(['ok' => $rc === 0, 'output' => implode("\n", $out)]);
|