diff --git a/backend/backend.py b/backend/backend.py index 63510bf8..3eb8ae7d 100644 --- a/backend/backend.py +++ b/backend/backend.py @@ -107,7 +107,6 @@ def edit_page(): global messages uuid = request.args.get('uuid') - output = render_template("edit.html", uuid=uuid, watch=datastore.data['watching'][uuid], messages=messages) return output @@ -186,9 +185,20 @@ def api_update(): url = request.form.get('url').strip() tag = request.form.get('tag').strip() + form_headers = request.form.get('headers').strip().split("\n") + extra_headers = {} + if form_headers: + for header in form_headers: + if len(header): + parts = header.split(':', 1) + extra_headers.update({parts[0].strip(): parts[1].strip()}) + + + validators.url(url) #@todo switch to prop/attr/observer datastore.data['watching'][uuid].update({'url': url, - 'tag': tag}) + 'tag': tag, + 'headers':extra_headers}) #@todo switch to prop/attr/observer datastore.sync_to_json() diff --git a/backend/fetch_site_status.py b/backend/fetch_site_status.py index a3759a6d..fc6b2462 100644 --- a/backend/fetch_site_status.py +++ b/backend/fetch_site_status.py @@ -47,6 +47,7 @@ class perform_site_check(Thread): def run(self): + # Default headers headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', diff --git a/backend/static/css/styles.css b/backend/static/css/styles.css index abc1d12b..5f1a2c69 100644 --- a/backend/static/css/styles.css +++ b/backend/static/css/styles.css @@ -172,4 +172,8 @@ color: #fff; border-radius: 10px; color: #fff; font-weight: bold; - } \ No newline at end of file +} + +.pure-form label { +font-weight: bold; +} \ No newline at end of file diff --git a/backend/templates/edit.html b/backend/templates/edit.html index 5fdbd786..54ebaeb4 100644 --- a/backend/templates/edit.html +++ b/backend/templates/edit.html @@ -4,7 +4,7 @@