mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
quick change to copy template name building, misc #1131 work
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<!-- controls -->
|
<!-- controls -->
|
||||||
<div class="HostEvent-controls">
|
<div class="HostEvent-controls">
|
||||||
<button ng-show="showPrev()" ng-click="goPrevious()"
|
<button ng-show="showPrev()" ng-click="goPrev()"
|
||||||
class="btn btn-sm btn-default">Prev</button>
|
class="btn btn-sm btn-default">Prev</button>
|
||||||
<button ng-show="showNext()"ng-click="goNext()" class="btn btn-sm btn-default">Next</button>
|
<button ng-show="showNext()"ng-click="goNext()" class="btn btn-sm btn-default">Next</button>
|
||||||
<button ui-sref="jobDetail" class="btn btn-sm btn-default" ng-show="true" >Close</button>
|
<button ui-sref="jobDetail" class="btn btn-sm btn-default" ng-show="true" >Close</button>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
}
|
}
|
||||||
.HostEvent-controls{
|
.HostEvent-controls{
|
||||||
float: right;
|
float: right;
|
||||||
|
button {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.HostEvent-status--ok{
|
.HostEvent-status--ok{
|
||||||
color: @green;
|
color: @green;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
$state.go('jobDetail.host-event.details', {eventId: id})
|
$state.go('jobDetail.host-event.details', {eventId: id})
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.goPrevious = function(){
|
$scope.goPrev = function(){
|
||||||
var index = $scope.getActiveHostIndex() - 1;
|
var index = $scope.getActiveHostIndex() - 1;
|
||||||
var id = $scope.hostResults[index].id;
|
var id = $scope.hostResults[index].id;
|
||||||
$state.go('jobDetail.host-event.details', {eventId: id})
|
$state.go('jobDetail.host-event.details', {eventId: id})
|
||||||
|
|||||||
@@ -33,16 +33,18 @@ export default
|
|||||||
});
|
});
|
||||||
|
|
||||||
// flatten Ansible's passed-through response
|
// flatten Ansible's passed-through response
|
||||||
result.event_data = {};
|
try{
|
||||||
Object.keys(data.event_data.res).forEach(function(key, index){
|
result.event_data = {};
|
||||||
if (ignored.indexOf(key) > -1) {
|
Object.keys(data.event_data.res).forEach(function(key, index){
|
||||||
return
|
if (ignored.indexOf(key) > -1) {
|
||||||
}
|
return
|
||||||
else{
|
}
|
||||||
//console.log(key, data.event_data.res[key])
|
else{
|
||||||
result.event_data[key] = data.event_data.res[key];
|
result.event_data[key] = data.event_data.res[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
catch(err){result.event_data = null;}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
set: function(data){
|
set: function(data){
|
||||||
var defaultUrl = GetBasePath('job_templates');
|
var defaultUrl = GetBasePath('job_templates');
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
data.results[0].name = data.results[0].name + ' ' + moment().format('h:mm:ss a'); // 2:49:11 pm
|
var name = this.buildName(data.results[0].name)
|
||||||
|
data.results[0].name = name + ' @ ' + moment().format('h:mm:ss a'); // 2:49:11 pm
|
||||||
return Rest.post(data.results[0])
|
return Rest.post(data.results[0])
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
return res
|
return res
|
||||||
@@ -32,6 +33,10 @@
|
|||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
buildName: function(name){
|
||||||
|
var result = name.split('@')[0];
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user