Plugin lives in Plugin/ — invisible to User Script Plugin. dev_install.sh symlinks into /usr/local/emhttp/plugins/varaverk/ for development. Pages: Monitor (5s poll), Scheduler (orchs + Advanced children, toggle + cron), Config (raw editor, host-aware file access), Docs (markdown + live $VAR substitution). API endpoints: monitor.php (JSON), scheduler.php (writes schedule.json + cron.d), config.php (writes conf files with host permission check). Includes: config.php (parser, host detection, var map), scheduler.php (job tree, cron.d rebuild), monitor.php (docker, GPU, resources, fallback, transcode), docs.php (file tree, var substitution, Parsedown renderer).
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
require_once dirname(__DIR__) . '/include/docs.php';
|
|
require_once dirname(__DIR__) . '/include/config.php';
|
|
|
|
$tree = vv_docs_tree();
|
|
$vars = vv_conf_vars();
|
|
$active = $_GET['doc'] ?? '';
|
|
|
|
// Validate: must be a .md file within SCRIPTS_DIR
|
|
$active = preg_match('/^[a-zA-Z0-9_\-\/]+\.md$/', $active) ? $active : '';
|
|
if ($active && !file_exists(SCRIPTS_DIR . '/' . $active)) $active = '';
|
|
?>
|
|
|
|
<div id="vv-docs">
|
|
|
|
<div id="vv-docs-sidebar">
|
|
<h3>Documents</h3>
|
|
<ul>
|
|
<?php foreach ($tree as $rel): ?>
|
|
<li>
|
|
<a href="?tab=docs&doc=<?= urlencode($rel) ?>"
|
|
class="<?= $rel === $active ? 'active' : '' ?>">
|
|
<?= htmlspecialchars($rel) ?>
|
|
</a>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="vv-docs-content">
|
|
<?php if ($active): ?>
|
|
<div class="vv-doc-body">
|
|
<?= vv_docs_render($active, $vars) ?>
|
|
</div>
|
|
<p class="vv-doc-hint">
|
|
Values shown in <code class="vv-live-var">green</code> are live from your conf files.
|
|
<code class="vv-unknown-var">Orange</code> means the variable was not found.
|
|
</p>
|
|
<?php else: ?>
|
|
<p>Select a document from the sidebar.</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</div>
|