V1 complete
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2021-10-07 10:04:32 +02:00
parent 6c93612737
commit 800ab0d9b7
3 changed files with 72 additions and 12 deletions

View File

@ -16,19 +16,43 @@
the middleware might not work as expected.</p>
<br>
<form>
<label for="raplalink">Your RaPla Link</label>
<label for="coursename">Choose your course</label>
<select id="coursename" name="coursename">
<option value="-1" selected>Course</option>
<option value="TINF19B1">TINF19B1</option>
<option value="TINF19B2">TINF19B2</option>
<option value="TINF19B3">TINF19B3</option>
<option value="TINF19B4">TINF19B4</option>
<option value="TINF19B5">TINF19B5</option>
<option value="TINF20B1">TINF20B1</option>
<option value="TINF20B2">TINF20B2</option>
<option value="TINF20B3">TINF20B3</option>
<option value="TINF20B4">TINF20B4</option>
<option value="TINF20B5">TINF20B5</option>
</select><br>
<label for="raplalink">If your course is not in the list, provide your RaPla Link here:</label>
<input name="raplalink" id="raplalink" type="text"><br>
<label for="hideBlockers">Hide Blockers</label>
<input name="hideBlockers" id="hideBlockers" type="checkbox"><br>
<label for="wahlmodul">Wahlmodul</label>
<select id="wahlmodul" name="wahlmodul">
<option value="1">WM1</option>
<option value="2">WM2</option>
<option value="" selected>Wahlmodul</option>
<option value="1">ERP-Systeme</option>
<option value="2">Ethik für Informatiker</option>
<option value="3">Evolutionäre Algorithmen</option>
<option value="4">Forensik</option>
<option value="5">Kryptographische Verfahren</option>
<option value="6">Robotik</option>
<option value="7">Web-Services</option>
</select><br>
<label for="profilmodul">Profilmodul</label>
<select id="profilmodul" name="profilmodul">
<option value="1">PM1</option>
<option value="2">PM2</option>
<option value="" selected>Profilmodul</option>
<option value="1">KI und BV</option>
<option value="2">Computergrafik</option>
<option value="3">KI und IS</option>
<option value="4">E-Business</option>
<option value="5">Netztechnik II</option>
</select><br>
<input type="button" id="submitBtn" value="Generate Link">
</form>

View File

@ -7,16 +7,46 @@ $(document).ready(function () {
});
function generateLink() {
let link = 'abc';
let selectedCourseFromPicker = $('#coursename').val().toString();
let raplaUser = '';
let raplaFile = '';
if (selectedCourseFromPicker === '-1') {
let providedRaPlaLink = $('#raplalink').val().toString();
console.log(providedRaPlaLink);
const urlParams = new URLSearchParams(providedRaPlaLink);
console.log(urlParams.keys());
console.log(urlParams.get('b'));
$('#full-link').text(link);
const url = new URL(providedRaPlaLink);
raplaUser = url.searchParams.get('user');
raplaFile = url.searchParams.get('file');
} else {
let courseInfo = courseLinks[selectedCourseFromPicker];
raplaUser = courseInfo.user;
raplaFile = courseInfo.file;
}
let showBlockers = $('#hideBlockers').is(':checked') ? 0 : 1;
let selectedElectiveModule = $('#wahlmodul').val().toString();
let selectedProfileModule = $('#profilmodul').val().toString();
let base_url = 'https://api.plutodev.de/rapla-middleware'
base_url += '?user=' + raplaUser;
base_url += '&file=' + raplaFile;
base_url += '&blockers=' + showBlockers;
base_url += '&wahl=' + selectedElectiveModule;
base_url += '&pflicht=' + selectedProfileModule;
$('#full-link').text(base_url);
}
let courseLinks = {
'TINF19B1': {user: 'freudenmann', file: 'TINF19B1'},
'TINF19B2': {user: 'braun', file: 'TINF19B2'},
'TINF19B3': {user: 'vollmer', file: 'tinf19b3'},
'TINF19B4': {user: 'eisenbiegler', file: 'TINF19B4'},
'TINF19B5': {user: 'strand', file: 'TINF19B5'},
'TINF20B1': {user: 'freudenmann', file: 'TINF20B1'},
'TINF20B2': {user: 'braun', file: 'TINF20B2'},
'TINF20B3': {user: 'vollmer', file: 'tinf20b3'},
'TINF20B4': {user: 'eisenbiegler', file: 'TINF20B4'},
'TINF20B5': {user: 'strand', file: 'TINF20B5'}
}

View File

@ -0,0 +1,6 @@
html,
body {
height: 100%;
background-color: #191718;
color: #E0E5E9;
}