mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
@@ -12,9 +12,10 @@
|
|||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('HostFormDefinition', [])
|
angular.module('HostFormDefinition', [])
|
||||||
.value('HostForm', {
|
.factory('HostForm', ['i18n', function(i18n) {
|
||||||
|
return {
|
||||||
|
|
||||||
addTitle: 'Create Host',
|
addTitle: i18n._('Create Host'),
|
||||||
editTitle: '{{ host.name }}',
|
editTitle: '{{ host.name }}',
|
||||||
name: 'host',
|
name: 'host',
|
||||||
basePath: 'hosts',
|
basePath: 'hosts',
|
||||||
@@ -27,46 +28,55 @@ export default
|
|||||||
class: 'Form-header-field',
|
class: 'Form-header-field',
|
||||||
ngClick: 'toggleHostEnabled(host)',
|
ngClick: 'toggleHostEnabled(host)',
|
||||||
type: 'toggle',
|
type: 'toggle',
|
||||||
awToolTip: "<p>Indicates if a host is available and should be included in running jobs.</p><p>For hosts that " +
|
awToolTip: "<p>" +
|
||||||
"are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.</p>",
|
i18n._("Indicates if a host is available and should be included in running jobs.") +
|
||||||
dataTitle: 'Host Enabled',
|
"</p><p>" +
|
||||||
|
i18n._("For hosts that are part of an external" +
|
||||||
|
" inventory, this flag cannot be changed. It will be" +
|
||||||
|
" set by the inventory sync process.") +
|
||||||
|
"</p>",
|
||||||
|
dataTitle: i18n._('Host Enabled'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
label: 'Host Name',
|
label: i18n._('Host Name'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
required: true,
|
required: true,
|
||||||
awPopOver: "<p>Provide a host name, ip address, or ip address:port. Examples include:</p>" +
|
awPopOver: "<p>" +
|
||||||
|
i18n._("Provide a host name, ip address, or ip address:port. Examples include:") +
|
||||||
|
"</p>" +
|
||||||
"<blockquote>myserver.domain.com<br/>" +
|
"<blockquote>myserver.domain.com<br/>" +
|
||||||
"127.0.0.1<br />" +
|
"127.0.0.1<br />" +
|
||||||
"10.1.0.140:25<br />" +
|
"10.1.0.140:25<br />" +
|
||||||
"server.example.com:25" +
|
"server.example.com:25" +
|
||||||
"</blockquote>",
|
"</blockquote>",
|
||||||
dataTitle: 'Host Name',
|
dataTitle: i18n._('Host Name'),
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: i18n._('Description'),
|
||||||
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(host.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
type: 'text'
|
type: 'text'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: 'Variables',
|
label: i18n._('Variables'),
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
rows: 6,
|
rows: 6,
|
||||||
class: 'Form-formGroup--fullWidth',
|
class: 'Form-formGroup--fullWidth',
|
||||||
"default": "---",
|
"default": "---",
|
||||||
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
|
awPopOver: "<p>" +
|
||||||
"JSON:<br />\n" +
|
i18n._("Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") +
|
||||||
"<blockquote>{<br /> \"somevar\": \"somevalue\",<br /> \"password\": \"magic\"<br /> }</blockquote>\n" +
|
"</p>" +
|
||||||
"YAML:<br />\n" +
|
"JSON:<br />\n" +
|
||||||
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
|
"<blockquote>{<br /> \"somevar\": \"somevalue\",<br /> \"password\": \"magic\"<br /> }</blockquote>\n" +
|
||||||
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
|
"YAML:<br />\n" +
|
||||||
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
|
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
|
||||||
dataTitle: 'Host Variables',
|
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
|
||||||
|
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
|
||||||
|
dataTitle: i18n._('Host Variables'),
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: 'body'
|
dataContainer: 'body'
|
||||||
},
|
},
|
||||||
@@ -92,4 +102,5 @@ export default
|
|||||||
ngShow: '(host.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(host.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
}]);
|
||||||
|
|||||||
Reference in New Issue
Block a user