mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
Use date object to format elapsed time
This commit is contained in:
parent
b00249b515
commit
debbac5c78
@ -175,7 +175,7 @@ class JobOutput extends Component {
|
||||
try {
|
||||
switch (job.type) {
|
||||
case 'project_update':
|
||||
await ProjectUpdatesAPI.destroy(job.idd);
|
||||
await ProjectUpdatesAPI.destroy(job.id);
|
||||
break;
|
||||
case 'system_job':
|
||||
await SystemJobsAPI.destroy(job.id);
|
||||
|
||||
@ -40,18 +40,19 @@ const Wrapper = styled.div`
|
||||
font-size: 14px;
|
||||
`;
|
||||
|
||||
function toHHMMSS(s) {
|
||||
function pad(n) {
|
||||
const toHHMMSS = elapsed => {
|
||||
const pad = n => {
|
||||
return `00${n}`.slice(-2);
|
||||
}
|
||||
};
|
||||
|
||||
const secs = s % 60;
|
||||
s = (s - secs) / 60;
|
||||
const mins = s % 60;
|
||||
const hrs = (s - mins) / 60;
|
||||
const date = new Date();
|
||||
date.setTime(elapsed * 1000);
|
||||
const hrs = date.getUTCHours();
|
||||
const mins = date.getUTCMinutes();
|
||||
const secs = date.getUTCSeconds();
|
||||
|
||||
return `${pad(hrs)}:${pad(mins)}:${pad(secs)}`;
|
||||
}
|
||||
};
|
||||
|
||||
const OUTPUT_NO_COUNT_JOB_TYPES = [
|
||||
'ad_hoc_command',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user