mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Add timeout detail to node view modal
This commit is contained in:
parent
5cba34c34d
commit
c18aa90534
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { shape } from 'prop-types';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { t, Trans } from '@lingui/macro';
|
||||
import { Chip, ChipGroup } from '@patternfly/react-core';
|
||||
import { VariablesDetail } from '@components/CodeMirrorInput';
|
||||
import { DetailList, Detail } from '@components/DetailList';
|
||||
@ -27,6 +27,15 @@ function hasPromptData(launchData) {
|
||||
);
|
||||
}
|
||||
|
||||
function formatTimeout(timeout) {
|
||||
if (typeof timeout === "undefined" || timeout === null) {
|
||||
return null;
|
||||
}
|
||||
const minutes = Math.floor(timeout / 60);
|
||||
const seconds = timeout - Math.floor(timeout / 60) * 60;
|
||||
return <>{minutes} <Trans>min</Trans> {seconds} <Trans>sec</Trans></>;
|
||||
}
|
||||
|
||||
function PromptDetail({ i18n, resource, launchConfig = {} }) {
|
||||
const { defaults = {} } = launchConfig;
|
||||
const VERBOSITY = {
|
||||
@ -46,6 +55,10 @@ function PromptDetail({ i18n, resource, launchConfig = {} }) {
|
||||
label={i18n._(t`Type`)}
|
||||
value={resource.unified_job_type || resource.type}
|
||||
/>
|
||||
<Detail
|
||||
label={i18n._(t`Timeout`)}
|
||||
value={formatTimeout(resource?.timeout)}
|
||||
/>
|
||||
</DetailList>
|
||||
|
||||
{hasPromptData(launchConfig) && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user