Skip to content
Snippets Groups Projects
Commit f00d0a63 authored by Max Herting's avatar Max Herting
Browse files

appended port for query

parent 94d0acd0
No related branches found
No related tags found
No related merge requests found
/*$.getJSON("contents/feim.json", function(data){
let courses = [];
let appointments = {};
let ignore = [
"L.079.03520",
"L.105.95100",
"L.105.95101",
"L.105.95300",
"L.105.95301",
"L.079.05701",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"L.105.91100",
"L.105.91101",
"L.105.91300",
"L.105.91301",
"L.105.93100",
"L.105.93101",
"L.105.94100",
"L.105.94101",
"L.105.94300",
"L.105.94301",
];
data.forEach(function(course){
if((course.id.startsWith("L.079.") || course.id.startsWith("L.105."))){
if(course.appointments){
let day = null;
course.appointments.forEach(function(appointment){
day = moment(appointment.start_time, "YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD");
if(!(day in appointments)){
appointments[day] = [];
}
appointments[day].push({
name: course.name,
start: moment(appointment.start_time, "YYYY-MM-DD HH:mm:ss").format("HH:mm"),
end: moment(appointment.end_time, "YYYY-MM-DD HH:mm:ss").format("HH:mm"),
lecturer: appointment.instructors,
room: appointment.room
});
});
}
if(course.small_groups){
course.small_groups.forEach(function(group){
if(group.appointments){
let day = null;
group.appointments.forEach(function(appointment){
day = moment(appointment.start_time, "YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD");
if(!(day in appointments)){
appointments[day] = [];
}
appointments[day].push({
name: group.name,
start: moment(appointment.start_time, "YYYY-MM-DD HH:mm:ss").format("HH:mm"),
end: moment(appointment.end_time, "YYYY-MM-DD HH:mm:ss").format("HH:mm"),
lecturer: appointment.instructors,
room: appointment.room
});
});
}
});
}
}
});
console.log(appointments);
});*/
register_middle_content('<h4 class="display-4 mb-3">Anstehende Veranstaltungen</h4><table class="table table-striped"><thead><tr><th>Veranstaltung</th><th>Dozent:in</th><th>Uhrzeit</th><th>Raum</th></tr></thead><tbody id="courses"></tbody></table>', function () {
let deferred = new $.Deferred();
$.getJSON("https://dashboard.die-fachschaft.de/paulineToDashboardApi/appointments", function (appointments) {
// $.getJSON("http://127.0.0.1:3000/appointments", function (appointments) {
$.getJSON("https://dashboard.die-fachschaft.de:3001/paulineToDashboardApi/appointments", function (appointments) {
// $.getJSON("http://127.0.0.1:3001/appointments", function (appointments) {
appointments.forEach(function (appointment) {
$("#courses").append('<tr><td>' + appointment.name + '</td><td>' + appointment.instructor + '</td><td style="white-space: nowrap;">' + appointment.startTime + ' - ' + appointment.endTime + '</td><td>' + appointment.location + '</td></tr>');
});
MIDDLE_CONTENT_RETURN = Math.min(20000, 3000 + appointments.length * 1500);
MIDDLE_CONTENT_RETURN = Math.min(20000, 1000 + appointments.length * 500);
deferred.resolve();
})
.fail(function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment