Browse Source

checkpoint

webui
Antonio SJ Musumeci 1 week ago
parent
commit
ab003ec52b
  1. 38
      index.html

38
index.html

@ -380,22 +380,24 @@
input.type = 'text';
input.value = v;
input.style.width = '100%';
input.onkeydown = function(e) {
if (e.key === 'Enter') {
const postUrl = '/kvs?mount=' + encodeURIComponent(mount);
fetch(postUrl, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({[k]: input.value})
}).then(response => {
if (!response.ok) {
response.text().then(body => {
alert('Status: ' + response.status + '\nBody: ' + body);
});
}
});
}
};
input.onkeydown = function(e) {
if (e.key === 'Enter') {
const key = encodeURIComponent(k)
const mount_uri = encodeURIComponent(mount)
const postUrl = `/kvs/${key}?mount=${mount}`
fetch(postUrl, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(input.value)
}).then(response => {
if (!response.ok) {
response.text().then(body => {
alert('Status: ' + response.status + '\nBody: ' + body);
});
}
});
}
};
valueCell.appendChild(input);
row.appendChild(keyCell);
row.appendChild(valueCell);
@ -595,10 +597,10 @@
}
});
const branchesStr = branches.join(':');
fetch('/kvs?mount=' + encodeURIComponent(mount), {
fetch(`/kvs/branches?mount=${encodeURIComponent(mount)}`, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({"branches": branchesStr})
body: JSON.stringify(branchesStr)
}).then(response => {
if (!response.ok) {
response.text().then(body => {

Loading…
Cancel
Save