diff --git a/src/playbooks/PlaybookPage.js b/src/playbooks/PlaybookPage.js index bffd18a..53020e0 100644 --- a/src/playbooks/PlaybookPage.js +++ b/src/playbooks/PlaybookPage.js @@ -2,7 +2,6 @@ import React, { Component } from "react"; import { Card, CardHeader, - CardBody, PageSection, PageSectionVariants } from "@patternfly/react-core"; @@ -38,40 +37,38 @@ export class PlaybookPage extends Component { return ; } return ( - + - + Hosts - - - - - - - - - - +
NameOKCHANGEDFAILEDSKIPPEDUNREACHABLE
+ + + + + + + + + + + + {playbook.hosts.map(host => ( + + + + + + + - - - {playbook.hosts.map(host => ( - - - - - - - - - ))} - -
NameOKCHANGEDFAILEDSKIPPEDUNREACHABLE
{host.name}{host.ok}{host.changed}{host.failed}{host.skipped}{host.unreachable}
{host.name}{host.ok}{host.changed}{host.failed}{host.skipped}{host.unreachable}
-
+ ))} + +
Plays diff --git a/src/playbooks/PlaybookSummary.js b/src/playbooks/PlaybookSummary.js index f57fdf8..3b484c6 100644 --- a/src/playbooks/PlaybookSummary.js +++ b/src/playbooks/PlaybookSummary.js @@ -4,7 +4,9 @@ import { Card, CardBody, Label } from "@patternfly/react-core"; import { CheckCircleIcon, ExclamationCircleIcon, - PauseCircleIcon + PauseCircleIcon, + CalendarAltIcon, + ClockIcon } from "@patternfly/react-icons"; import { global_danger_color_100, @@ -155,9 +157,10 @@ export default class Playbook extends Component { - {new Date(playbook.started).toUTCString()}

- {(playbook.name ? playbook.name : playbook.path.split("/").slice(-1)[0])} + {playbook.name + ? playbook.name + : playbook.path.split("/").slice(-1)[0]}

@@ -182,11 +185,19 @@ export default class Playbook extends Component { {playbook.labels.map(label => ( - + ))} - + + + {new Date(playbook.started).toUTCString()} + + + + {Math.round(playbook.duration)} sec diff --git a/src/tasks/TaskRow.js b/src/tasks/TaskRow.js index 3bc9d10..44d161b 100644 --- a/src/tasks/TaskRow.js +++ b/src/tasks/TaskRow.js @@ -78,9 +78,9 @@ export default class TaskRow extends Component { className={`pf-c-table__expandable-row ${isExpanded && "pf-m-expanded"}`} > - +
Task results + - {task.results.map(result => ( + @@ -118,19 +124,12 @@ export default class TaskRow extends Component { > {result.duration} - ))}
Status Host Started Ended DurationStatus
+ {result.status} + {result.host.name} - {result.status} -
- ); diff --git a/src/tasks/Tasks.js b/src/tasks/Tasks.js index b2dad1e..e6b3277 100644 --- a/src/tasks/Tasks.js +++ b/src/tasks/Tasks.js @@ -6,7 +6,7 @@ export default class Tasks extends Component { const { tasks } = this.props; return ( diff --git a/src/tasks/task.js b/src/tasks/task.js index 5337390..29261b6 100644 --- a/src/tasks/task.js +++ b/src/tasks/task.js @@ -4,7 +4,8 @@ function _getAveragesFromTask(task) { (acc, result) => { acc.statuses[result.status] += 1; acc.total_duration += parseFloat(result.duration); - acc.average_duration = acc.total_duration / results.length; + acc.average_duration = + Math.round((acc.total_duration * 100) / results.length) / 100; return acc; }, { diff --git a/src/tasks/task.test.js b/src/tasks/task.test.js index a0f5be0..ff4e6b4 100644 --- a/src/tasks/task.test.js +++ b/src/tasks/task.test.js @@ -100,7 +100,7 @@ test("extractTasksFromPlays", () => { { name: "Gathering Facts", action: "gather_facts", - average_duration: 1.702101, + average_duration: 1.7, statuses: { ok: 1, failed: 0, @@ -125,7 +125,7 @@ test("extractTasksFromPlays", () => { { name: "Gathering Facts", action: "gather_facts", - average_duration: 1.296572, + average_duration: 1.3, statuses: { ok: 3, failed: 0, @@ -161,7 +161,7 @@ test("extractTasksFromPlays", () => { ended: "2019-05-17T16:55:12.195753", status: "ok" } - ], + ] } ]; expect(extractTasksFromPlays(plays)).toEqual(expectedTasks);