Files
Clemens Hering 58a10625c3
All checks were successful
Deploy KubeViz / deploy (push) Successful in 11s
make local
2026-03-01 11:37:20 +01:00

291 lines
14 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ .Title }}</title>
<link rel="stylesheet" href="/static/styles.css">
<script defer src="/static/app.js"></script>
</head>
<body>
<header class="topbar">
<div class="brand">
<img src="/static/logo.svg" alt="KubeViz logo" class="brand-logo">
<div>
<h1>KubeViz</h1>
<p>Kubernetes manifest relationship visualizer</p>
</div>
</div>
<button id="theme-toggle" class="btn-secondary theme-toggle" type="button" aria-label="Toggle theme">Theme: System</button>
</header>
<main class="layout">
<section class="left-panel">
<nav class="tabs" aria-label="Sidebar sections">
<button class="tab-btn active" data-tab="tab-data" type="button"><span class="tab-icon" aria-hidden="true"></span>Data</button>
<button class="tab-btn" data-tab="tab-filter" type="button"><span class="tab-icon" aria-hidden="true"></span>Filter</button>
</nav>
<section id="tab-data" class="tab-pane active">
<form id="manifest-form">
<label for="manifestText">Paste YAML</label>
<textarea id="manifestText" name="manifestText" rows="10" placeholder="apiVersion: apps/v1&#10;kind: Deployment&#10;..."></textarea>
<label for="manifestFile">
Or upload files
<span class="help-tip" tabindex="0" role="button" aria-label="Input format help">
?
<span class="help-tooltip" role="tooltip">
Expected input: rendered Kubernetes manifests with apiVersion, kind, and metadata.name.
Helm chart source files (Chart.yaml, values.yaml, templates/*.yaml) must be rendered first
(for example via helm template) or loaded via Import From Git / Helm.
</span>
</span>
</label>
<div class="file-upload">
<input id="manifestFile" class="visually-hidden-file" name="manifestFile" type="file" accept=".yaml,.yml,.json,text/yaml,application/x-yaml" multiple>
<button id="file-picker-btn" class="btn-secondary" type="button">Choose files</button>
<span id="file-count">No files selected</span>
</div>
<div class="row compact">
<button class="btn-primary" type="submit">Parse</button>
<button class="btn-secondary" type="button" id="clear-session">Clear</button>
</div>
</form>
<div class="status" id="parse-status"></div>
<div id="parse-issues" class="parse-issues hidden" aria-live="polite">
<strong>Parse Issues</strong>
<ul id="parse-issues-list"></ul>
</div>
<div class="status selected-summary">
<strong>Selected:</strong>
<span id="selected-kind-name">none</span>
</div>
<div class="tool-actions">
<button class="btn-secondary toggle-btn" id="open-checks" type="button"><span class="btn-icon" aria-hidden="true"></span>Checks</button>
<button class="btn-secondary toggle-btn" id="open-diff" type="button"><span class="btn-icon" aria-hidden="true"></span>Diff</button>
</div>
<div class="row exports compact">
<a id="export-svg" href="/api/export/svg" target="_blank" rel="noreferrer">Export SVG</a>
<a id="export-png" href="/api/export/png" target="_blank" rel="noreferrer">Export PNG</a>
</div>
<details class="advanced-filters">
<summary><span class="summary-title">Import From Git / Helm</span></summary>
<label for="git-repo-url">Git Repo URL</label>
<input id="git-repo-url" type="text" placeholder="https://github.com/org/repo.git">
<label for="git-ref">Git Ref (optional)</label>
<input id="git-ref" type="text" placeholder="main, tag, or commit">
<label for="git-path">Path In Repo (optional)</label>
<input id="git-path" type="text" placeholder="deploy/k8s or charts/my-app">
<label for="helm-values">Helm values YAML (optional)</label>
<textarea id="helm-values" rows="4" placeholder="replicaCount: 2"></textarea>
<div class="row compact">
<button class="btn-secondary" id="git-import-manifests" type="button">Import Manifests</button>
<button class="btn-secondary" id="git-import-helm" type="button">Render Helm</button>
</div>
</details>
</section>
<section id="tab-filter" class="tab-pane">
<form id="filter-form">
<h3>Quick Filters</h3>
<label for="query">Search</label>
<input id="query" name="q" type="text" placeholder="name, kind, namespace or id">
<p class="field-hint">Search by name, kind, namespace, or full ID (for example: <code>default/Service/web</code>).</p>
<div id="search-suggest" class="search-suggest hidden" role="listbox" aria-label="Search suggestions"></div>
<div class="row compact">
<button class="btn-secondary" id="jump-to-search" type="button">Jump To Match</button>
</div>
<label for="groupBy">Group By</label>
<select id="groupBy" name="groupBy">
<option value="">None</option>
<option value="namespace">Namespace</option>
<option value="kind">Kind</option>
</select>
<fieldset>
<legend>Relations</legend>
<label><input type="checkbox" name="relations" value="selects" checked> selects</label>
<label><input type="checkbox" name="relations" value="mounts" checked> mounts</label>
<label><input type="checkbox" name="relations" value="references" checked> references</label>
<label><input type="checkbox" name="relations" value="owns" checked> owns</label>
<label><input type="checkbox" name="relations" value="routesTo" checked> routesTo</label>
<label><input type="checkbox" name="relations" value="scales" checked> scales</label>
</fieldset>
<details class="advanced-filters">
<summary><span class="summary-title">Advanced Filters</span></summary>
<label for="namespace">Namespace</label>
<input id="namespace" name="namespace" type="text" placeholder="default">
<label for="kind">Kind</label>
<input id="kind" name="kind" type="text" placeholder="Service">
<label for="focus">Focus Resource ID</label>
<input id="focus" name="focus" type="text" placeholder="default/Service/web">
<div id="collapse-controls" class="collapse-controls hidden">
<strong>Collapse Groups</strong>
<div id="collapse-list"></div>
</div>
</details>
<div class="row compact">
<button class="btn-secondary" type="button" id="reset-view">Reset Filters</button>
</div>
<h3>Saved Views</h3>
<label for="view-name">View Name</label>
<input id="view-name" type="text" placeholder="production-overview">
<div class="row compact">
<button class="btn-secondary" type="button" id="save-view">Save Current View</button>
</div>
<label for="saved-views">Saved</label>
<select id="saved-views">
<option value="">No saved views</option>
</select>
<div class="row compact">
<button class="btn-secondary" type="button" id="load-view">Load</button>
<button class="btn-secondary" type="button" id="delete-view">Delete</button>
</div>
<div class="row compact">
<button class="btn-secondary" type="button" id="export-views">Export JSON</button>
<button class="btn-secondary" type="button" id="import-views">Import JSON</button>
<input id="import-views-file" type="file" accept=".json,application/json" class="visually-hidden-file">
</div>
<h3>Path Finder</h3>
<label for="path-source">Source Node ID</label>
<input id="path-source" type="text" placeholder="default/Ingress/web">
<div id="path-source-suggest" class="search-suggest hidden" role="listbox" aria-label="Path source suggestions"></div>
<label for="path-target">Target Node ID</label>
<input id="path-target" type="text" placeholder="default/Secret/web-secret">
<div id="path-target-suggest" class="search-suggest hidden" role="listbox" aria-label="Path target suggestions"></div>
<label><input id="path-bidirectional" type="checkbox"> Allow reverse traversal</label>
<div class="row compact">
<button class="btn-secondary" type="button" id="run-path">Find Path</button>
<button class="btn-secondary" type="button" id="clear-path">Clear Path</button>
</div>
<div id="path-result" class="path-result">No path calculated.</div>
</form>
</section>
</section>
<section class="graph-panel">
<div class="toolbar">
<span>Total Nodes: <strong id="total-nodes">0</strong></span>
<span>Total Edges: <strong id="total-edges">0</strong></span>
<select id="layout-mode" title="Layout mode">
<option value="circular">Circular</option>
<option value="hierarchical">Hierarchical</option>
<option value="grid">Grid</option>
<option value="radial">Radial</option>
</select>
<button class="btn-secondary" id="zoom-out" type="button" title="Zoom out">-</button>
<button class="btn-secondary" id="zoom-in" type="button" title="Zoom in">+</button>
<button class="btn-secondary" id="zoom-reset" type="button" title="Reset zoom">Fit</button>
<span class="kbd-hint">Shortcuts: <kbd>/</kbd> Search, <kbd>d</kbd> Diff, <kbd>c</kbd> Checks</span>
</div>
<div id="active-filters" class="chips"></div>
<div class="legend" id="legend">
<span><i class="dot kind-workload"></i>Workload</span>
<span><i class="dot kind-network"></i>Network</span>
<span><i class="dot kind-config"></i>Config</span>
<span><i class="dot kind-secret"></i>Sensitive</span>
<span><i class="dot kind-group"></i>Group</span>
<span><i class="dot health-warning"></i>Warning</span>
</div>
<svg id="graph-canvas" viewBox="0 0 1200 720" aria-label="Resource graph"></svg>
<div id="graph-empty" class="graph-overlay hidden">
<strong>No manifests loaded yet.</strong>
<span>Paste YAML or upload files in <em>Data</em>, then click Parse.</span>
<button class="btn-secondary" id="open-data-tab" type="button">Go To Data</button>
</div>
<div id="no-match" class="no-match hidden">
<strong>No nodes match current filters.</strong>
<span>Try broader search terms or reset all filters.</span>
<button class="btn-secondary" id="open-filter-tab" type="button">Open Filters</button>
<button class="btn-secondary" id="clear-filters-inline" type="button">Reset Filters</button>
</div>
<div id="edge-tooltip" class="edge-tooltip hidden"></div>
<div class="minimap-wrap">
<strong>Minimap</strong>
<svg id="minimap-canvas" viewBox="0 0 1200 720" aria-label="Graph minimap"></svg>
</div>
</section>
<aside class="details-panel">
<h2>Resource Details</h2>
<p id="details-empty">Select a node to inspect details.</p>
<div id="details-content" class="hidden">
<p><strong id="details-kind"></strong> <span id="details-name"></span></p>
<p>Namespace: <span id="details-namespace"></span></p>
<p id="details-sensitive" class="sensitive hidden">Sensitive resource: values redacted</p>
<pre id="details-raw"></pre>
</div>
</aside>
</main>
<div id="diff-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="diff-title">
<div class="modal-card">
<div class="modal-head">
<h3 id="diff-title">Manifest Diff</h3>
<button class="btn-secondary" id="close-diff" type="button">Close</button>
</div>
<label for="diff-base">Base manifests</label>
<textarea id="diff-base" rows="6" placeholder="Current state YAML"></textarea>
<label for="diff-target">Target manifests</label>
<textarea id="diff-target" rows="6" placeholder="New state YAML"></textarea>
<div class="row compact">
<button class="btn-primary" id="run-diff" type="button">Run Diff</button>
</div>
<div id="diff-output" class="diff-output">No diff executed.</div>
</div>
</div>
<div id="checks-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="checks-title">
<div class="modal-card">
<div class="modal-head">
<h3 id="checks-title">Manifest Checks</h3>
<button class="btn-secondary" id="close-checks" type="button">Close</button>
</div>
<details class="check-help">
<summary><span class="summary-title">What is checked?</span></summary>
<p>Security and validation checks run on loaded manifests. Disable rules you do not want to evaluate.</p>
</details>
<fieldset class="check-config">
<legend>Enabled Rules</legend>
<label><input type="checkbox" name="checkRules" value="privileged_container" checked> Privileged container</label>
<label><input type="checkbox" name="checkRules" value="run_as_non_root_false" checked> runAsNonRoot=false</label>
<label><input type="checkbox" name="checkRules" value="missing_resource_requests" checked> Missing resource requests</label>
<label><input type="checkbox" name="checkRules" value="missing_resource_limits" checked> Missing resource limits</label>
<label><input type="checkbox" name="checkRules" value="ingress_wildcard_host" checked> Ingress wildcard/empty host</label>
<label><input type="checkbox" name="checkRules" value="unresolved_reference" checked> Unresolved references</label>
<label><input type="checkbox" name="checkRules" value="selector_mismatch" checked> Service selector mismatch</label>
<label><input type="checkbox" name="checkRules" value="duplicate_resource_id" checked> Duplicate resource IDs</label>
</fieldset>
<div class="row compact">
<button class="btn-secondary" id="reset-checks" type="button">Reset Check Defaults</button>
</div>
<div id="findings-summary">No checks yet.</div>
<ul id="findings-list" class="findings-list"></ul>
</div>
</div>
</body>
</html>