0.3.0: clickable breadcrumb + tabs, images, templates (CRUD), create wizard

This commit is contained in:
Claw committed 2026-11-17 20:13:33 +01:00
1 parent dea7668fd8
commit 3eb5e6d013
14 files changed
+729 -22

No files matched your search

+38
View File
@@ -43,6 +43,37 @@ if (!function_exists('vmm_badge')) {
}
}
if (!function_exists('vmm_nav')) {
/**
* Clickable breadcrumb + section tabs (the XigmaNAS title itself is plain
* text, so navigation lives here).
*/
function vmm_nav(string $current): void
{
$items = [
'dashboard' => ['vmmngr.php', gettext('Dashboard')],
'create' => ['vmmngr_create.php', gettext('Create VM')],
'images' => ['vmmngr_images.php', gettext('Images')],
'templates' => ['vmmngr_templates.php', gettext('Templates')],
'jobs' => ['vmmngr_jobs.php', gettext('Jobs')],
'config' => ['vmmngr_config.php', gettext('Configuration')],
];
$label = $items[$current][1] ?? gettext('VM Manager');
?>
<div class="vmm-crumbs"><a href="vmmngr.php"><?=gettext('VM Manager');?></a><span class="vmm-sep">›</span><strong><?=vmm_h($label);?></strong></div>
<div class="vmm-tabs">
<?php foreach ($items as $key => [$href, $text]): ?>
<?php if ($key === $current): ?>
<span class="vmm-tab vmm-tab-cur"><?=vmm_h($text);?></span>
<?php else: ?>
<a class="vmm-tab" href="<?=vmm_h($href);?>"><?=vmm_h($text);?></a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php
}
}
if (!function_exists('vmm_css')) {
/**
* Theme-aware styles: no hardcoded dark panels — colours derive from the
@@ -68,6 +99,13 @@ if (!function_exists('vmm_css')) {
.vmm-job{display:none;margin:12px 0;border:1px solid rgba(127,127,127,.35);border-radius:6px;padding:10px;background:var(--bgc-area-data,transparent)}
.vmm-job-head{font-size:12px;margin-bottom:6px;opacity:.9}
.vmm-job-state{font-weight:600;margin-left:6px}
.vmm-crumbs{font-size:13px;margin:4px 0 8px}
.vmm-crumbs a{text-decoration:none}
.vmm-sep{margin:0 6px;opacity:.6}
.vmm-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 12px;border-bottom:1px solid rgba(127,127,127,.35);padding-bottom:6px}
.vmm-tab{display:inline-block;padding:4px 10px;border:1px solid rgba(127,127,127,.35);border-radius:4px;text-decoration:none;font-size:12px}
.vmm-tab:hover{background:rgba(127,127,127,.12)}
.vmm-tab-cur{font-weight:600;background:rgba(127,127,127,.16);border-color:rgba(127,127,127,.55)}
.vmm-ok{color:#2f9e63}
.vmm-err{color:#c25656}
</style>