minor fixes
This commit is contained in:
@@ -9,42 +9,24 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import datetime
|
import datetime
|
||||||
|
import base64
|
||||||
|
|
||||||
class S(BaseHTTPRequestHandler):
|
class S(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
def do_OPTIONS(self):
|
def do_OPTIONS(self):
|
||||||
self.send_response(200, "ok")
|
self.send_response(200, "ok")
|
||||||
# TODO remove in production
|
|
||||||
self.send_header('Access-Control-Allow-Origin', '*')
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS')
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header("Access-Control-Allow-Headers", "X-Requested-With")
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header("Access-Control-Allow-Headers", "Content-Type")
|
|
||||||
self.end_headers()
|
|
||||||
|
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header('Content-Type', 'application/json')
|
self.send_header('Content-Type', 'application/json')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
with open('schedule.json', 'r') as file:
|
with open('data/schedule.json', 'r') as file:
|
||||||
schedule_string = json.load(file)
|
schedule_string = json.load(file)
|
||||||
|
|
||||||
self.wfile.write(json.dumps(schedule_string).encode('utf-8'))
|
self.wfile.write(json.dumps(schedule_string).encode('utf-8'))
|
||||||
|
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
|
|
||||||
self.send_response(200, "ok")
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header('Access-Control-Allow-Origin', '*')
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS')
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header("Access-Control-Allow-Headers", "X-Requested-With")
|
|
||||||
# TODO remove in production
|
|
||||||
self.send_header("Access-Control-Allow-Headers", "Content-Type")
|
|
||||||
self.end_headers()
|
|
||||||
content_length = int(self.headers['Content-Length'])
|
content_length = int(self.headers['Content-Length'])
|
||||||
request_raw = self.rfile.read(content_length)
|
request_raw = self.rfile.read(content_length)
|
||||||
request_content = json.loads(request_raw)
|
request_content = json.loads(request_raw)
|
||||||
@@ -52,8 +34,9 @@ class S(BaseHTTPRequestHandler):
|
|||||||
pw = request_content['pw']
|
pw = request_content['pw']
|
||||||
caption = request_content['caption']
|
caption = request_content['caption']
|
||||||
heading = request_content['heading']
|
heading = request_content['heading']
|
||||||
|
image = request_content['image']
|
||||||
|
|
||||||
if pw != '123':
|
if pw != 'kurswerk':
|
||||||
self.send_response(401)
|
self.send_response(401)
|
||||||
self.send_header('Content-Type', 'text/html')
|
self.send_header('Content-Type', 'text/html')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
@@ -65,13 +48,16 @@ class S(BaseHTTPRequestHandler):
|
|||||||
schedule_and_caption['heading'] = heading
|
schedule_and_caption['heading'] = heading
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
try:
|
try:
|
||||||
os.rename('schedule.json', 'schedule_{}.json'.format(now.strftime("%Y%m%d")))
|
os.rename('data/schedule.json', 'data/schedule_{}.json'.format(now.strftime("%Y%m%d")))
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.info('Backup exists, did not backup..')
|
logging.info('Backup exists, did not backup..')
|
||||||
pass
|
pass
|
||||||
with open('schedule.json', 'w') as file:
|
with open('data/schedule.json', 'w') as file:
|
||||||
json.dump(schedule_and_caption, file)
|
json.dump(schedule_and_caption, file)
|
||||||
|
|
||||||
|
with open('data/schedule.jpg', 'wb') as f:
|
||||||
|
f.write(base64.b64decode(image))
|
||||||
|
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header('Content-Type', 'text/html')
|
self.send_header('Content-Type', 'text/html')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|||||||
58
backend/nginx.conf
Normal file
58
backend/nginx.conf
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
user nginx;
|
||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
disable_symlinks off;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
upstream backend {
|
||||||
|
server kurswerkstatt-pan_backend:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_read_timeout 300s;
|
||||||
|
proxy_connect_timeout 75s;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_pass http://backend;
|
||||||
|
proxy_set_header Host $host ;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
||||||
|
}
|
||||||
BIN
data/schedule.jpg
Normal file
BIN
data/schedule.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 KiB |
1
data/schedule.json
Normal file
1
data/schedule.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schedule": {"Montag": [{"from": "09:00", "to": "10:00", "title": "Pilates #"}, {}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{"from": "09:00", "to": "10:00", "title": "Fit f\u00fcr Dich\n(mit Julia)"}, {"from": "10:15", "to": "11:30", "title": "R\u00fcckbildung\n(mit Julia)"}, {}, {}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:00", "title": "Babymassage\n(mit Julia)"}, {}, {}, {}, {"from": "17:30", "to": "18:30", "title": "Fit f\u00fcr Dich\n(mit Julia)"}, {}], "Donnerstag": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung \n(mit Julia)"}, {}, {}, {}, {"from": "18:15", "to": "19:45", "title": "Progressive \nMuskelentspannung \n(n. Jacobsen) \""}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Still-\n und Elterntreff *\n(1x im Monat)"}, {}, {}, {}, {}, {}], "Samstag": [{}, {}, {}, {}, {}, {}]}, "caption": "# mit Physiotherapeutin Timea Sobotta\n\" mit Physiotherapeutin Felicitas Sch\u00f6nberger\n* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\n", "heading": "Stundenplan 2020"}
|
||||||
1
data/schedule_20191120.json
Normal file
1
data/schedule_20191120.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schedule": {"Montag": [{"from": "09:00", "to": "10:15", "title": "Hatha Joga"}, {"from": "10:30", "to": "11:45", "title": "Joga f\u00fcr Schwangere"}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{}, {}, {"from": "15:30", "to": "16:30", "title": "Musikgarten"}, {"from": "18:00", "to": "19:30", "title": "Hatha/Vinjasa Yoga"}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung"}, {"from": "10:30", "to": "11:30", "title": "Fit f\u00fcr Dich"}, {}, {}, {}, {}], "Donnerstag": [{"from": "09:00", "to": "10:00", "title": "Babymassage"}, {"from": "10:00", "to": "11:15", "title": "R\u00fcckbildung"}, {}, {}, {}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Stilltreff * 2 w\u00f6chentlich"}, {}, {"from": "16:00", "to": "19:00", "title": "Geburtsvorbereitung"}, {}, {}, {}], "Samstag": [{"from": "09:00", "to": "12:00", "title": "Geburtsvorbereitung"}, {}, {}, {}, {}, {}]}, "caption": "* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\nf\u00fcr mehr Angebote rund um Mama/Baby www.stillberatungimrottal.de", "heading": "Stundenplan 2019"}
|
||||||
1
data/schedule_20191121.json
Normal file
1
data/schedule_20191121.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schedule": {"Montag": [{"from": "09:00", "to": "10:15", "title": "Hatha Joga"}, {"from": "10:30", "to": "11:45", "title": "Joga f\u00fcr Schwangere"}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{}, {}, {"from": "15:30", "to": "16:30", "title": "Musikgarten"}, {"from": "18:00", "to": "19:30", "title": "Hatha/Vinjasa Yoga"}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung"}, {"from": "10:30", "to": "11:30", "title": "Fit f\u00fcr Dich"}, {}, {}, {}, {}], "Donnerstag": [{"from": "09:00", "to": "10:00", "title": "Babymassage"}, {"from": "10:00", "to": "11:15", "title": "R\u00fcckbildung"}, {}, {}, {}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Stilltreff * 2 w\u00f6chentlich"}, {}, {"from": "16:00", "to": "19:00", "title": "Geburtsvorbereitung"}, {}, {}, {}], "Samstag": [{"from": "09:00", "to": "12:00", "title": "Geburtsvorbereitung"}, {}, {}, {}, {}, {}]}, "caption": "* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\nf\u00fcr mehr Angebote rund um Mama/Baby www.stillberatungimrottal.de", "heading": "Stundenplan 2019"}
|
||||||
1
data/schedule_20191122.json
Normal file
1
data/schedule_20191122.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schedule": {"Montag": [{"from": "09:00", "to": "10:15", "title": "Hatha Yoga"}, {"from": "10:30", "to": "11:45", "title": "Joga f\u00fcr Schwangere"}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{}, {}, {"from": "15:30", "to": "16:30", "title": "Musikgarten"}, {"from": "18:00", "to": "19:30", "title": "Hatha/Vinjasa Yoga"}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung"}, {"from": "10:30", "to": "11:30", "title": "Fit f\u00fcr Dich"}, {}, {}, {}, {}], "Donnerstag": [{"from": "09:00", "to": "10:00", "title": "Babymassage"}, {"from": "10:00", "to": "11:15", "title": "R\u00fcckbildung"}, {}, {}, {}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Stilltreff * 2 w\u00f6chentlich"}, {}, {"from": "16:00", "to": "19:00", "title": "Geburtsvorbereitung"}, {}, {}, {}], "Samstag": [{"from": "09:00", "to": "12:00", "title": "Geburtsvorbereitung"}, {}, {}, {}, {}, {}]}, "caption": "* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\nf\u00fcr mehr Angebote rund um Mama/Baby www.stillberatungimrottal.de", "heading": "Stundenplan 2019"}
|
||||||
1
data/schedule_20200308.json
Normal file
1
data/schedule_20200308.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schedule": {"Montag": [{"from": "09:00", "to": "10:00", "title": "Pilates #"}, {}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{"from": "09:00", "to": "10:00", "title": "Fit f\u00fcr Dich\n(mit Julia)"}, {"from": "10:15", "to": "11:30", "title": "R\u00fcckbildung\n(mit Julia)"}, {}, {}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:00", "title": "Babymassage\n(mit Julia)"}, {}, {}, {}, {"from": "17:30", "to": "18:30", "title": "Fit f\u00fcr Dich\n(mit Julia)"}, {}], "Donnerstag": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung \n(mit Julia)"}, {}, {}, {}, {"from": "18:15", "to": "19:45", "title": "Progressive \nMuskelentspannung \n(n. Jacobsen) \""}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Still-\n und Elterntreff *\n(1x im Monat)"}, {}, {}, {}, {}, {}], "Samstag": [{}, {}, {}, {}, {}, {}]}, "caption": "# mit Physiotherapeutin Timea Sobotta\n\" mit Physiotherapeutin Felicitas Sch\u00f6nberger\n* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\n", "heading": "Stundenplan 2020"}
|
||||||
@@ -196,7 +196,8 @@
|
|||||||
<h4 class="text-center text-uppercase text-secondary mb-3">Stundenplan 2019</h4>
|
<h4 class="text-center text-uppercase text-secondary mb-3">Stundenplan 2019</h4>
|
||||||
<br>
|
<br>
|
||||||
<div class="Image">
|
<div class="Image">
|
||||||
<img class="img-responsive100" src="img/portfolio/Stundenplan.jpg" alt="">
|
<!-- <img class="img-responsive100" src="img/portfolio/Stundenplan.jpg" alt="Stundenplan 2019"> -->
|
||||||
|
<img class="img-responsive100" src="data/schedule.jpg" alt="Stundenplan">
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -496,6 +497,12 @@
|
|||||||
<!-- Custom scripts for this template -->
|
<!-- Custom scripts for this template -->
|
||||||
<script src="js/freelancer.min.js"></script>
|
<script src="js/freelancer.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
$("#schedule-placeholder").load("view-schedule.html");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- development version, includes helpful console warnings -->
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script><!-- production version, optimized for size and speed -->
|
<!-- development version, includes helpful console warnings -->
|
||||||
<!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script>-->
|
<!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
|
||||||
|
<!-- production version, optimized for size and speed -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.js"></script>
|
||||||
<title>Stundenplan Pflege</title>
|
<title>Stundenplan Pflege</title>
|
||||||
@@ -13,6 +16,11 @@
|
|||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#edit-heading {
|
||||||
|
font-size: x-large;
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
#editmode input {
|
#editmode input {
|
||||||
border: 0;
|
border: 0;
|
||||||
/* color: white;
|
/* color: white;
|
||||||
@@ -34,8 +42,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#readonly-heading {
|
#readonly-heading {
|
||||||
font-size: x-large;
|
font-size: xx-large;
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#readonly-table {
|
#readonly-table {
|
||||||
@@ -97,7 +106,7 @@
|
|||||||
<p style="text-align: center"><span style="white-space: pre-line;">{{caption}}</span></p>
|
<p style="text-align: center"><span style="white-space: pre-line;">{{caption}}</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div id="editmode">
|
<div id="editmode">
|
||||||
<input type="text"
|
<input id="edit-heading" type="text"
|
||||||
v-model="heading">
|
v-model="heading">
|
||||||
<table id="table"
|
<table id="table"
|
||||||
ref="table"
|
ref="table"
|
||||||
@@ -121,7 +130,7 @@
|
|||||||
v-model="getSchuduleItem(day, slot).to"></p>
|
v-model="getSchuduleItem(day, slot).to"></p>
|
||||||
<p id="item-title">
|
<p id="item-title">
|
||||||
<textarea v-model="getSchuduleItem(day, slot).title"></textarea></p>
|
<textarea v-model="getSchuduleItem(day, slot).title"></textarea></p>
|
||||||
</div>Eingaben löschen
|
</div><input type="button" v-on:click="resetScheduleItem(day, slot)" value="Zurücksetzen">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table><input style="border: 1px solid black"
|
</table><input style="border: 1px solid black"
|
||||||
@@ -145,11 +154,30 @@
|
|||||||
amountSlots: 6,
|
amountSlots: 6,
|
||||||
pw: "Passwort",
|
pw: "Passwort",
|
||||||
heading: "Stundenplan 2019",
|
heading: "Stundenplan 2019",
|
||||||
caption: "* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\nf\u00fcr mehr Angebote rund um Mama/Baby www.stillberatungimrottal.de",
|
caption: "* mit Stillberaterin und Kinderkrankenschwester Rhianon Grill\nfür mehr Angebote rund um Mama/Baby www.stillberatungimrottal.de",
|
||||||
scheduleData:{"Montag": [{"from": "09:00", "to": "10:15", "title": "Hatha Joga"}, {"from": "10:30", "to": "11:45", "title": "Joga f\u00fcr Schwangere"}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{}, {}, {"from": "15:30", "to": "16:30", "title": "Musikgarten"}, {"from": "18:00", "to": "19:30", "title": "Hatha/Vinjasa Yoga"}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:15", "title": "R\u00fcckbildung"}, {"from": "10:30", "to": "11:30", "title": "Fit f\u00fcr Dich"}, {}, {}, {}, {}], "Donnerstag": [{"from": "09:00", "to": "10:00", "title": "Babymassage"}, {"from": "10:00", "to": "11:15", "title": "R\u00fcckbildung"}, {}, {}, {}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Stilltreff * 2 w\u00f6chentlich"}, {}, {"from": "16:00", "to": "19:00", "title": "Geburtsvorbereitung"}, {}, {}, {}], "Samstag": [{"from": "09:00", "to": "12:00", "title": "Geburtsvorbereitung"}, {}, {}, {}, {}, {}]}
|
scheduleData:{"Montag": [{"from": "09:00", "to": "10:15", "title": "Hatha Joga"}, {"from": "10:30", "to": "11:45", "title": "Joga für Schwangere"}, {}, {"title": ""}, {"from": "", "to": "", "title": ""}, {}], "Dienstag": [{}, {}, {"from": "15:30", "to": "16:30", "title": "Musikgarten"}, {"from": "18:00", "to": "19:30", "title": "Hatha/Vinjasa Yoga"}, {}, {}], "Mittwoch": [{"from": "09:00", "to": "10:15", "title": "Rückbildung"}, {"from": "10:30", "to": "11:30", "title": "Fit für Dich"}, {}, {}, {}, {}], "Donnerstag": [{"from": "09:00", "to": "10:00", "title": "Babymassage"}, {"from": "10:00", "to": "11:15", "title": "Rückbildung"}, {}, {}, {}, {}], "Freitag": [{"from": "09:00", "to": "10:30", "title": "Stilltreff * 2 wöchentlich"}, {}, {"from": "16:00", "to": "19:00", "title": "Geburtsvorbereitung"}, {}, {}, {}], "Samstag": [{"from": "09:00", "to": "12:00", "title": "Geburtsvorbereitung"}, {}, {}, {}, {}, {}]}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
|
||||||
|
if (this.readyState != 4) return;
|
||||||
|
if (this.status == 200) {
|
||||||
|
var data = JSON.parse(this.response);
|
||||||
|
window.app.restoreSettings(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.open("GET", "https://beta.kurswerkstatt-pan.de/api/schedule", true);
|
||||||
|
xhr.send();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
restoreSettings: function(data) {
|
||||||
|
this.scheduleData = data.schedule;
|
||||||
|
this.heading = data.heading;
|
||||||
|
this.caption = data.caption;
|
||||||
|
},
|
||||||
getSchuduleItem: function(day, slot) {
|
getSchuduleItem: function(day, slot) {
|
||||||
return this.scheduleData[day][slot-1];
|
return this.scheduleData[day][slot-1];
|
||||||
},
|
},
|
||||||
@@ -161,21 +189,25 @@
|
|||||||
saveSchedule: function() {
|
saveSchedule: function() {
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
// xhr.open("POST", "https://kurswerkstatt-pan.de/api/schedule", true);
|
xhr.open("POST", "https://beta.kurswerkstatt-pan.de/api/schedule", true);
|
||||||
xhr.open("POST", "http://localhost:8080", true);
|
|
||||||
xhr.setRequestHeader('Content-Type', 'application/html');
|
xhr.setRequestHeader('Content-Type', 'application/html');
|
||||||
xhr.onload = function(e) {
|
xhr.onload = function(e) {
|
||||||
alert("Gespeichert")
|
e.target.status === 200 ? alert("Gespeichert") : alert("Fehler: Falsches Passwort?")
|
||||||
}
|
}
|
||||||
xhr.onerror = function(e) {
|
xhr.onerror = function(e) {
|
||||||
alert("Fehler: \"Datei exportieren\"-Button klicken und Datei Felix schicken")
|
alert("Fehler: \"Datei exportieren\"-Button klicken und Datei Felix schicken")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
domtoimage.toJpeg(document.getElementById('readonlydiv'), { quality: 0.95 })
|
||||||
|
.then((scheduleImage) => {
|
||||||
xhr.send(JSON.stringify({
|
xhr.send(JSON.stringify({
|
||||||
pw: this.pw,
|
pw: this.pw,
|
||||||
schedule: this.scheduleData,
|
schedule: this.scheduleData,
|
||||||
caption: this.caption,
|
caption: this.caption,
|
||||||
heading: this.heading
|
heading: this.heading,
|
||||||
|
image: scheduleImage.split(',')[1]
|
||||||
}));
|
}));
|
||||||
|
})
|
||||||
},
|
},
|
||||||
scheduleToImage: function () {
|
scheduleToImage: function () {
|
||||||
domtoimage.toJpeg(document.getElementById('readonlydiv'), { quality: 0.95 })
|
domtoimage.toJpeg(document.getElementById('readonlydiv'), { quality: 0.95 })
|
||||||
|
|||||||
Reference in New Issue
Block a user