Spaces:
Running
Running
Create config.js
Browse files- static/config.js +14 -0
static/config.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function getConfig() {
|
2 |
+
apiGet('/config/get')
|
3 |
+
.then(data => {
|
4 |
+
document.getElementById('config-json').value = JSON.stringify(data, null, 2);
|
5 |
+
})
|
6 |
+
.catch(err => console.error(err));
|
7 |
+
}
|
8 |
+
|
9 |
+
function updateConfig() {
|
10 |
+
const config = JSON.parse(document.getElementById('config-json').value);
|
11 |
+
apiPost('/config/update', config)
|
12 |
+
.then(data => showResult('config-result', data))
|
13 |
+
.catch(err => console.error(err));
|
14 |
+
}
|