Files
radixOS/public/views/integrated/serverconfig.hbs

37 lines
994 B
Handlebars

<header>
<style>
</style>
</header>
<body>
<div class="container static">
<div class="card" style="overflow: auto;height:100vh">
<div id="jsonConfigTree" class="json-tree"></div>
</div>
</div>
</div>
</body>
<script>
fetch('/api/getConfig', { method: 'POST' })
.then(res => res.json())
.then(json => {
const tree = createJsonTree({
container: document.getElementById("jsonConfigTree"),
data: json,
expandInitially: true,
onSave: json => {
console.log(JSON.stringify(tree.getChanges()));
fetch('/config', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(tree.getChanges(), null, 2)
}).then(() => writeEventLog(0, 'Serverconfig', JSON.stringify(tree.getChanges())) );
}
});
});
</script>