audit echo vs log across all scripts — outcomes always visible, verbose for per-item loops
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
Menu="Tasks:95"
|
||||
Title="Varaverk"
|
||||
Icon="varaverk.png"
|
||||
---
|
||||
<?php
|
||||
$plugin = 'varaverk';
|
||||
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
$pluginDir = "$docroot/plugins/$plugin";
|
||||
|
||||
require_once "$pluginDir/include/config.php";
|
||||
|
||||
// First-run check — show setup wizard if HOST1 is blank OR local host.conf is missing
|
||||
$_master = vv_read_conf_raw('master.conf');
|
||||
preg_match('/^\s*HOST1\s*=\s*"([^"]*)"/m', $_master, $_h1m);
|
||||
$_host1_blank = empty(trim($_h1m[1] ?? ''));
|
||||
$_my_hostid = vv_detect_host();
|
||||
$_conf_missing = $_my_hostid !== 'unknown'
|
||||
&& !file_exists(CONF_DIR . '/' . $_my_hostid . '.conf');
|
||||
if ($_host1_blank || $_conf_missing) {
|
||||
include "$pluginDir/pages/setup.php";
|
||||
return;
|
||||
}
|
||||
unset($_master, $_h1m, $_host1_blank, $_my_hostid, $_conf_missing);
|
||||
|
||||
// Determine active tab
|
||||
$tab = $_GET['tab'] ?? 'monitor';
|
||||
$validTabs = ['monitor', 'scheduler', 'docker', 'watchdog', 'partnership', 'fallback', 'arrs', 'cert', 'rsync', 'auth', 'settings'];
|
||||
if (!in_array($tab, $validTabs)) $tab = 'monitor';
|
||||
$tabLabels = ['monitor' => 'Monitor', 'scheduler' => 'Scheduler', 'docker' => 'Docker', 'watchdog' => 'Watchdog', 'partnership' => 'Partnership', 'fallback' => 'FallBack', 'arrs' => 'Arrs', 'cert' => 'Certs', 'rsync' => 'Rsync', 'auth' => 'Auth Stack', 'settings' => 'Settings'];
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="/plugins/<?=$plugin?>/css/varaverk.css">
|
||||
|
||||
<div id="varaverk-wrap">
|
||||
|
||||
<!-- Tab bar -->
|
||||
<div id="vv-tabs">
|
||||
<?php foreach ($validTabs as $t): ?>
|
||||
<a href="?tab=<?=$t?>" class="vv-tab<?= $t === $tab ? ' active' : '' ?>">
|
||||
<?= $tabLabels[$t] ?? ucfirst($t) ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<div style="margin-left:auto;display:flex;align-items:center;gap:2px;">
|
||||
<a href="https://github.com/FailedProxy/Varaverk" target="_blank"
|
||||
style="padding:0 10px;font-size:10px;color:#333;text-decoration:none;
|
||||
display:flex;align-items:center;letter-spacing:.03em;"
|
||||
title="GitHub — source, issues, changelog">
|
||||
⎋ GitHub
|
||||
</a>
|
||||
<button id="vv-expand-btn" onclick="vvToggleExpand()" title="Expand">⤢</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab content -->
|
||||
<div id="vv-content">
|
||||
<?php
|
||||
$page = "$pluginDir/pages/$tab.php";
|
||||
if (file_exists($page)) include $page;
|
||||
else echo "<p>Page not found: $tab</p>";
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/plugins/<?=$plugin?>/js/varaverk.js"></script>
|
||||
Reference in New Issue
Block a user