['vmm-running', gettext('Running')], 'stopped' => ['vmm-stopped', gettext('Stopped')], 'suspended' => ['vmm-suspended', gettext('Suspended')], 'starting' => ['vmm-starting', gettext('Starting')], 'locked' => ['vmm-locked', gettext('Locked')], ]; [$cls, $label] = $map[$state] ?? ['vmm-unknown', ucfirst($state)]; return sprintf('%s', $cls, htmlspecialchars($label)); } function vmm_h(string $s): string { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } function vmm_source_label(array $p): string { $icon = match ($p['source']) { 'system' => '🖥', 'bundle' => '📦', default => '⚠', }; return sprintf('%s %s', $icon, $p['source']); } } 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, string $crumb = ''): 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')], 'datastores' => ['vmmngr_datastores.php', gettext('Datastores')], 'switches' => ['vmmngr_switches.php', gettext('Switches')], 'jobs' => ['vmmngr_jobs.php', gettext('Jobs')], 'config' => ['vmmngr_config.php', gettext('Configuration')], ]; $label = $crumb !== '' ? $crumb : ($items[$current][1] ?? gettext('VM Manager')); ?>
›
[$href, $text]): ?>