mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
Leveraging CodeMirror to display extra variables for management jobs
This commit is contained in:
parent
51cb262a84
commit
73d80f7179
@ -49,13 +49,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TODO: figure out how to show the extra vars on different rows like the mockup -->
|
||||
|
||||
<div class="StandardOut-detailsRow" ng-show="job.extra_vars">
|
||||
<div class="StandardOut-detailsLabel">EXTRA VARS</div>
|
||||
<div class="StandardOut-detailsContent">
|
||||
{{ job.extra_vars }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="job.extra_vars">
|
||||
<textarea rows="6" ng-model="variables" name="variables" class="StandardOut-extraVars" id="pre-formatted-variables"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
|
||||
export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName) {
|
||||
export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName, ParseTypeChange, ParseVariableString) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
@ -36,6 +36,9 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C
|
||||
// timestamp as well as the run time.
|
||||
});
|
||||
|
||||
// Set the parse type so that CodeMirror knows how to display extra params YAML/JSON
|
||||
$scope.parseType = 'yaml';
|
||||
|
||||
// Go out and get the job details based on the job type. jobType gets defined
|
||||
// in the data block of the route declaration for each of the different types
|
||||
// of stdout jobs.
|
||||
@ -132,6 +135,11 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C
|
||||
});
|
||||
}
|
||||
|
||||
if (!Empty(data.extra_vars)) {
|
||||
$scope.variables = ParseVariableString(data.extra_vars);
|
||||
ParseTypeChange({ scope: $scope, field_id: 'pre-formatted-variables' });
|
||||
}
|
||||
|
||||
// If the job isn't running we want to clear out the interval that goes out and checks for stdout updates.
|
||||
// This interval is defined in the standard out log directive controller.
|
||||
if (data.status === 'successful' || data.status === 'failed' || data.status === 'error' || data.status === 'canceled') {
|
||||
@ -158,4 +166,4 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C
|
||||
|
||||
}
|
||||
|
||||
JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName'];
|
||||
JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName', 'ParseTypeChange', 'ParseVariableString'];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user