-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
109 lines (99 loc) · 3.36 KB
/
index.html
File metadata and controls
109 lines (99 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Computing Lab Problem Reporting</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f9f9f9;
color: #222;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
overflow: hidden;
}
h1 {
margin-top: 0;
font-size: 2rem;
font-weight: 600;
text-align: center;
}
p {
font-size: 1.1rem;
margin: 1rem 0;
text-align: center;
max-width: 500px;
}
a {
display: inline-block;
margin-top: 1.5rem;
padding: 0.75rem 1.5rem;
background: #047e8b;
color: #fff;
text-decoration: none;
font-size: 1rem;
transition: background 0.2s;
}
a:hover {
background: #036b76;
}
@media (max-width: 600px) {
body {
padding: 0.75rem;
}
}
</style>
</head>
<body>
<h1>UoL - Report a Problem</h1>
<p>
Having an issue with a PC or device in the lab? Please let us know using
this form!
</p>
<a href="http://lncn.ac/labsupport">Click here if you aren't redirected</a>
<script>
// Get the value of "desk" in eg "https://socstech.github.io/problem?desk=some-desk"
// and redirect them to the form with it filled in
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
// Go to forms fill in the field where you are collecting the desk identifier and then get a prefilled link,
// Once you have got you link, break it down and paste it below
// You should look at how it is structured
const formId =
"xEculd4FgkKDr19LRrFijwTvs3m7GDFAsDnE7dKUJVdUQlRMU1Y2WVEzVlg1V1MwSVdYS1g1SEVJNiQlQCN0PWcu";
const deskIdField = "r10b7c02a53504f6fa7a940eea572dfc8";
const roomField = "r6914b183b2b6448e9024cbb8c8ee59dd";
// Rooms to how they are added on the form
let roomOptions = {
"1A": "%22INB1102%20-%20Lab%201A%22",
"1B": "%22INB1301%20-%20Lab%201B%22",
"1C": "%22INB1101%20-%20Lab%201C%22",
"GL": "%22INB1305%20-%20Games%20Studio%22",
"XR": "%22INB1304%20-%XR%20Lab%22",
"2A": "%22INB2101%20-%20Lab%202A%22",
"2B": "%22INB2102%20-%20Lab%202B%22",
"2C": "%22INB2305%20-%20Lab%202C%22",
"2D": "%22INB2304%20-%20Lab%202D%22",
"2E": "%22INB2306%20-%20Lab%202E%22",
};
// Make upper case and match the rooms to the desk code.
const deskId = (params.desk || "")
.toUpperCase()
.replace("-WINDOWS", "")
.replace("-LINUX", "");
// Get the first part of the room code in the desk code and then match it to the list of options, or just leave it blank
const room = roomOptions[deskId.split("-")[0]] || "";
// Build the url and redirect the user
const url = `https://forms.office.com/Pages/ResponsePage.aspx?id=${formId}&${deskIdField}=${deskId}&${roomField}=${room}`;
//console.log({ url, deskId, room });
window.location.replace(url);
</script>
</body>
</html>