-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
164 lines (158 loc) · 6.32 KB
/
index.html
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Vaccine Impact Modelling Consortium - Montagu</title>
<link rel="stylesheet" href="resources/css/third_party/bootstrap.min.css"/>
<link rel="stylesheet" href="resources/css/montagu.css"/>
<script src="resources/js/third_party/jquery.min.js"></script>
<script src="resources/js/third_party/jwt-decode.min.js"></script>
<script src="resources/js/third_party/vue.min.js"></script>
<script src="resources/js/third_party/pako.min.js"></script>
<script src="resources/js/montagu-login.js"></script>
<script src="resources/js/montagu-auth.js"></script>
<script src="resources/js/montagu-utils.js"></script>
<script src="resources/js/components/montagu-login-status.vue.js"></script>
<script src="resources/js/components/montagu-login-form.vue.js"></script>
</head>
<body>
<div id="app">
<header class="header">
<a href="https://vaccineimpact.org">
<img class="pl-md-1 logo" src="./resources/logo.png" alt="Vaccine Impact Modelling Consortium"/>
</a>
<div class="siteTitle">Montagu</div>
<montagu-login-status v-bind:username="username" v-on:logout="logout"
class="login-status"></montagu-login-status>
</header>
<div id="content" class="container mt-3">
<p>
Montagu is the VIMC's digital delivery platform. Authorised
users can access Montagu through user-facing portals, and
programmatically through REST APIs.
</p>
<p>
Click <a href="/resources/privacy.html">here</a> to view Montagu's privacy policy and terms.
</p>
<p>
Click <a href="https://vaccineimpact.org">here</a> to return to
VIMC home page.
</p>
<montagu-login-form v-bind:username="username" v-bind:login-error="loginError"
v-bind:redirect-message="redirectMessage"
v-on:login="login" class="login-form"></montagu-login-form>
<div class="portals">
<h1>Portals</h1>
<table>
<tr>
<td class="portal"><a class="button" href="/reports/">Reporting portal</a></td>
<td>
Access reports and figures summarising results, as well
as the underlying data.
</td>
</tr>
<tr>
<td class="portal"><a class="button" href="/contribution/">Modellers' contribution portal</a></td>
<td>
Focused on modellers and modelling groups, this portal
allows you to download coverage and demographic data,
and to upload burden estimates.
</td>
</tr>
<tr>
<td class="portal"><a class="button" href="/admin/">Admin portal</a></td>
<td>
For internal use by the consortium admin staff.
</td>
</tr>
</table>
<h1>Resources</h1>
<table>
<tr>
<td class="portal"><a class="button" href="/reports/project-docs/">Key project documents</a></td>
<td>
Access all VIMC documentation.
</td>
</tr>
</table>
</div>
<div class="apis">
<h1>APIs</h1>
<table>
<tr>
<td><a class="button" href="/api/">Montagu API</a></td>
<td><a class="button" href="/reports/api/v1/">Reports API</a></td>
</tr>
</table>
</div>
</div>
</div>
</body>
<script>
const utils = MontaguUtils;
const auth = new MontaguAuth(utils.getApiRoot());
const logic = new MontaguLogin(
auth,
jwt_decode,
pako
);
new Vue({
el: "#app",
data: {
username: "",
loginError: "",
redirectMessage: ""
},
methods: {
initialise: function () {
const data = this;
logic.getUserName().then((result) => {
data.username = result;
const redirectLocation = utils.paramFromQueryString(location.search, "redirectTo");
if (result && redirectLocation) {
data.redirectMessage = `Redirecting you back to ${redirectLocation}.
If you are not automatically redirected in a few seconds please click <a href="${redirectLocation}">here</a>`;
window.location.href = redirectLocation
}
})
},
logout: function () {
const data = this;
logic.logout().then(
() => {
data.username = '';
data.loginError = '';
},
(error) => {
data.username = '';
data.loginError = error
}
);
},
login: function (email, password) {
const data = this;
logic.login(email, password).then(
(result) => {
data.username = result;
data.loginError = '';
const redirectLocation = utils.paramFromQueryString(location.search, "redirectTo");
if (redirectLocation) {
data.redirectMessage = `Redirecting you back to ${redirectLocation}.
If you are not automatically redirected in a few seconds please click <a href="${redirectLocation}">here</a>`;
window.location.href = redirectLocation
}
},
(error) => {
data.username = '';
data.loginError = error;
}
);
}
},
components: {
'montagu-login-status': MontaguLoginStatus,
'montagu-login-form': MontaguLoginForm
}
}).initialise();
</script>
</html>