mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Add popover text to JT and WJT details pages.
This commit is contained in:
parent
0787cb4fc2
commit
be1d0c525c
@ -32,7 +32,9 @@ import { JobTemplatesAPI } from 'api';
|
||||
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
||||
import ExecutionEnvironmentDetail from 'components/ExecutionEnvironmentDetail';
|
||||
import { relatedResourceDeleteRequests } from 'util/getRelatedResourceDeleteDetails';
|
||||
import jtHelpTextStrings from '../shared/JobTemplate.helptext';
|
||||
|
||||
const helpText = jtHelpTextStrings();
|
||||
function JobTemplateDetail({ template }) {
|
||||
const {
|
||||
ask_inventory_on_launch,
|
||||
@ -192,6 +194,7 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Job Type`}
|
||||
value={job_type}
|
||||
dataCy="jt-detail-job-type"
|
||||
helpText={helpText.jobType}
|
||||
/>
|
||||
{summary_fields.organization ? (
|
||||
<Detail
|
||||
@ -216,6 +219,7 @@ function JobTemplateDetail({ template }) {
|
||||
summary_fields.inventory.kind,
|
||||
summary_fields.inventory.id
|
||||
)}
|
||||
helpText={helpText.inventory}
|
||||
/>
|
||||
) : (
|
||||
!ask_inventory_on_launch && (
|
||||
@ -231,6 +235,7 @@ function JobTemplateDetail({ template }) {
|
||||
{summary_fields.project.name}
|
||||
</Link>
|
||||
}
|
||||
helpText={helpText.project}
|
||||
/>
|
||||
) : (
|
||||
<DeletedDetail label={t`Project`} />
|
||||
@ -238,9 +243,7 @@ function JobTemplateDetail({ template }) {
|
||||
<ExecutionEnvironmentDetail
|
||||
virtualEnvironment={custom_virtualenv}
|
||||
executionEnvironment={summary_fields?.resolved_environment}
|
||||
helpText={t`The execution environment that will be used when launching
|
||||
this job template. The resolved execution environment can be overridden by
|
||||
explicitly assigning a different one to this job template.`}
|
||||
helpText={helpText.executionEnvironment}
|
||||
dataCy="jt-detail-execution-environment"
|
||||
/>
|
||||
<Detail
|
||||
@ -252,32 +255,43 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Playbook`}
|
||||
value={playbook}
|
||||
dataCy="jt-detail-playbook"
|
||||
helpText={helpText.playbook}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Forks`}
|
||||
value={forks || '0'}
|
||||
dataCy="jt-detail-forks"
|
||||
helpText={helpText.forks}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Limit`}
|
||||
value={limit}
|
||||
dataCy="jt-detail-limit"
|
||||
helpText={helpText.limit}
|
||||
/>
|
||||
<Detail label={t`Limit`} value={limit} dataCy="jt-detail-limit" />
|
||||
<Detail
|
||||
label={t`Verbosity`}
|
||||
value={verbosityDetails[0].details}
|
||||
dataCy="jt-detail-verbosity"
|
||||
helpText={helpText.verbosity}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Timeout`}
|
||||
value={timeout || '0'}
|
||||
dataCy="jt-detail-timeout"
|
||||
helpText={helpText.timeout}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Show Changes`}
|
||||
value={diff_mode ? t`On` : t`Off`}
|
||||
dataCy="jt-detail-show-changes"
|
||||
helpText={helpText.showChanges}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Job Slicing`}
|
||||
value={job_slice_count}
|
||||
dataCy="jt-detail-job-slice-count"
|
||||
helpText={helpText.jobSlicing}
|
||||
/>
|
||||
{host_config_key && (
|
||||
<>
|
||||
@ -290,6 +304,7 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Provisioning Callback URL`}
|
||||
value={generateCallBackUrl}
|
||||
dataCy="jt-detail-provisioning-callback-url"
|
||||
helpText={helpText.provisioningCallbacks}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
@ -298,6 +313,7 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Webhook Service`}
|
||||
value={webhook_service === 'github' ? t`GitHub` : t`GitLab`}
|
||||
dataCy="jt-detail-webhook-service"
|
||||
helpText={helpText.webhookService}
|
||||
/>
|
||||
)}
|
||||
{webhook_receiver && (
|
||||
@ -305,17 +321,20 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Webhook URL`}
|
||||
value={`${document.location.origin}${webhook_receiver}`}
|
||||
dataCy="jt-detail-webhook-url"
|
||||
helpText={helpText.webhookURL}
|
||||
/>
|
||||
)}
|
||||
<Detail
|
||||
label={t`Webhook Key`}
|
||||
value={webhook_key}
|
||||
dataCy="jt-detail-webhook-key"
|
||||
helpText={helpText.webhookKey}
|
||||
/>
|
||||
{summary_fields.webhook_credential && (
|
||||
<Detail
|
||||
label={t`Webhook Credential`}
|
||||
dataCy="jt-detail-webhook-credential"
|
||||
helpText={helpText.webhookCredential}
|
||||
value={
|
||||
<Link
|
||||
to={`/credentials/${summary_fields.webhook_credential.id}/details`}
|
||||
@ -341,6 +360,7 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Enabled Options`}
|
||||
value={renderOptions}
|
||||
dataCy="jt-detail-enabled-options"
|
||||
helpText={helpText.enabledOptions}
|
||||
/>
|
||||
)}
|
||||
{summary_fields.credentials && summary_fields.credentials.length > 0 && (
|
||||
@ -348,6 +368,7 @@ function JobTemplateDetail({ template }) {
|
||||
fullWidth
|
||||
label={t`Credentials`}
|
||||
dataCy="jt-detail-credentials"
|
||||
helpText={helpText.credentials}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={5}
|
||||
@ -373,6 +394,7 @@ function JobTemplateDetail({ template }) {
|
||||
fullWidth
|
||||
label={t`Labels`}
|
||||
dataCy="jt-detail-labels"
|
||||
helpText={helpText.labels}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={5}
|
||||
@ -393,6 +415,7 @@ function JobTemplateDetail({ template }) {
|
||||
fullWidth
|
||||
label={t`Instance Groups`}
|
||||
dataCy="jt-detail-instance-groups"
|
||||
helpText={helpText.instanceGroups}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={5}
|
||||
@ -419,6 +442,7 @@ function JobTemplateDetail({ template }) {
|
||||
fullWidth
|
||||
label={t`Job Tags`}
|
||||
dataCy="jt-detail-job-tags"
|
||||
helpText={helpText.jobTags}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={5}
|
||||
@ -443,6 +467,7 @@ function JobTemplateDetail({ template }) {
|
||||
fullWidth
|
||||
label={t`Skip Tags`}
|
||||
dataCy="jt-detail-skip-tags"
|
||||
helpText={helpText.skipTags}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={5}
|
||||
@ -468,6 +493,7 @@ function JobTemplateDetail({ template }) {
|
||||
label={t`Variables`}
|
||||
dataCy={`jt-detail-${template.id}`}
|
||||
name="extra_vars"
|
||||
helpText={helpText.variables}
|
||||
/>
|
||||
</DetailList>
|
||||
<CardActionsRow>
|
||||
|
||||
@ -25,7 +25,9 @@ import Sparkline from 'components/Sparkline';
|
||||
import { toTitleCase } from 'util/strings';
|
||||
import { relatedResourceDeleteRequests } from 'util/getRelatedResourceDeleteDetails';
|
||||
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
||||
import jtHelpTextStrings from '../shared/JobTemplate.helptext';
|
||||
|
||||
const helpText = jtHelpTextStrings();
|
||||
function WorkflowJobTemplateDetail({ template }) {
|
||||
const {
|
||||
id,
|
||||
@ -132,34 +134,52 @@ function WorkflowJobTemplateDetail({ template }) {
|
||||
dataCy="source-control-branch"
|
||||
label={t`Source Control Branch`}
|
||||
value={scmBranch}
|
||||
helpText={helpText.sourceControlBranch}
|
||||
/>
|
||||
)}
|
||||
<Detail label={t`Job Type`} value={toTitleCase(type)} />
|
||||
<Detail
|
||||
label={t`Job Type`}
|
||||
value={toTitleCase(type)}
|
||||
helpText={helpText.jobType}
|
||||
/>
|
||||
{summary_fields.inventory && (
|
||||
<Detail
|
||||
label={t`Inventory`}
|
||||
helpText={helpText.inventory}
|
||||
value={inventoryValue(
|
||||
summary_fields.inventory.kind,
|
||||
summary_fields.inventory.id
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
<Detail dataCy="limit" label={t`Limit`} value={limit} />
|
||||
<Detail
|
||||
dataCy="limit"
|
||||
label={t`Limit`}
|
||||
value={limit}
|
||||
helpText={helpText.limit}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Webhook Service`}
|
||||
value={toTitleCase(template.webhook_service)}
|
||||
helpText={helpText.webhookService}
|
||||
/>
|
||||
{related.webhook_receiver && (
|
||||
<Detail
|
||||
label={t`Webhook URL`}
|
||||
helpText={helpText.webhookURL}
|
||||
value={`${urlOrigin}${template.related.webhook_receiver}`}
|
||||
/>
|
||||
)}
|
||||
<Detail label={t`Webhook Key`} value={webhook_key} />
|
||||
<Detail
|
||||
label={t`Webhook Key`}
|
||||
value={webhook_key}
|
||||
helpText={helpText.webhookKey}
|
||||
/>
|
||||
{webhook_credential && (
|
||||
<Detail
|
||||
fullWidth
|
||||
label={t`Webhook Credentials`}
|
||||
helpText={helpText.webhookCredential}
|
||||
value={
|
||||
<Link
|
||||
to={`/credentials/${summary_fields.webhook_credential.id}/details`}
|
||||
@ -180,12 +200,18 @@ function WorkflowJobTemplateDetail({ template }) {
|
||||
user={summary_fields.modified_by}
|
||||
/>
|
||||
{renderOptionsField && (
|
||||
<Detail fullWidth label={t`Enabled Options`} value={renderOptions} />
|
||||
<Detail
|
||||
fullWidth
|
||||
label={t`Enabled Options`}
|
||||
value={renderOptions}
|
||||
helpText={helpText.enabledOptions}
|
||||
/>
|
||||
)}
|
||||
{summary_fields.labels?.results?.length > 0 && (
|
||||
<Detail
|
||||
fullWidth
|
||||
label={t`Labels`}
|
||||
helpText={helpText.labels}
|
||||
value={
|
||||
<ChipGroup
|
||||
numChips={3}
|
||||
@ -203,6 +229,7 @@ function WorkflowJobTemplateDetail({ template }) {
|
||||
)}
|
||||
<VariablesDetail
|
||||
dataCy="workflow-job-template-detail-extra-vars"
|
||||
helpText={helpText.variables}
|
||||
label={t`Variables`}
|
||||
value={extra_vars}
|
||||
rows={4}
|
||||
|
||||
38
awx/ui/src/screens/Template/shared/JobTemplate.helptext.js
Normal file
38
awx/ui/src/screens/Template/shared/JobTemplate.helptext.js
Normal file
@ -0,0 +1,38 @@
|
||||
import React from 'react';
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
const jtHelpTextStrings = () => ({
|
||||
jobType: t`For job templates, select run to execute the playbook. Select check to only check playbook syntax, test environment setup, and report problems without executing the playbook.`,
|
||||
inventory: t`Select the inventory containing the hosts you want this job to manage.`,
|
||||
project: t`Select the project containing the playbook you want this job to execute.`,
|
||||
executionEnvironment: t`Select the execution environment for this job template.`,
|
||||
playbook: t`Select the playbook to be executed by this job.`,
|
||||
credentials: t`Select credentials for accessing the nodes this job will be ran against. You can only select one credential of each type. For machine credentials (SSH), checking "Prompt on launch" without selecting credentials will require you to select a machine credential at run time. If you select credentials and check "Prompt on launch", the selected credential(s) become the defaults that can be updated at run time.`,
|
||||
labels: t`Optional labels that describe this job template, such as 'dev' or 'test'. Labels can be used to group and filter job templates and completed jobs.`,
|
||||
variables: t`Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON. Refer to the documentation for example syntax.`,
|
||||
forks: t`The number of parallel or simultaneous processes to use while executing the playbook. An empty value, or a value less than 1 will use the Ansible default which is usually 5. The default number of forks can be overwritten with a change to ansible.cfg. Refer to the Ansible documentation for details about the configuration file.`,
|
||||
limit: t`Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. Multiple patterns are allowed. Refer to Ansible documentation for more information and examples on patterns.`,
|
||||
verbosity: t`Control the level of output ansible will produce as the playbook executes.`,
|
||||
jobSlicing: t`Divide the work done by this job template into the specified number of job slices, each running the same tasks against a portion of the inventory.`,
|
||||
timeout: t`The amount of time (in seconds) to run before the job is canceled. Defaults to 0 for no job timeout.`,
|
||||
showChanges: t`If enabled, show the changes made by Ansible tasks, where supported. This is equivalent to Ansible's --diff mode.`,
|
||||
instanceGroups: t`Select the Instance Groups for this Job Template to run on.`,
|
||||
jobTags: t`Tags are useful when you have a large playbook, and you want to run a specific part of a play or task. Use commas to separate multiple tags. Refer to the documentation for details on the usage of tags.`,
|
||||
skipTags: t`Skip tags are useful when you have a large playbook, and you want to skip specific parts of a play or task. Use commas to separate multiple tags. Refer to the documentation for details on the usage of tags.`,
|
||||
webhookService: t`Select a webhook service.`,
|
||||
webhookURL: t`Webhook services can launch jobs with this workflow job template by making a POST request to this URL.`,
|
||||
webhookKey: t`Webhook services can use this as a shared secret.`,
|
||||
webhookCredential: t`Optionally select the credential to use to send status updates back to the webhook service.`,
|
||||
sourceControlBranch: t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`,
|
||||
enabledOptions: (
|
||||
<>
|
||||
<p>{t`Concurrent jobs: If enabled, simultaneous runs of this job template will be allowed.`}</p>
|
||||
<p>{t`Fact storage: If enabled, this will store gathered facts so they can be viewed at the host level. Facts are persisted and injected into the fact cache at runtime..`}</p>
|
||||
<p>{t`Privilege escalation: If enabled, run this playbook as an administrator.`}</p>
|
||||
<p>{t`Provisioning callbacks: Enables creation of a provisioning callback URL. Using the URL a host can contact Ansible AWX and request a configuration update using this job template.`}</p>
|
||||
<p>{t`Webhooks: Enable webhook for this template.`}</p>
|
||||
</>
|
||||
),
|
||||
});
|
||||
|
||||
export default jtHelpTextStrings;
|
||||
Loading…
x
Reference in New Issue
Block a user