From 5a319c8eb672dce8dd244b934134a57c01f6a40d Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 7 Aug 2020 01:45:58 -0400 Subject: [PATCH] swapped server back to dev server on this branch. Added more json parsing to the downloadReturn function. --- main.py | 4 ++-- templates/index.html | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 8bfb309..7cf154b 100644 --- a/main.py +++ b/main.py @@ -231,5 +231,5 @@ def test(): return jsonify(mangaInfo) if __name__ == "__main__": - #app.run(host='0.0.0.0', debug=True) - serve(app, host='0.0.0.0', port=8000) + app.run(host='0.0.0.0', debug=True) + #serve(app, host='0.0.0.0', port=8000) diff --git a/templates/index.html b/templates/index.html index 3c258d3..058bd7f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -75,7 +75,8 @@ fetch('/download') .then(response => response.json()) - .then(function(data){ + .then(function(data){ + for (i=0; data.manga.length; i++) { manga = data.manga[i]; var div = document.createElement('div'); @@ -83,6 +84,22 @@ div.innerHTML = manga.title + "
"; document.getElementById("updated").appendChild(div); }; + + for (i=0; data.missingFlags;i++){ + manga = data.missingFlags[i]; + var div = document.createElement('div'); + div.setAttribute('id', 'flag'+i) + div.innerHTML = manga + '
'; + document.getElementById('missingFlags').appendChild('div'); + }; + + for (i=0; data.missingManga.length; i++){ + manga = data.missingManga[i]; + var div = document.createElement('div'); + div.setAttribute('id', 'missing'+i); + div.innerHTML = manga.name + '
'; + document.getElementById('missingManga').appendChild('div'); + }; }); };