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