Initial rendering of the node tree
This commit is contained in:
commit
c5bec0afa6
7477 changed files with 8513 additions and 0 deletions
11
views/layouts/main.gotmpl
Normal file
11
views/layouts/main.gotmpl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">{{ block "page" . }}{{ end }}</div>
|
||||
</body>
|
||||
</html>
|
||||
16
views/pages/app.gotmpl
Normal file
16
views/pages/app.gotmpl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{{ 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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue