37 lines
1004 B
Handlebars
37 lines
1004 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/config/get', { 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('/api/config/save', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(tree.getChanges(), null, 2)
|
|
}).then(() => writeEventLog(0, 'Serverconfig', JSON.stringify(tree.getChanges())) );
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|