ciyidogan commited on
Commit
f8d9344
·
verified ·
1 Parent(s): 1a9b474

Create config.js

Browse files
Files changed (1) hide show
  1. 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
+ }