Skip to content

Commit 2dc41ce

Browse files
committed
stringify event details json
1 parent 29c12af commit 2dc41ce

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

public/css/app.css

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ td.failed {
5252
background-color: #ffcccb;
5353
}
5454

55+
td.failed2 {
56+
background-color: #ff3333;
57+
}
58+
5559
td.running {
5660
color: green;
5761
}

views/partials/header.ejs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<title>IlluminationV1</title>
99
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.5.0/semantic.min.css" />
1010
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.5/css/jquery.dataTables.min.css" />
11+
<link rel="stylesheet" type="text/css" href="/static/css/jquery.json-viewer.css" />
12+
13+
<script type="text/javascript" charset="utf8" src="/static/js/jquery.json-viewer.js"></script>
1114
<script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
1215
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
1316
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/plug-ins/1.13.5/sorting/file-size.min.js"></script>

views/wes/workflowrunhistory2.ejs

+21-15
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
<tr>
1212
<th>N</th>
1313
<th>Name</th>
14-
<th>EventID</th>
15-
<th>EventIDprev</th>
16-
<th>EventType</th>
1714
<th>Timestamp</th>
15+
<th>ID</th>
16+
<th>IDprev</th>
17+
<th>Type</th>
18+
<th>Details</th>
1819
</tr>
1920
</thead>
2021
<tbody>
@@ -33,13 +34,16 @@
3334
<% } %>
3435

3536
<% for (let i = 0; i < events.length; i++) { %>
37+
<% ed = events[i].eventDetails %>
38+
<% ed = jsonSyntaxHighlight(JSON.stringify(ed, null, 4)) %>
3639
<tr>
3740
<td><%= `${i + 1}.` %></td>
3841
<td><%= events[i].name %></td>
42+
<td><%= format_date(events[i].timestamp) %></td>
3943
<td><%= events[i].eventId %></td>
4044
<td><%= events[i].previousEventId %></td>
4145
<td><%= events[i].eventType %></td>
42-
<td><%= format_date(events[i].timestamp) %></td>
46+
<td><%- ed %></td>
4347
</tr>
4448
<% } %>
4549
</tbody>
@@ -48,25 +52,27 @@
4852
<script>
4953
$(document).ready(function() {
5054
$("#workflowrunhistory_table").DataTable({
51-
pageLength: 100,
55+
pageLength: 50,
5256
lengthMenu: [ [10, 50, 100, 300, -1], [10, 50, 100, 300, "All"] ],
5357
"createdRow": function ( row, data, index ) {
54-
if ( data[4] === "Succeeded" || data[4] === "RunSucceeded" ) {
55-
$('td', row).eq(4).addClass('completed');
56-
} else if (data[4] === "Started") {
57-
$('td', row).eq(4).addClass('running');
58-
} else if (data[4] === "Failed" || data[4] === "Aborted") {
59-
$('td', row).eq(4).addClass('failed');
60-
} else if (data[4] === "RunStarted") {
61-
$('td', row).eq(4).addClass('running');
58+
if ( data[5] === "Succeeded" || data[5] === "RunSucceeded" ) {
59+
$('td', row).eq(5).addClass('completed');
60+
} else if (data[5] === "Started") {
61+
$('td', row).eq(5).addClass('running');
62+
} else if (data[5] === "Failed" || data[5] === "Aborted") {
63+
$('td', row).eq(5).addClass('failed');
64+
} else if (data[5] === "RunFailed") {
65+
$('td', row).eq(5).addClass('failed2');
66+
} else if (data[5] === "RunStarted") {
67+
$('td', row).eq(5).addClass('running');
6268
}
63-
6469
},
65-
"dom": '<"top"flip>t<"bottom"flip>'
70+
"dom": '<"top"flip>t<"bottom"flip>',
6671
});
6772
});
6873
</script>
6974

75+
7076
<pre>
7177
<%- jsonSyntaxHighlight(JSON.stringify(history, null, 2)) %>
7278
</pre>

0 commit comments

Comments
 (0)