-
Notifications
You must be signed in to change notification settings - Fork 1
/
sinfo.html
61 lines (53 loc) · 1.55 KB
/
sinfo.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<script src="https://code.jquery.com/jquery-1.12.3.js">
</script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js">
</script>
<head>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<title>
</title>
</head>
<body>
<script>
// cutnpaste from stackexchange
function getDataAsync(url, callback) {
$.ajax({
async: true,
url: url,
dataType: 'json',
success: callback
});
}
function renderTable(sinfoData){
var visibleCols = ["HOSTNAMES", "CPU_LOAD", "SOCKETS", "CORES",
"THREADS", "S:C:T", "CPUS(A/I/O/T)"];
var headers = sinfoData['headers'];
var nodes = sinfoData['nodes'];
var visibleIdx = [];
for (c in visibleCols) {
visibleIdx.push(headers.indexOf(visibleCols[c]));
}
var cols = [];
for (c in visibleCols) {
cols[c] = { title: visibleCols[c], data: visibleIdx[c] };
}
$('#sinfo').DataTable({
data : nodes,
columns : cols,
order : [[ 1, "asc"]],
pageLength : 50,
lengthMenu : [ [ 50, 100, -1], [ 50, 100, "All"] ],
stateSave : true
} );
}
//Pull all queue info from the server as json and render the htmltable
getDataAsync("../data/sinfo", renderTable);
</script>
<p> <a href="squeue.html"> squeue </a> </p>
<table id="sinfo" class="display" cellspacing="0" width="100%"></table>
<script>
</script>
</body>
</html>