diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js index 4833fdda9a..219dfdd052 100644 --- a/awx/ui/client/features/jobs/jobsList.controller.js +++ b/awx/ui/client/features/jobs/jobsList.controller.js @@ -76,6 +76,22 @@ function ListJobsController ( return { icon, link, value }; }); + vm.getSplitJobDetails = (details) => { + const internalLimitDetails = Object.assign({}, details); + + if (!internalLimitDetails) { + return null; + } + + const splitJobDetails = internalLimitDetails.shard; + + if (!splitJobDetails) { + return null; + } + + return `Split Job ${splitJobDetails.offset + 1}/${splitJobDetails.step}`; + }; + vm.getSref = ({ type, id }) => { let sref; diff --git a/awx/ui/client/features/jobs/jobsList.view.html b/awx/ui/client/features/jobs/jobsList.view.html index 580a35d8a7..8124b6ccf1 100644 --- a/awx/ui/client/features/jobs/jobsList.view.html +++ b/awx/ui/client/features/jobs/jobsList.view.html @@ -23,7 +23,8 @@ status-tip="{{ vm.strings.get('list.STATUS_TOOLTIP', job.status) }}" header-value="{{ job.id }} - {{ job.name }}" header-state="{{ vm.getSref(job) }}" - header-tag="{{ vm.jobTypes[job.type] }}"> + header-tag="{{ vm.jobTypes[job.type] }}" + secondary-tag="{{ vm.getSplitJobDetails(job.summary_fields.internal_limit) }}">
{{ vm.jobType.value }}
- -
- -
{{ vm.shardDetails.offset }}
+ +
+ +
{{ vm.splitJobDetails.offset }}
diff --git a/awx/ui/client/features/output/output.strings.js b/awx/ui/client/features/output/output.strings.js index 4fa6fe4335..9e2da6d983 100644 --- a/awx/ui/client/features/output/output.strings.js +++ b/awx/ui/client/features/output/output.strings.js @@ -23,7 +23,7 @@ function OutputStrings (BaseString) { EXTRA_VARS: t.s('Read-only view of extra variables added to the job template'), INVENTORY: t.s('View the Inventory'), JOB_TEMPLATE: t.s('View the Job Template'), - SHARD_DETAILS: t.s('Job is one of several shards from a JT that splits on inventory'), + SPLIT_JOB_DETAILS: t.s('Job is one of several from a JT that splits on inventory'), PROJECT: t.s('View the Project'), PROJECT_UPDATE: t.s('View Project checkout results'), SCHEDULE: t.s('View the Schedule'), @@ -56,7 +56,7 @@ function OutputStrings (BaseString) { JOB_EXPLANATION: t.s('Explanation'), JOB_TAGS: t.s('Job Tags'), JOB_TEMPLATE: t.s('Job Template'), - SHARD_DETAILS: t.s('Shard Details'), + SPLIT_JOB: t.s('Split Job'), JOB_TYPE: t.s('Job Type'), LABELS: t.s('Labels'), LAUNCHED_BY: t.s('Launched By'), diff --git a/awx/ui/client/lib/components/list/_index.less b/awx/ui/client/lib/components/list/_index.less index 1f8d534034..c5b64d4eed 100644 --- a/awx/ui/client/lib/components/list/_index.less +++ b/awx/ui/client/lib/components/list/_index.less @@ -197,7 +197,7 @@ color: @at-color-list-row-item-tag-primary; } -.at-RowItem-tag--header { +.at-RowItem-tag--header, .at-RowItem-tag--secondary { line-height: inherit; } diff --git a/awx/ui/client/lib/components/list/row-item.directive.js b/awx/ui/client/lib/components/list/row-item.directive.js index 731aa837ec..b28b661581 100644 --- a/awx/ui/client/lib/components/list/row-item.directive.js +++ b/awx/ui/client/lib/components/list/row-item.directive.js @@ -13,6 +13,7 @@ function atRowItem () { headerLink: '@', headerState: '@', headerTag: '@', + secondaryTag: '@', status: '@', statusTip: '@', statusClick: '&?', diff --git a/awx/ui/client/lib/components/list/row-item.partial.html b/awx/ui/client/lib/components/list/row-item.partial.html index eebeab39a9..17f1e3b5d9 100644 --- a/awx/ui/client/lib/components/list/row-item.partial.html +++ b/awx/ui/client/lib/components/list/row-item.partial.html @@ -29,6 +29,9 @@
{{ headerTag }}
+
+ {{ secondaryTag }} +
{{ labelValue }}
diff --git a/awx/ui/client/src/templates/job_templates/job-template.form.js b/awx/ui/client/src/templates/job_templates/job-template.form.js index 3773d2b865..8d5b68075f 100644 --- a/awx/ui/client/src/templates/job_templates/job-template.form.js +++ b/awx/ui/client/src/templates/job_templates/job-template.form.js @@ -257,6 +257,19 @@ function(NotificationsList, i18n) { dataPlacement: 'right', control: '', }, + job_shard_count: { + label: i18n._('Job Splitting'), + type: 'number', + integer: true, + min: 1, + default: 1, + spinner: true, + dataTitle: i18n._('Split Job Count'), + dataPlacement: 'right', + dataContainer: 'body', + awPopOver: "

" + i18n._("The number of jobs to split into at runtime. Will cause the Job Template to launch a workflow if value is non-zero.") + "

", + ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' + }, diff_mode: { label: i18n._('Show Changes'), type: 'toggleSwitch', @@ -271,20 +284,6 @@ function(NotificationsList, i18n) { }, ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' }, - job_shard_count: { - label: i18n._('Number of job shards to use'), - type: 'number', - integer: true, - min: 0, - spinner: true, - // 'class': "input-small", - // toggleSource: 'diff_mode', - dataTitle: i18n._('Job Shard Count'), - dataPlacement: 'right', - dataContainer: 'body', - awPopOver: "

" + i18n._("If non-zero, split into multiple jobs that run on mutually exclusive slices of the inventory.") + "

", - ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' - }, checkbox_group: { label: i18n._('Options'), type: 'checkbox_group',