mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 12:57:40 -02:30
Merge pull request #6219 from dsesami/host-detail-labels
Host detail labels
Reviewed-by: Daniel Sami
https://github.com/dsesami
This commit is contained in:
@@ -6,12 +6,13 @@ import { formatDateString } from '@util/dates';
|
|||||||
import Detail from './Detail';
|
import Detail from './Detail';
|
||||||
import { SummaryFieldUser } from '../../types';
|
import { SummaryFieldUser } from '../../types';
|
||||||
|
|
||||||
function UserDateDetail({ label, date, user }) {
|
function UserDateDetail({ label, date, user, dataCy = null }) {
|
||||||
const dateStr = formatDateString(date);
|
const dateStr = formatDateString(date);
|
||||||
const username = user ? user.username : '';
|
const username = user ? user.username : '';
|
||||||
return (
|
return (
|
||||||
<Detail
|
<Detail
|
||||||
label={label}
|
label={label}
|
||||||
|
dataCy={dataCy}
|
||||||
value={
|
value={
|
||||||
user ? (
|
user ? (
|
||||||
<Trans>
|
<Trans>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function HostDetail({ i18n, host }) {
|
|||||||
<CardBody>
|
<CardBody>
|
||||||
<HostToggle host={host} css="padding-bottom: 40px" />
|
<HostToggle host={host} css="padding-bottom: 40px" />
|
||||||
<DetailList gutter="sm">
|
<DetailList gutter="sm">
|
||||||
<Detail label={i18n._(t`Name`)} value={name} />
|
<Detail label={i18n._(t`Name`)} value={name} dataCy="host-name" />
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`Activity`)}
|
label={i18n._(t`Activity`)}
|
||||||
value={<Sparkline jobs={recentPlaybookJobs} />}
|
value={<Sparkline jobs={recentPlaybookJobs} />}
|
||||||
@@ -74,6 +74,7 @@ function HostDetail({ i18n, host }) {
|
|||||||
<Detail label={i18n._(t`Description`)} value={description} />
|
<Detail label={i18n._(t`Description`)} value={description} />
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`Inventory`)}
|
label={i18n._(t`Inventory`)}
|
||||||
|
dataCy="host-inventory"
|
||||||
value={
|
value={
|
||||||
<Link to={`/inventories/inventory/${inventory.id}/details`}>
|
<Link to={`/inventories/inventory/${inventory.id}/details`}>
|
||||||
{inventory.name}
|
{inventory.name}
|
||||||
@@ -84,11 +85,13 @@ function HostDetail({ i18n, host }) {
|
|||||||
date={created}
|
date={created}
|
||||||
label={i18n._(t`Created`)}
|
label={i18n._(t`Created`)}
|
||||||
user={created_by}
|
user={created_by}
|
||||||
|
dataCy="host-created-by"
|
||||||
/>
|
/>
|
||||||
<UserDateDetail
|
<UserDateDetail
|
||||||
date={modified}
|
date={modified}
|
||||||
label={i18n._(t`Last Modified`)}
|
label={i18n._(t`Last Modified`)}
|
||||||
user={modified_by}
|
user={modified_by}
|
||||||
|
dataCy="host-last-modified-by"
|
||||||
/>
|
/>
|
||||||
<VariablesDetail
|
<VariablesDetail
|
||||||
label={i18n._(t`Variables`)}
|
label={i18n._(t`Variables`)}
|
||||||
|
|||||||
Reference in New Issue
Block a user