forked from rwth-acis/OCD-Web-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
437 lines (435 loc) · 24.7 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE html>
<html>
<!-- Displays running OCD tasks, i.e. OCD algorithms, benchmarks and metrics in execution -->
<head>
<title>OCD - Overlapping Community Detection</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="CSS/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="CSS/layout.css">
<style type="text/css">
#welcomeMessage {
text-align: center;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="JS/jquery.session.js"></script>
<script src="//npmcdn.com/[email protected]/dist/js/tether.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/contentHandler.js"></script>
<script src="JS/ServiceAPI/b64.js"></script>
<script src="JS/ServiceAPI/moduleHelper.js"></script>
<script src="JS/ServiceAPI/serviceAPI.js"></script>
<script src="JS/requestHandler.js"></script>
<script src="JS/jquery.tablesorter.js"></script>
<script src="JS/coverTableHandler.js"></script>
<script src="JS/centralityTableHandler.js"></script>
<script type="text/javascript">
/* Information of covers/centrality maps in creation */
var algoCoverMetasXml;
var algoCentralityMetasXml;
var algoCooperationMetasXml;
/* Executed after page laoding */
$(document).ready(function() {
/*
* Register event handlers
*/
registerCollapsable("#runningAlgorithmsCollapsable", runningAlgorithmsCollapsableHandler);
registerCollapsable("#runningMetricsCollapsable", runningMetricsCollapsableHandler);
registerCollapsable('#runningCooperationSimulationCollapsable', runningCooperationSimulationCollapsableHandler);
registerCollapsable('#runningCentralityAlgorithmsCollapsable', runningCentralityAlgorithmsCollapsableHandler);
/*
* Open tables
*/
$("#runningAlgorithmsCollapsable").find(".collapsableDisplayBtn").click();
$("#runningMetricsCollapsable").find(".collapsableDisplayBtn").click();
$('#runningCooperationSimulationCollapsable').find(".collapsableDisplayBtn").click();
$('#runningCentralityAlgorithmsCollapsable').find(".collapsableDisplayBtn").click();
});
/* Handles collapsable element for covers in creation */
function runningAlgorithmsCollapsableHandler() {
if(typeof algoCoverMetasXml === 'undefined') {
/* Requests cover meta information of covers in creation */
getAlgoCoverMetas(function() {
/* Identifiers for the cover information to be displayed */
var cells = ["Name", "Graph", "CreationMethod", "R"];
/* Adds the cover to the table */
$(algoCoverMetasXml).find("Cover").each(function() {
appendCoverRow($('#runningAlgorithmsTable'), $(this), cells);
});
/*
* Sort Table
*/
try {
$("#runningAlgorithmsTable").tablesorter({sortList: [[0,0],[1,0]],
headers: { 5: { sorter: false}}});
} catch(err) { /* table empty */ }
/* Registers the table component */
registerCoverTable("#runningAlgorithmsTable");
});
}
}
/* Requests the meta information of covers in creation */
function getAlgoCoverMetas(callback) {
sendRequest("get", "covers?executionStatuses=RUNNING-WAITING&includeMeta=TRUE", "",
/* Response handler */
function(response) {
/*
* CoverMetas request succeeded
*/
algoCoverMetasXml = response;
if(typeof callback !== 'undefined') {
callback();
}
},
/* Error handler */
function(errorData) {
/*
* Cover metas request failed
*/
showConnectionErrorMessage("Cover metas were not received.");
});
}
/* Handles collapsable element for covers with metrics in execution */
function runningMetricsCollapsableHandler() {
if(typeof metricCoverMetasXml === 'undefined') {
/* Requests the cover information */
getMetricCoverMetas(function() {
/* Identifiers for the cover information to be displayed */
var cells = ["Name", "Graph", "CreationMethod"];
/* Adds covers to the table */
$(metricCoverMetasXml).find("Cover").each(function() {
var metricIds = [];
$(this).find("Metric").each(function() {
if($(this).find("Status").text() === "RUNNING") {
metricIds.push($(this).find("Id").text());
}
});
for (var i = 0; i < metricIds.length; i = i + 1) {
appendCoverRow($('#runningMetricsTable'), $(this), cells);
/*
* Append delete button and metric id.
*/
$('#runningMetricsTable').find('tr').last().append(
'<td>'
+ '<img class="icon iconBtn delMetric" src="IMG/open-iconic/svg/trash.svg" alt="r">'
+ '</td>'
+ '<td class="hidden metricId">'
+ metricIds[i]
+ '</td>'
);
}
});
/*
* Sort Table
*/
try {
$("#runningMetricsTable").tablesorter({sortList: [[0,0],[1,0]] /*,
headers: { 5: { sorter: false}}*/ });
} catch(err) { /* table empty */ }
registerCoverTable("#runningMetricsTable");
/*
* Register delete handlers.
*/
$("#runningMetricsTable").find('.delMetric').click(function(){
var coverId = $(this).parent().siblings().filter('.coverId');
var graphId = $(this).parent().siblings().filter('.graphId');
var metricId = $(this).parent().siblings().filter('.metricId');
deleteMetric(coverId, graphId, metricId);
});
});
}
}
/* Requests the interruption of a metric execution */
function deleteMetric(coverId, graphId, metricId) {
sendRequest("delete", "covers/" + coverId.text() + "/graphs/"
+ graphId.text() + "/metrics/" + metricId.text()
, "",
/* Response handler */
function(confirmXml) {
var page = (typeof pageNumber === 'undefined') ? 0 : pageNumber;
var newUrl = "index.html";
window.location.href = newUrl;
},
/* Error handler */
function(errorData) {
showConnectionErrorMessage("Cover could not be deleted.");
});
}
/* Requests the cover information of covers with running metrics */
function getMetricCoverMetas(callback) {
sendRequest("get", "covers?executionStatuses=COMPLETED&metricExecutionStatuses=RUNNING-WAITING&includeMeta=TRUE", "",
/* Response handler */
function(response) {
/*
* CoverMetas request succeeded
*/
metricCoverMetasXml = response;
if(typeof callback !== 'undefined') {
callback();
}
},
/* Error handler */
function(errorData) {
/*
* Cover metas request failed
*/
showConnectionErrorMessage("Cover metas were not received.");
});
}
/* Requests the cooperation simulation information of simulations with running metrics */
function getCooperationSimulationMetas(callback) {
// The path "simulation/running" is not defined, needs fixing
// sendRequest("get", "simulation/running", "",
// /* Response handler */
// function(response) {
//
// cooperationSimulationMetasXml = response;
// if(typeof callback !== 'undefined') {
// callback();
// }
// },
// /* Error handler */
// function(errorData) {
// /*
// * Cover metas request failed
// */
// showConnectionErrorMessage("Cover metas were not received.");
// });
}
/* Handles collapsable element for cooperation simulations in creation */
function runningCooperationSimulationCollapsableHandler() {
if(typeof cooperationSimulationMetasXml === 'undefined') {
/* Requests meta information of centrality maps in creation */
getCooperationSimulationMetas(function() {
/* Identifiers for the simulation information to be displayed */
var cells = ["Cooperation Simulation", "R"];
/* Adds the simulation to the table */
$(cooperationSimulationMetasXml).find("Simulation").each(function() {
appendCooperationRow($('#runningCooperationSimulationTable'), $(this), cells);
});
/*
* Sort Table
*/
try {
$("#runningCooperationSimulationTable").tablesorter({sortList: [[1,0],[0,0]],
headers: { 6: { sorter: false}, 7: {sorter: false}}});
} catch(err) { /* table empty */ }
/* Registers the table component */
registerCooperationTable("#runningCooperationSimulationTable");
});
}
}
/* Handles collapsable element for centrality maps in creation */
function runningCentralityAlgorithmsCollapsableHandler() {
if(typeof algoCentralityMetasXml === 'undefined') {
/* Requests meta information of centrality maps in creation */
getCentralityAlgoMetas(function() {
/* Identifiers for the centrality map information to be displayed */
var cells = ["Name", "Graph", "Creation Method", "R"];
/* Adds the centrality map to the table */
$(algoCentralityMetasXml).find("CentralityMap").each(function() {
appendCentralityMapRow($('#runningCentralityAlgorithmsTable'), $(this), cells);
});
/*
* Sort Table
*/
try {
$("#runningCentralityAlgorithmsTable").tablesorter({sortList: [[1,0],[0,0]],
headers: { 5: { sorter: false}}});
} catch(err) { /* table empty */ }
/* Registers the table component */
registerCentralityTable("#runningCentralityAlgorithmsTable");
});
}
}
/* Requests the meta information of centrality maps in creation */
function getCentralityAlgoMetas(callback) {
sendRequest("get", "maps?executionStatuses=RUNNING-WAITING&includeMeta=TRUE", "",
/* Response handler */
function(response) {
/*
* Centrality map metas request succeeded
*/
algoCentralityMetasXml = response;
if(typeof callback !== 'undefined') {
callback();
}
},
/* Error handler */
function(errorData) {
/*
* Centrality map metas request failed
*/
showConnectionErrorMessage("Centrality map metas were not received.");
});
}
</script>
</head>
<body>
<div id="wrapper">
<div id="contentWrapper">
<div id="content">
<!-- Container for displaying error messages -->
<div id="errorMessageWrapper">
<div id="errorMessage"></div>
</div>
<!-- Collapsable for covers in creation -->
<div id="runningAlgorithmsCollapsable" class="collapsable">
<div class="collapsableHeader coverColor">
<div class="collapsableTitle">Running Benchmarks and Algorithms</div>
<div class="collapsableCollapser">
<img class="icon iconBtn collapsableDisplayBtn" src="IMG/open-iconic/svg/chevron-bottom.svg" alt="d">
<img class="icon iconBtn collapsableCollapseBtn" src="IMG/open-iconic/svg/chevron-top.svg" alt="c">
</div>
</div>
<div class="collapsableContent">
<!-- Table of covers in creation -->
<div class="tableWrapper">
<table id="runningAlgorithmsTable">
<thead>
<tr>
<th class="hidden" title="CoverId"></th>
<th class="hidden" title="GraphId"></th>
<th width="300" title="Cover Name" class="sortable">
Name
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Graph Name" class="sortable">
Graph
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Creation Method Name" class="sortable">
Creation Method
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="20" title="Stop Execution and Remove Cover">
R
</th>
<th class="hidden" title="MetricId"></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<!-- Collapsable for covers with running metrics -->
<div id="runningMetricsCollapsable" class="collapsable">
<div class="collapsableHeader coverColor">
<div class="collapsableTitle">Running Metrics</div>
<div class="collapsableCollapser">
<img class="icon iconBtn collapsableDisplayBtn" src="IMG/open-iconic/svg/chevron-bottom.svg" alt="d">
<img class="icon iconBtn collapsableCollapseBtn" src="IMG/open-iconic/svg/chevron-top.svg" alt="c">
</div>
</div>
<div class="collapsableContent">
<!-- Table of covers with running metrics -->
<div class="tableWrapper">
<table id="runningMetricsTable">
<thead>
<tr>
<th class="hidden" title="CoverId"></th>
<th class="hidden" title="GraphId"></th>
<th width="300" title="Cover Name" class="sortable">
Name
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Graph Name" class="sortable">
Graph
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Creation Method Name" class="sortable">
Creation Method
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="20" title="Stop Execution and Remove Metric">
R
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<!-- Collapsable for cooperation simulations-->
<div id="runningCooperationSimulationCollapsable" class="collapsable">
<div class="collapsableHeader simulationColor">
<div class="collapsableTitle">Running Cooperation Simulation</div>
<div class="collapsableCollapser">
<img class="icon iconBtn collapsableDisplayBtn" src="IMG/open-iconic/svg/chevron-bottom.svg" alt="d">
<img class="icon iconBtn collapsableCollapseBtn" src="IMG/open-iconic/svg/chevron-top.svg" alt="c">
</div>
</div>
<div class="collapsableContent">
<!-- Table of covers with running metrics -->
<div class="tableWrapper">
<table id="runningCooperationSimulationTable">
<thead>
<tr>
<th class="hidden" title="CoverId"></th>
<th class="hidden" title="GraphId"></th>
<th width="300" title="Status" class="sortable">
Status
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Simulation Name" class="sortable">
Name
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="20" title="Stop Execution and Remove">
R
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<!-- Collapsable for centrality maps in creation -->
<div id="runningCentralityAlgorithmsCollapsable" class="collapsable">
<div class="collapsableHeader centralityColor">
<div class="collapsableTitle">Running Centrality Calculations and Simulations</div>
<div class="collapsableCollapser">
<img class="icon iconBtn collapsableDisplayBtn" src="IMG/open-iconic/svg/chevron-bottom.svg" alt="d">
<img class="icon iconBtn collapsableCollapseBtn" src="IMG/open-iconic/svg/chevron-top.svg" alt="c">
</div>
</div>
<div class="collapsableContent">
<!-- Table of centrality maps in creation -->
<div class="tableWrapper">
<table id="runningCentralityAlgorithmsTable">
<thead>
<tr>
<th class="hidden" title="MapId"></th>
<th class="hidden" title="GraphId"></th>
<th width="300" title="Name" class="sortable">
Name
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Graph Name" class="sortable">
Graph
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Creation Method Name" class="sortable">
Creation Method
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="20" title="Stop Execution and Remove Centrality">
R
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>