connect js to main.py
This commit is contained in:
10 files changed
+56
-39
No files matched your search
+2
-2
@@ -17,7 +17,7 @@
|
||||
<div class="shape"></div>
|
||||
<div class="shape"></div>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div id="main" class="main">
|
||||
<h3>Schedule Generator</h3>
|
||||
<label for="input_file">Input File (.csv)</label>
|
||||
<input
|
||||
@@ -85,7 +85,7 @@
|
||||
<button id="startBtn" onclick="start()">Generate</button>
|
||||
</div>
|
||||
|
||||
<div class="processing">
|
||||
<div id="processing" class="processing">
|
||||
<div id="myProgress">
|
||||
<div id="myBar"></div>
|
||||
</div>
|
||||
|
||||
+17
-30
@@ -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')
|
||||
}
|
||||
Reference in new issue
Block a user