Files
Netbox-Store/store/templates/plugin.php
T
MrBlake f36d6be511
CI / php-store (push) Waiting to run
CI / python-components (push) Waiting to run
feat: add NetBox plugin store
2026-08-24 20:51:25 +02:00

71 lines
3.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php declare(strict_types=1); include __DIR__ . '/partials/head.php'; ?>
<?php $wheelReleases = array_values(array_filter($releases ?? [], static fn (array $release): bool => ($release['artifactKind'] ?? '') === 'wheel')); ?>
<section class="detail-hero">
<div class="shell">
<a class="back-link" href="/">← Alle Plugins</a>
<div class="detail-title-row">
<div>
<span class="eyebrow"><?= $e(strtoupper((string) ($source['provider'] ?? 'Git'))) ?> · <?= $e($source['name'] ?? '') ?></span>
<h1><?= $e($plugin['name']) ?></h1>
<p><?= $e($plugin['summary'] ?: $plugin['description']) ?></p>
</div>
<div class="detail-actions">
<a class="button primary" href="<?= $e($plugin['repositoryUrl']) ?>" rel="noreferrer noopener">Repository öffnen ↗</a>
<a class="button secondary" href="/api/v1/plugins/<?= $e(rawurlencode($plugin['slug'])) ?>/">API-Daten</a>
</div>
</div>
</div>
</section>
<div class="shell detail-layout">
<article class="readme-card">
<div class="section-label">README · Commit <?= $e(substr((string) ($plugin['commitSha'] ?? ''), 0, 10)) ?></div>
<div class="readme-content">
<?php if (($plugin['readmeHtml'] ?? '') !== ''): ?>
<?= $plugin['readmeHtml'] ?>
<?php else: ?>
<div class="empty-inline"><h2>Keine README gefunden</h2><p>Die synchronisierte Revision enthält keine unterstützte README-Datei.</p></div>
<?php endif; ?>
</div>
</article>
<aside class="detail-sidebar">
<section class="side-card">
<h2>Kompatibilität</h2>
<dl class="side-list">
<div><dt>NetBox</dt><dd><?= $e($plugin['minNetboxVersion']) ?> <?= $e($plugin['maxNetboxVersion']) ?></dd></div>
<div><dt>Python-Paket</dt><dd><code><?= $e($plugin['packageName']) ?></code></dd></div>
<div><dt>Import</dt><dd><code><?= $e($plugin['importName']) ?></code></dd></div>
<div><dt>Lizenz</dt><dd><?= $e($plugin['license'] ?: 'Nicht angegeben') ?></dd></div>
</dl>
</section>
<section class="side-card releases-card">
<div class="side-heading"><h2>Releases</h2><span><?= $e(count($releases ?? [])) ?></span></div>
<?php if ($wheelReleases === []): ?>
<div class="release-warning">
<strong>Kein installierbares Release</strong>
<p>Für die automatische Installation durch den Host-Agenten fehlt ein freigegebenes <code>.whl</code>-Artefakt.</p>
</div>
<?php endif; ?>
<?php if (($releases ?? []) === []): ?>
<p class="muted">Es wurde noch kein Artefakt separat freigegeben.</p>
<?php else: ?>
<ol class="release-list">
<?php foreach ($releases as $release): ?>
<li>
<div><strong><?= $e($release['version']) ?></strong><span><?= $e($formatDate($release['publishedAt'] ?? null)) ?></span></div>
<div class="release-tags">
<span class="status-pill success">Wheel</span>
<span><?= $e($formatBytes($release['artifactSize'])) ?></span>
</div>
<code class="hash" title="SHA-256"><?= $e(substr($release['sha256'], 0, 16)) ?>…</code>
</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
</section>
</aside>
</div>
<?php include __DIR__ . '/partials/footer.php'; ?>