Compare commits
2 Commits
2ee90cd0d7
...
8704aee82e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8704aee82e | ||
|
|
594ac1fa00 |
@@ -21,7 +21,8 @@ RUN apk add --no-cache \
|
|||||||
tk-dev \
|
tk-dev \
|
||||||
tcl-dev \
|
tcl-dev \
|
||||||
libwebp-dev \
|
libwebp-dev \
|
||||||
tesseract-ocr
|
tesseract-ocr \
|
||||||
|
tesseract-ocr-data-deu
|
||||||
RUN python -m ensurepip --upgrade
|
RUN python -m ensurepip --upgrade
|
||||||
RUN pip install setuptools wheel
|
RUN pip install setuptools wheel
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|||||||
@@ -284,9 +284,8 @@ function submitPdf(eve) {
|
|||||||
}
|
}
|
||||||
async function submitForm(formData) {
|
async function submitForm(formData) {
|
||||||
try {
|
try {
|
||||||
const updateEventSource = new EventSource(
|
const updateEventSource = new EventSource("/get_censor_status/" + doc.fID);
|
||||||
window.location + "get_censor_status/" + doc.fID,
|
|
||||||
);
|
|
||||||
modal.style.display = "flex";
|
modal.style.display = "flex";
|
||||||
// console.log("http://127.0.0.1:8000/get_censor_status/" + doc.fID);
|
// console.log("http://127.0.0.1:8000/get_censor_status/" + doc.fID);
|
||||||
updateEventSource.addEventListener("censorUpdate", function(eve) {
|
updateEventSource.addEventListener("censorUpdate", function(eve) {
|
||||||
@@ -295,6 +294,12 @@ async function submitForm(formData) {
|
|||||||
upload_status.innerText =
|
upload_status.innerText =
|
||||||
"Censoring Page " + data.page + "/" + data.pages;
|
"Censoring Page " + data.page + "/" + data.pages;
|
||||||
});
|
});
|
||||||
|
} catch {
|
||||||
|
console.error(
|
||||||
|
"Error geting eventsource for updating censoring page count: " + error,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
try {
|
||||||
const response = await fetch("/submit/", {
|
const response = await fetch("/submit/", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
@@ -320,7 +325,7 @@ async function submitForm(formData) {
|
|||||||
window.alert("Error: " + (await response.json())["detail"]);
|
window.alert("Error: " + (await response.json())["detail"]);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error" + error);
|
console.error("Error submitting: " + error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function uploadPdf(eve) {
|
function uploadPdf(eve) {
|
||||||
|
|||||||
Reference in New Issue
Block a user