Files
Maven/cmd/mavweb/ecosystem.html
kami 1d0cdebd20 fix(mavweb): stable panel refresh on /ecosystem
The auto-refresh replaced cards by index while mutating the parsed
document — each replaceWith detached a card from the fetched doc,
shifting the remaining indices, so Praxis got dropped and Hexis
rendered twice after the first tick. Give the three sections stable
ids and replace by getElementById (dash.html's proven pattern).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:12:07 +04:00

55 lines
2.3 KiB
HTML

{{template "shellTop" "ecosystem"}}
<h1>Ecosystem</h1>
<p class=hint>The sibling services Maven coordinates — read-only. Identity, attention, capabilities. Enabling &amp; execution live on the authed surfaces, never here.</p>
<section class=card id=eco-nexus>
<div class=section-header>
<h2>Nexus <span class=card-sub>identity</span></h2>
</div>
{{with .Nexus}}
{{if .Err}}<div class=empty>nexus — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>no entities yet.</div>
{{else}}<div class=scroll><table class=mono><tr><th>id<th>type<th>name<th>state<th>updated</tr>
{{range .Rows}}<tr><td class=key>{{.ID}}<td><span class=badge>{{.Type}}</span><td class=en>{{.DisplayName}}<td>{{.State}}<td>{{ago .UpdatedAt}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
<section class=card id=eco-praxis>
<div class=section-header>
<h2>Praxis <span class=card-sub>attention</span></h2>
</div>
{{with .Praxis}}
{{if .Err}}<div class=empty>praxis — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>nothing needs attention.</div>
{{else}}<div class=scroll><table class=mono><tr><th>imp<th>kind<th>title<th>state<th>last seen</tr>
{{range .Rows}}<tr><td>{{.Importance}}<td><span class=badge>{{.Kind}}</span><td class=en>{{.Title}}<td>{{.State}}<td>{{ago .LastSeenAt}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
<section class=card id=eco-hexis>
<div class=section-header>
<h2>Hexis <span class=card-sub>capabilities</span></h2>
</div>
{{with .Hexis}}
{{if .Err}}<div class=empty>hexis — {{.Err}}</div>
{{else if not .Rows}}<div class=empty>no capabilities registered.</div>
{{else}}<div class=scroll><table class=mono><tr><th>id<th>name<th>provider<th>operation<th>risk<th>access</tr>
{{range .Rows}}<tr><td class=key>{{.ID}}<td class=en>{{.Name}}<td><span class=badge>{{.Provider}}</span><td>{{.Operation}}<td>{{.Risk}}<td>{{if .ReadOnly}}<span class="badge badge-ok">read-only</span>{{else}}<span class="badge badge-warn">mutating</span>{{end}}</tr>{{end}}
</table></div>{{end}}
{{end}}
</section>
{{template "shellBottom"}}
<script>
setInterval(() => fetch('/ecosystem').then(r => r.text()).then(html => {
const d = new DOMParser().parseFromString(html, 'text/html');
for (const id of ['eco-nexus', 'eco-praxis', 'eco-hexis']) {
const old = document.getElementById(id), nu = d.getElementById(id);
if (old && nu) old.replaceWith(nu);
}
}), 15000);
</script>
</html>