added 'launched by' field into job detail->more section

This commit is contained in:
Jared Tabor
2014-09-02 14:25:49 -04:00
parent b8f6b2834d
commit ab971215c8
2 changed files with 30 additions and 0 deletions

View File

@@ -589,6 +589,28 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
}
});
if (scope.removeGetCreatedByNames) {
scope.removeGetCreatedByNames();
}
scope.removeGetCreatedByNames = scope.$on('GetCreatedByNames', function(e, data) {
var url;
data = data.slice(0, data.length-1);
data = data.slice(data.lastIndexOf('/')+1, data.length);
url = GetBasePath('users') + data + '/';
scope.users_url = '/#/users/' + data;
Rest.setUrl(url);
Rest.get()
.success( function(data) {
scope.created_by = data.username;
})
.error( function(data, status) {
scope.credential_name = '';
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + '. GET returned: ' + status });
});
});
if (scope.removeLoadJob) {
scope.removeLoadJob();
}
@@ -668,6 +690,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
}
//scope.setSearchAll('host');
scope.$emit('LoadPlays', data.related.job_events);
scope.$emit('GetCreatedByNames', data.related.created_by);
if (!scope.credential_name) {
scope.$emit('GetCredentialNames', data);
}

View File

@@ -56,6 +56,13 @@
<div class="col-lg-10- col-md-10 col-sm-10 col-xs-9">{{ job_type }}</div>
</div>
<div class="form-group toggle-show" style="display:none;" ng-show="created_by">
<label class="col-lg-2 col-md-2 col-sm-2 col-xs-3 control-label">Launched By</label>
<div class="col-lg-10- col-md-10 col-sm-10 col-xs-9">
<a href="{{ users_url }}" aw-tool-tip="Edit the User" data-placement="top">{{ created_by }}</a>
</div>
</div>
<div class="form-group toggle-show" style="display:none;" ng-show="inventory_name">
<label class="col-lg-2 col-md-2 col-sm-2 col-xs-3 control-label">Inventory</label>
<div class="col-lg-10- col-md-10 col-sm-10 col-xs-9">