datagraph/views/pages/app.gotmpl
2025-07-02 18:02:09 +02:00

16 lines
371 B
Go Template

{{ define "page" }}
<script type="module" defer>
import { TreeNode } from '/js/{{ .VERSION }}/app.mjs'
window._VERSION = '{{ .VERSION }}'
fetch('/nodes/tree/0?depth=2')
.then(data => data.json())
.then(json => {
const top = document.getElementById('nodes')
const topNode = new TreeNode(top, json)
topNode.render()
})
</script>
<div id="nodes"></div>
{{ end }}