1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-28 02:25:27 +03:00

Merge pull request #5809 from ryanpetrello/ad_hoc_extra_vars

show extra_vars in the adhoc results UI, and use them when relaunching
This commit is contained in:
Ryan Petrello 2017-03-21 10:22:10 -04:00 committed by GitHub
commit 301a088922
4 changed files with 27 additions and 3 deletions

View File

@ -3666,7 +3666,7 @@ class AdHocCommandRelaunch(GenericAPIView):
data = {}
for field in ('job_type', 'inventory_id', 'limit', 'credential_id',
'module_name', 'module_args', 'forks', 'verbosity',
'become_enabled'):
'extra_vars', 'become_enabled'):
if field.endswith('_id'):
data[field[:-3]] = getattr(obj, field)
else:

View File

@ -190,7 +190,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
data = {}
for field in ('job_type', 'inventory_id', 'limit', 'credential_id',
'module_name', 'module_args', 'forks', 'verbosity',
'become_enabled'):
'extra_vars', 'become_enabled'):
data[field] = getattr(self, field)
return AdHocCommand.objects.create(**data)

View File

@ -99,6 +99,26 @@
<div class="StandardOut-detailsLabel col-lg-3 col-md-3 col-sm-3 col-xs-4" translate>Verbosity</div>
<div class="StandardOut-detailsContent col-lg-9 col-md-9 col-sm-9 col-xs-8">{{ verbosity }}</div>
</div>
<div class="StandardOut-detailsRow" ng-show="job.extra_vars">
<div class="StandardOut-detailsLabel col-lg-3 col-md-3 col-sm-3 col-xs-4" translate>
Extra Variables
<i class="StandardOut-extraVarsHelp fa fa-question-circle"
aw-tool-tip="Read only view of extra variables added to the ad-hoc command."
data-placement="top">
</i>
</div>
<div class="StandardOut-detailsContent col-lg-9 col-md-9 col-sm-9 col-xs-8">
<textarea
rows="6"
ng-model="extra_vars"
name="variables"
class="StandardOut-extraVars"
id="pre-formatted-variables">
</textarea>
</div>
</div>
</div>
</div>
</div>

View File

@ -149,7 +149,11 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams,
}
if (data.extra_vars) {
ParseTypeChange({ scope: $scope, field_id: 'pre-formatted-variables' });
ParseTypeChange({
scope: $scope,
field_id: 'pre-formatted-variables',
readOnly: true
});
}
if ($scope.job.type === 'inventory_update' && !$scope.inv_manage_group_link) {