mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
Finixhed applying jsHint linting to js files. Created initial Gruntfile.js build script and package.json script for keeping track of required node modules.
This commit is contained in:
@@ -7,11 +7,10 @@
|
||||
*
|
||||
*/
|
||||
angular.module('JobTemplateFormDefinition', [])
|
||||
.value(
|
||||
'JobTemplateForm', {
|
||||
.value('JobTemplateForm', {
|
||||
|
||||
addTitle: 'Create Job Templates', //Legend in add mode
|
||||
editTitle: '{{ name }}', //Legend in edit mode
|
||||
addTitle: 'Create Job Templates',
|
||||
editTitle: '{{ name }}',
|
||||
name: 'job_templates',
|
||||
twoColumns: true,
|
||||
well: true,
|
||||
@@ -25,8 +24,8 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
icon: "icon-comments-alt",
|
||||
mode: 'edit',
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
name: {
|
||||
@@ -35,20 +34,20 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
addRequired: true,
|
||||
editRequired: true,
|
||||
column: 1
|
||||
},
|
||||
description: {
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
},
|
||||
job_type: {
|
||||
label: 'Job Type',
|
||||
type: 'select',
|
||||
ngOptions: 'type.label for type in job_type_options',
|
||||
"default": 0,
|
||||
addRequired: true,
|
||||
addRequired: true,
|
||||
editRequired: true,
|
||||
column: 1,
|
||||
awPopOver: "<p>When this template is submitted as a job, setting the type to <em>run</em> will execute the playbook, running tasks " +
|
||||
@@ -57,7 +56,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Job Type',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
inventory: {
|
||||
label: 'Inventory',
|
||||
type: 'lookup',
|
||||
@@ -70,7 +69,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Inventory',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
project: {
|
||||
label: 'Project',
|
||||
type: 'lookup',
|
||||
@@ -83,7 +82,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Project',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
playbook: {
|
||||
label: 'Playbook',
|
||||
type:'select',
|
||||
@@ -95,29 +94,29 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Playbook',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
credential: {
|
||||
label: 'Machine Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1,
|
||||
awPopOver: "<p>Select the credential you want the job to use when accessing the remote hosts. Choose the credential containing " +
|
||||
awPopOver: "<p>Select the credential you want the job to use when accessing the remote hosts. Choose the credential containing " +
|
||||
" the username and SSH key or password that Ansbile will need to log into the remote hosts.</p>",
|
||||
dataTitle: 'Credential',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
cloud_credential: {
|
||||
label: 'Cloud Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'cloud_credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCloudcredential()',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1,
|
||||
awPopOver: "<p>Selecting an optional cloud credential in the job template will pass along the access credentials to the " +
|
||||
@@ -125,16 +124,16 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Cloud Credential',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
forks: {
|
||||
label: 'Forks',
|
||||
id: 'forks-number',
|
||||
type: 'number',
|
||||
type: 'number',
|
||||
integer: true,
|
||||
min: 0,
|
||||
spinner: true,
|
||||
spinner: true,
|
||||
"default": '0',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
'class': "input-small",
|
||||
column: 1,
|
||||
@@ -144,11 +143,11 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Forks',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
limit: {
|
||||
label: 'Limit',
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1,
|
||||
awPopOver: "<p>Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. " +
|
||||
@@ -157,26 +156,26 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Limit',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
verbosity: {
|
||||
label: 'Verbosity',
|
||||
type: 'select',
|
||||
ngOptions: 'v.label for v in verbosity_options',
|
||||
"default": 0,
|
||||
addRequired: true,
|
||||
addRequired: true,
|
||||
editRequired: true,
|
||||
column: 1,
|
||||
awPopOver: "<p>Control the level of output ansible will produce as the playbook executes.</p>",
|
||||
dataTitle: 'Verbosity',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
variables: {
|
||||
label: 'Extra Variables',
|
||||
type: 'textarea',
|
||||
rows: 6,
|
||||
"class": 'span12',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
"default": "---",
|
||||
column: 2,
|
||||
@@ -189,13 +188,13 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataTitle: 'Extra Variables',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
job_tags: {
|
||||
label: 'Job Tags',
|
||||
type: 'textarea',
|
||||
rows: 1,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
type: 'textarea',
|
||||
rows: 1,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
'class': 'span12',
|
||||
column: 2,
|
||||
awPopOver: "<p>Provide a comma separated list of tags.</p>\n" +
|
||||
@@ -203,26 +202,25 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
"<p>For example, you might have a task consisiting of a long list of actions. Tag values can be assigned to each action. " +
|
||||
"Suppose the actions have been assigned tag values of "configuration", "packages" and "install".</p>" +
|
||||
"<p>If you just want to run the "configuration" and "packages" actions, you would enter the following here " +
|
||||
"in the Job Tags field:<\p>\n" +
|
||||
"<blockquote>configuration,packages</blockquote>\n",
|
||||
"in the Job Tags field:</p>\n<blockquote>configuration,packages</blockquote>\n",
|
||||
dataTitle: "Job Tags",
|
||||
dataPlacement: "right",
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
allow_callbacks: {
|
||||
label: 'Allow Callbacks',
|
||||
type: 'checkbox',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequird: false,
|
||||
trueValue: 'true',
|
||||
falseValue: 'false',
|
||||
ngChange: "toggleCallback('host_config_key')",
|
||||
column: 2,
|
||||
awPopOver: "<p>Create a callback URL a host can use to contact Tower and request a configuration update " +
|
||||
awPopOver: "<p>Create a callback URL a host can use to contact Tower and request a configuration update " +
|
||||
"using the job template. The URL will look like the following:</p>\n" +
|
||||
"<p class=\"code-breakable\">http://your.server.com:999/api/v1/job_templates/1/callback/</p>" +
|
||||
"<p>The request from the host must be a POST. Here is an example using curl:</p>\n" +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n" +
|
||||
"<p>Note the requesting host must be defined in your inventory. If ansible fails to locate the host either by name or IP address " +
|
||||
"in one of your defined inventories, the request will be denied.</p>" +
|
||||
@@ -230,11 +228,11 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataPlacement: 'right',
|
||||
dataTitle: 'Callback URL',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
callback_url: {
|
||||
label: 'Callback URL',
|
||||
label: 'Callback URL',
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
readonly: true,
|
||||
column: 2,
|
||||
@@ -242,7 +240,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
'class': 'span12',
|
||||
awPopOver: "<p>Using this URL a host can contact Tower and request a configuration update using the job " +
|
||||
"template. The request from the host must be a POST. Here is an example using curl:</p>\n" +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n" +
|
||||
"<p>Note the requesting host must be defined in your inventory. If ansible fails to locate the host either by name or IP address " +
|
||||
"in one of your defined inventories, the request will be denied.</p>" +
|
||||
@@ -250,7 +248,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
dataPlacement: 'right',
|
||||
dataTitle: 'Callback URL',
|
||||
dataContainer: "body"
|
||||
},
|
||||
},
|
||||
host_config_key: {
|
||||
label: 'Host Config Key',
|
||||
type: 'text',
|
||||
@@ -259,25 +257,25 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
column: 2,
|
||||
awPopOver: "<p>When contacting the Tower server using the callback URL, the calling host must authenticate by including " +
|
||||
"this key in the POST data of the request. Here's an example using curl:</p>\n" +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"<p class=\"code-breakable\">curl --data \"host_config_key=5a8ec154832b780b9bdef1061764ae5a\" " +
|
||||
"http://your.server.com:999/api/v1/job_templates/1/callback/</p>\n",
|
||||
dataPlacement: 'right',
|
||||
dataContainer: "body"
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
buttons: { //for now always generates <button> tags
|
||||
save: {
|
||||
save: {
|
||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||
ngDisabled: true //Disable when $pristine or $invalid, optional
|
||||
},
|
||||
reset: {
|
||||
},
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
related: { //related colletions (and maybe items?)
|
||||
related: {
|
||||
|
||||
jobs: {
|
||||
type: 'collection',
|
||||
@@ -295,54 +293,55 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('job')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
id: {
|
||||
label: 'Job ID',
|
||||
key: true,
|
||||
desc: true,
|
||||
searchType: 'int'
|
||||
},
|
||||
searchType: 'int'
|
||||
},
|
||||
created: {
|
||||
label: 'Date',
|
||||
link: false,
|
||||
searchable: false
|
||||
},
|
||||
},
|
||||
status: {
|
||||
label: 'Status',
|
||||
"class": 'job-\{\{ job.status \}\}',
|
||||
"class": 'job-{{ job.status }}',
|
||||
searchType: 'select',
|
||||
linkTo: "\{\{ job.statusLinkTo \}\}",
|
||||
linkTo: "{{}} job.statusLinkTo }}",
|
||||
searchOptions: [
|
||||
{ name: "new", value: "new" },
|
||||
{ name: "waiting", value: "waiting" },
|
||||
{ name: "pending", value: "pending" },
|
||||
{ name: "running", value: "running" },
|
||||
{ name: "running", value: "running" },
|
||||
{ name: "successful", value: "successful" },
|
||||
{ name: "error", value: "error" },
|
||||
{ name: "failed", value: "failed" },
|
||||
{ name: "canceled", value: "canceled" } ],
|
||||
badgeIcon: 'fa icon-job-\{\{ job.status \}\}',
|
||||
{ name: "canceled", value: "canceled" }
|
||||
],
|
||||
badgeIcon: 'fa icon-job-{{ job.status }}',
|
||||
badgePlacement: 'left',
|
||||
badgeToolTip: "\{\{ job.statusBadgeToolTip \}\}",
|
||||
badgeToolTip: "{{ job.statusBadgeToolTip }}",
|
||||
badgeTipPlacement: 'top',
|
||||
badgeNgHref: "\{\{ job.statusLinkTo \}\}",
|
||||
awToolTip: "\{\{ job.statusBadgeToolTip \}\}",
|
||||
badgeNgHref: "{{ job.statusLinkTo }}",
|
||||
awToolTip: "{{ job.statusBadgeToolTip }}",
|
||||
dataPlacement: 'top'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
fieldActions: {
|
||||
edit: {
|
||||
label: 'View',
|
||||
ngClick: "edit('jobs', \{\{ job.id \}\}, '\{\{ job.name \}\}')",
|
||||
ngClick: "edit('jobs', job.id, job.name)",
|
||||
icon: 'icon-zoom-in'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}); //InventoryForm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user