connect js to main.py

This commit is contained in:
SowinskiBraeden committed 2022-11-06 20:14:15 -08:00
1 parent 7b909b770b
commit 37b961745d
10 files changed
+56 -39

No files matched your search

+17 -30
View File
@@ -1,38 +1,25 @@
function start() {
let file = document.getElementById("input_file");
let blockClassLimit = document.getElementById("classrooms").value;
let file = document.getElementById("input_file").files[0];
let minReq = document.getElementById("min_req").value;
let classCap = document.getElementById("class_cap").value;
let blockClassLimit = document.getElementById("classrooms").value;
let totalBlocks = document.getElementById("total_blocks").value;
// start animation
document.getElementById('main').style.display = 'none';
document.getElementById('processing').style.display = 'block';
console.log(file);
}
let reader = new FileReader()
reader.addEventListener("load", () => {
let raw = reader.result;
eel.start(raw, minReq, classCap, blockClassLimit, totalBlocks)(start_callback);
}, false);
function summation() {
var data_1 = document.getElementById("int1").value;
var data_2 = document.getElementById("int2").value;
eel.add(data_1, data_2)(call_Back);
}
function call_Back(output){
document.getElementById("res").value = output;
}
var i = 0;
function move() {
if (i == 0) {
i = 1;
var elem = document.getElementById("myBar");
var width = 1;
var id = setInterval(frame, 10);
function frame() {
if (width >= 100) {
clearInterval(id);
i = 0;
} else {
width++;
elem.style.width = width + "%";
}
}
if (file) {
reader.readAsText(file);
}
}
function start_callback(error) {
console.log(error, 'done')
}