Disable regenerate button while embeddings are being regenerated

This commit is contained in:
Saba 2021-11-28 13:45:00 -05:00
parent 5d50487d83
commit 112868962b
2 changed files with 13 additions and 1 deletions

View file

@ -35,9 +35,16 @@ fetch("/config")
var regenerateButton = document.getElementById("config-regenerate");
regenerateButton.addEventListener("click", (event) => {
event.preventDefault();
regenerateButton.style.cursor = "progress";
regenerateButton.disabled = true;
fetch("/regenerate")
.then(response => response.json())
.then(data => console.log(data));
.then(data => () =>
{
regenerateButton.style.cursor = "pointer";
regenerateButton.disabled = false;
console.log(data);
});
})
function processChildren(element, data) {

View file

@ -21,4 +21,9 @@ div.config-title {
span.config-element-value {
color: var(--complementary-color);
font-weight: normal;
cursor: pointer;
}
button {
cursor: pointer;
}