mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
additional merge conflict fixes for JShint linting
This commit is contained in:
committed by
Leigh Johnson
parent
83e79724d1
commit
cd6fff70a8
@@ -50,15 +50,11 @@ import adhoc from './adhoc/main';
|
|||||||
import login from './login/main';
|
import login from './login/main';
|
||||||
import activityStream from './activity-stream/main';
|
import activityStream from './activity-stream/main';
|
||||||
import standardOut from './standard-out/main';
|
import standardOut from './standard-out/main';
|
||||||
import lookUpHelper from './lookup/main';
|
|
||||||
import JobTemplates from './job-templates/main';
|
import JobTemplates from './job-templates/main';
|
||||||
import search from './search/main';
|
import search from './search/main';
|
||||||
import {ScheduleEditController} from './controllers/Schedules';
|
|
||||||
import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects';
|
import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects';
|
||||||
import OrganizationsList from './organizations/list/organizations-list.controller';
|
import OrganizationsList from './organizations/list/organizations-list.controller';
|
||||||
import OrganizationsAdd from './organizations/add/organizations-add.controller';
|
import OrganizationsAdd from './organizations/add/organizations-add.controller';
|
||||||
import OrganizationsEdit from './organizations/edit/organizations-edit.controller';
|
|
||||||
import {InventoriesAdd, InventoriesEdit, InventoriesList, InventoriesManage} from './inventories/main';
|
|
||||||
import {AdminsList} from './controllers/Admins';
|
import {AdminsList} from './controllers/Admins';
|
||||||
import {UsersList, UsersAdd, UsersEdit} from './controllers/Users';
|
import {UsersList, UsersAdd, UsersEdit} from './controllers/Users';
|
||||||
import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams';
|
import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams';
|
||||||
@@ -199,7 +195,7 @@ var tower = angular.module('Tower', [
|
|||||||
'pendolytics',
|
'pendolytics',
|
||||||
'ui.router',
|
'ui.router',
|
||||||
'ncy-angular-breadcrumb',
|
'ncy-angular-breadcrumb',
|
||||||
'scheduler',
|
scheduler.name,
|
||||||
'ApiModelHelper',
|
'ApiModelHelper',
|
||||||
'ActivityStreamHelper',
|
'ActivityStreamHelper',
|
||||||
'dndLists'
|
'dndLists'
|
||||||
@@ -917,7 +913,7 @@ var tower = angular.module('Tower', [
|
|||||||
activateTab();
|
activateTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
|
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState) {
|
||||||
// catch license expiration notifications immediately after user logs in, redirect
|
// catch license expiration notifications immediately after user logs in, redirect
|
||||||
if (fromState.name === 'signIn'){
|
if (fromState.name === 'signIn'){
|
||||||
CheckLicense.notify();
|
CheckLicense.notify();
|
||||||
|
|||||||
@@ -15,17 +15,14 @@ var hostEventModal = {
|
|||||||
features: ['FeaturesService', function(FeaturesService){
|
features: ['FeaturesService', function(FeaturesService){
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}],
|
}],
|
||||||
event: ['JobDetailService','$stateParams', 'moment', function(JobDetailService, $stateParams, moment) {
|
event: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) {
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
id: $stateParams.eventId,
|
id: $stateParams.eventId
|
||||||
}).then(function(res){
|
}).success(function(res){ return res.results[0];});
|
||||||
res.data.results[0].created = moment(res.data.results[0].created).format('MMMM Do YYYY, h:mm:ss a');
|
|
||||||
return res.data.results[0];
|
|
||||||
});
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
onExit: function($state){
|
onExit: function(){
|
||||||
// close the modal
|
// close the modal
|
||||||
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
$('#HostEvent').modal('hide');
|
$('#HostEvent').modal('hide');
|
||||||
// hacky way to handle user browsing away via URL bar
|
// hacky way to handle user browsing away via URL bar
|
||||||
@@ -55,4 +52,4 @@ var hostEventModal = {
|
|||||||
templateUrl: templateUrl('job-detail/host-event/host-event-stdout')
|
templateUrl: templateUrl('job-detail/host-event/host-event-stdout')
|
||||||
};
|
};
|
||||||
|
|
||||||
export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal}
|
export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default
|
export default
|
||||||
['$stateParams', '$scope', '$rootScope', '$state', 'Wait',
|
['$stateParams', '$scope', '$rootScope', '$state', 'Wait',
|
||||||
'JobDetailService', 'CreateSelect2', 'hosts',
|
'JobDetailService', 'CreateSelect2', 'hosts',
|
||||||
function($stateParams, $scope, $rootScope, $state, Wait,
|
function($stateParams, $scope, $rootScope, $state, Wait,
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
$scope.search = function(){
|
$scope.search = function(){
|
||||||
Wait('start');
|
Wait('start');
|
||||||
if ($scope.searchStr == undefined){
|
if ($scope.searchStr === undefined){
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
//http://docs.ansible.com/ansible-tower/latest/html/towerapi/intro.html#filtering
|
//http://docs.ansible.com/ansible-tower/latest/html/towerapi/intro.html#filtering
|
||||||
// SELECT WHERE host_name LIKE str OR WHERE play LIKE str OR WHERE task LIKE str AND host_name NOT ""
|
// SELECT WHERE host_name LIKE str OR WHERE play LIKE str OR WHERE task LIKE str AND host_name NOT ""
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
page_size: $scope.pageSize})
|
page_size: $scope.pageSize})
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop')
|
Wait('stop');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
var filter = function(filter){
|
var filter = function(filter){
|
||||||
Wait('start');
|
Wait('start');
|
||||||
|
|
||||||
if (filter == 'all'){
|
if (filter === 'all'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
page_size: $scope.pageSize})
|
page_size: $scope.pageSize})
|
||||||
@@ -51,25 +51,25 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// handle runner cases
|
// handle runner cases
|
||||||
if (filter == 'skipped'){
|
if (filter === 'skipped'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
event: 'runner_on_skipped'})
|
event: 'runner_on_skipped'})
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (filter == 'unreachable'){
|
if (filter === 'unreachable'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
event: 'runner_on_unreachable'})
|
event: 'runner_on_unreachable'})
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (filter == 'ok'){
|
if (filter === 'ok'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
or__field__event: 'runner_on_ok',
|
or__field__event: 'runner_on_ok',
|
||||||
@@ -79,31 +79,31 @@
|
|||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// handle convience properties .changed .failed
|
// handle convience properties .changed .failed
|
||||||
if (filter == 'changed'){
|
if (filter === 'changed'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
changed: true})
|
changed: true})
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (filter == 'failed'){
|
if (filter === 'failed'){
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName,
|
host_name: $stateParams.hostName,
|
||||||
failed: true})
|
failed: true})
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// watch select2 for changes
|
// watch select2 for changes
|
||||||
$('.HostEvents-select').on("select2:select", function (e) {
|
$('.HostEvents-select').on("select2:select", function () {
|
||||||
filter($('.HostEvents-select').val());
|
filter($('.HostEvents-select').val());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -121,15 +121,15 @@
|
|||||||
$scope.results = res.results;
|
$scope.results = res.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#HostEvents').modal('show');
|
$('#HostEvents').modal('show');
|
||||||
});;
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$scope.results = hosts.data.results;
|
$scope.results = hosts.data.results;
|
||||||
$('#HostEvents').modal('show');
|
$('#HostEvents').modal('show');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
hosts: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) {
|
hosts: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) {
|
||||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||||
host_name: $stateParams.hostName
|
host_name: $stateParams.hostName
|
||||||
}).success(function(res){ return res.results[0]})
|
}).success(function(res){ return res.results[0];});
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ export default
|
|||||||
angular.module('jobDetail.hostEvents', [])
|
angular.module('jobDetail.hostEvents', [])
|
||||||
.controller('HostEventsController', controller)
|
.controller('HostEventsController', controller)
|
||||||
.run(['$stateExtender', function($stateExtender){
|
.run(['$stateExtender', function($stateExtender){
|
||||||
$stateExtender.addState(route)
|
$stateExtender.addState(route);
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default
|
|||||||
scope.parseType = 'yaml';
|
scope.parseType = 'yaml';
|
||||||
scope.previousTaskFailed = false;
|
scope.previousTaskFailed = false;
|
||||||
$scope.stdoutFullScreen = false;
|
$scope.stdoutFullScreen = false;
|
||||||
|
|
||||||
scope.$watch('job_status', function(job_status) {
|
scope.$watch('job_status', function(job_status) {
|
||||||
if (job_status && job_status.explanation && job_status.explanation.split(":")[0] === "Previous Task Failed") {
|
if (job_status && job_status.explanation && job_status.explanation.split(":")[0] === "Previous Task Failed") {
|
||||||
scope.previousTaskFailed = true;
|
scope.previousTaskFailed = true;
|
||||||
@@ -248,14 +248,14 @@ export default
|
|||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
msg: 'Call failed. GET returned: ' + status });
|
||||||
});
|
});
|
||||||
$log.debug('Job completed!');
|
$log.debug('Job completed!');
|
||||||
$log.debug(scope.jobData);
|
$log.debug(scope.jobData);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
api_complete = true; //trigger events to start processing
|
api_complete = true; //trigger events to start processing
|
||||||
UpdateDOM({ scope: scope})
|
UpdateDOM({ scope: scope});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -274,10 +274,11 @@ export default
|
|||||||
var params = {
|
var params = {
|
||||||
parent: task.id,
|
parent: task.id,
|
||||||
event__startswith: 'runner',
|
event__startswith: 'runner',
|
||||||
|
page_size: scope.hostResultsMaxRows
|
||||||
};
|
};
|
||||||
JobDetailService.getRelatedJobEvents(scope.job.id, params)
|
JobDetailService.getRelatedJobEvents(scope.job.id, params)
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
var event, status, status_text, item, msg;
|
var event, status, item, msg;
|
||||||
if (data.results.length > 0) {
|
if (data.results.length > 0) {
|
||||||
lastEventId = data.results[0].id;
|
lastEventId = data.results[0].id;
|
||||||
}
|
}
|
||||||
@@ -305,7 +306,7 @@ export default
|
|||||||
event_id: play.id,
|
event_id: play.id,
|
||||||
page_size: scope.tasksMaxRows,
|
page_size: scope.tasksMaxRows,
|
||||||
order: 'id'
|
order: 'id'
|
||||||
}
|
};
|
||||||
JobDetailService.getJobTasks(scope.job.id, params)
|
JobDetailService.getJobTasks(scope.job.id, params)
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
scope.next_tasks = data.next;
|
scope.next_tasks = data.next;
|
||||||
@@ -395,7 +396,7 @@ export default
|
|||||||
})
|
})
|
||||||
.error(function(data) {
|
.error(function(data) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
msg: 'Call failed. GET returned: ' + status });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
scope.$emit('InitialLoadComplete');
|
scope.$emit('InitialLoadComplete');
|
||||||
@@ -413,7 +414,7 @@ export default
|
|||||||
var params = {
|
var params = {
|
||||||
order_by: 'id'
|
order_by: 'id'
|
||||||
};
|
};
|
||||||
if (scope.job.summary_fields.unified_job_template.unified_job_type == 'job'){
|
if (scope.job.summary_fields.unified_job_template.unified_job_type === 'job'){
|
||||||
JobDetailService.getJobPlays(scope.job.id, params)
|
JobDetailService.getJobPlays(scope.job.id, params)
|
||||||
.success( function(data) {
|
.success( function(data) {
|
||||||
scope.next_plays = data.next;
|
scope.next_plays = data.next;
|
||||||
@@ -839,12 +840,12 @@ export default
|
|||||||
page_size: scope.hostResultsMaxRows,
|
page_size: scope.hostResultsMaxRows,
|
||||||
order: 'host_name,counter',
|
order: 'host_name,counter',
|
||||||
host_name__icontains: scope.search_host_name
|
host_name__icontains: scope.search_host_name
|
||||||
}
|
};
|
||||||
if (scope.search_host_status === 'failed'){
|
if (scope.search_host_status === 'failed'){
|
||||||
params.failed = true;
|
params.failed = true;
|
||||||
}
|
}
|
||||||
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
||||||
scope.hostResults = JobDetailService.processHostEvents(res.results)
|
scope.hostResults = JobDetailService.processHostEvents(res.results);
|
||||||
scope.hostResultsLoading = false;
|
scope.hostResultsLoading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1093,7 +1094,7 @@ export default
|
|||||||
// Click binding for the expand/collapse button on the standard out log
|
// Click binding for the expand/collapse button on the standard out log
|
||||||
$scope.toggleStdoutFullscreen = function() {
|
$scope.toggleStdoutFullscreen = function() {
|
||||||
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
||||||
}
|
};
|
||||||
|
|
||||||
scope.editSchedule = function() {
|
scope.editSchedule = function() {
|
||||||
// We need to get the schedule's ID out of the related links
|
// We need to get the schedule's ID out of the related links
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
export default
|
export default
|
||||||
['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', function($rootScope, Rest, GetBasePath, ProcessErrors){
|
['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', function($rootScope, Rest, GetBasePath, ProcessErrors){
|
||||||
return {
|
return {
|
||||||
|
|
||||||
stringifyParams: function(params){
|
stringifyParams: function(params){
|
||||||
return _.reduce(params, (result, value, key) => {
|
return _.reduce(params, (result, value, key) => {
|
||||||
return result + key + '=' + value + '&'}, '');
|
return result + key + '=' + value + '&'}, '');
|
||||||
@@ -14,15 +13,15 @@ export default
|
|||||||
var result = $.extend(true, {}, data);
|
var result = $.extend(true, {}, data);
|
||||||
// configure fields to ignore
|
// configure fields to ignore
|
||||||
var ignored = [
|
var ignored = [
|
||||||
'event_data',
|
'event_data',
|
||||||
'related',
|
'related',
|
||||||
'summary_fields',
|
'summary_fields',
|
||||||
'url',
|
'url',
|
||||||
'ansible_facts',
|
'ansible_facts',
|
||||||
];
|
];
|
||||||
|
|
||||||
// remove ignored properties
|
// remove ignored properties
|
||||||
Object.keys(result).forEach(function(key, index){
|
Object.keys(result).forEach(function(key){
|
||||||
if (ignored.indexOf(key) > -1) {
|
if (ignored.indexOf(key) > -1) {
|
||||||
delete result[key];
|
delete result[key];
|
||||||
}
|
}
|
||||||
@@ -31,7 +30,7 @@ export default
|
|||||||
// flatten Ansible's passed-through response
|
// flatten Ansible's passed-through response
|
||||||
try{
|
try{
|
||||||
result.event_data = {};
|
result.event_data = {};
|
||||||
Object.keys(data.event_data.res).forEach(function(key, index){
|
Object.keys(data.event_data.res).forEach(function(key){
|
||||||
if (ignored.indexOf(key) > -1) {
|
if (ignored.indexOf(key) > -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
export default
|
export default
|
||||||
[ 'Wait', '$state', '$scope', 'jobTemplateCopyService',
|
[ 'Wait', '$state', '$scope', 'jobTemplateCopyService',
|
||||||
'ProcessErrors', 'GetBasePath',
|
'ProcessErrors', '$rootScope',
|
||||||
function(Wait, $state, $scope, jobTemplateCopyService,
|
function(Wait, $state, $scope, jobTemplateCopyService,
|
||||||
ProcessErrors, GetBasePath){
|
ProcessErrors, $rootScope){
|
||||||
// GETs the job_template to copy
|
// GETs the job_template to copy
|
||||||
// POSTs a new job_template
|
// POSTs a new job_template
|
||||||
// routes to JobTemplates.edit when finished
|
// routes to JobTemplates.edit when finished
|
||||||
@@ -24,9 +24,9 @@
|
|||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
msg: 'Call failed. Return status: '+ status});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import {templateUrl} from '../../shared/template-url/template-url.factory';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'jobTemplates.copy',
|
name: 'jobTemplates.copy',
|
||||||
route: '/:id/copy',
|
route: '/:id/copy',
|
||||||
controller: 'jobTemplateCopyController'
|
controller: 'jobTemplateCopyController'
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
return Rest.get()
|
return Rest.get()
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
return res
|
return res;
|
||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||||
@@ -23,21 +23,21 @@
|
|||||||
set: function(data){
|
set: function(data){
|
||||||
var defaultUrl = GetBasePath('job_templates');
|
var defaultUrl = GetBasePath('job_templates');
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
var name = this.buildName(data.results[0].name)
|
var name = this.buildName(data.results[0].name);
|
||||||
data.results[0].name = name + ' @ ' + moment().format('h:mm:ss a'); // 2:49:11 pm
|
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;
|
||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
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){
|
buildName: function(name){
|
||||||
var result = name.split('@')[0];
|
var result = name.split('@')[0];
|
||||||
return result
|
return result;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ export default
|
|||||||
.service('jobTemplateCopyService', service)
|
.service('jobTemplateCopyService', service)
|
||||||
.controller('jobTemplateCopyController', controller)
|
.controller('jobTemplateCopyController', controller)
|
||||||
.run(['$stateExtender', function($stateExtender) {
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
$stateExtender.addState(route)
|
$stateExtender.addState(route);
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ export default ['Rest', 'GetBasePath', function(Rest, GetBasePath){
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
return Rest.destroy();
|
return Rest.destroy();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}]
|
}];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ export default
|
|||||||
|
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
index = params.index,
|
index = params.index,
|
||||||
element,
|
|
||||||
tmpVar,
|
tmpVar,
|
||||||
i,
|
i,
|
||||||
question = params.question,
|
question = params.question,
|
||||||
@@ -12,7 +11,7 @@ export default
|
|||||||
|
|
||||||
// Update the index so that we know which question is being edited.
|
// Update the index so that we know which question is being edited.
|
||||||
scope.editQuestionIndex = index;
|
scope.editQuestionIndex = index;
|
||||||
|
|
||||||
scope.text_min = null;
|
scope.text_min = null;
|
||||||
scope.text_max = null;
|
scope.text_max = null;
|
||||||
scope.int_min = null;
|
scope.int_min = null;
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ function link($sce, $filter, Empty, scope, element, attrs) {
|
|||||||
|
|
||||||
function sanitizeDefault() {
|
function sanitizeDefault() {
|
||||||
|
|
||||||
var defaultValue = "";
|
var defaultValue = "",
|
||||||
|
min,
|
||||||
|
max;
|
||||||
|
|
||||||
if(scope.question.type === 'text'|| scope.question.type === "password" ){
|
if(scope.question.type === 'text'|| scope.question.type === "password" ){
|
||||||
defaultValue = (scope.question.default) ? scope.question.default : "";
|
defaultValue = (scope.question.default) ? scope.question.default : "";
|
||||||
@@ -61,14 +63,14 @@ function link($sce, $filter, Empty, scope, element, attrs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scope.question.type === 'integer'){
|
if(scope.question.type === 'integer'){
|
||||||
var min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||||
var max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
||||||
defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_int)) ? scope.question.default_int : "" ;
|
defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_int)) ? scope.question.default_int : "" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(scope.question.type === "float"){
|
if(scope.question.type === "float"){
|
||||||
var min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||||
var max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
||||||
defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_float)) ? scope.question.default_float : "" ;
|
defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_float)) ? scope.question.default_float : "" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export default
|
|||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
id = params.id,
|
id = params.id,
|
||||||
url = GetBasePath('job_templates') + id + '/survey_spec/', i;
|
url = GetBasePath('job_templates') + id + '/survey_spec/';
|
||||||
|
|
||||||
if (scope.removeDialogReady) {
|
if (scope.removeDialogReady) {
|
||||||
scope.removeDialogReady();
|
scope.removeDialogReady();
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ export default
|
|||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
id = params.id,
|
id = params.id,
|
||||||
i, url, html, element,
|
|
||||||
questions = [],
|
|
||||||
form = SurveyQuestionForm,
|
form = SurveyQuestionForm,
|
||||||
sce = params.sce;
|
sce = params.sce;
|
||||||
scope.sce = sce;
|
scope.sce = sce;
|
||||||
@@ -73,7 +71,7 @@ export default
|
|||||||
scope.survey_questions = [];
|
scope.survey_questions = [];
|
||||||
}
|
}
|
||||||
$('#' + id).dialog('destroy');
|
$('#' + id).dialog('destroy');
|
||||||
}
|
};
|
||||||
|
|
||||||
// Gets called when a user actually hits the save button. Functionality differs
|
// Gets called when a user actually hits the save button. Functionality differs
|
||||||
// based on the mode. scope.mode="add" cleans up scope.survey_questions and
|
// based on the mode. scope.mode="add" cleans up scope.survey_questions and
|
||||||
@@ -83,8 +81,8 @@ export default
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
if(scope.mode ==="add"){
|
if(scope.mode ==="add"){
|
||||||
// Loop across the survey questions and remove any new_question flags
|
// Loop across the survey questions and remove any new_question flags
|
||||||
angular.forEach(scope.survey_questions, function(question, key) {
|
angular.forEach(scope.survey_questions, function(question) {
|
||||||
delete question['new_question'];
|
delete question.new_question;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#survey-modal-dialog').dialog('destroy');
|
$('#survey-modal-dialog').dialog('destroy');
|
||||||
@@ -100,28 +98,28 @@ export default
|
|||||||
var updateSurveyQuestions = function() {
|
var updateSurveyQuestions = function() {
|
||||||
Rest.setUrl(GetBasePath('job_templates') + id + '/survey_spec/');
|
Rest.setUrl(GetBasePath('job_templates') + id + '/survey_spec/');
|
||||||
return Rest.post({name: scope.survey_name, description: scope.survey_description, spec: scope.survey_questions })
|
return Rest.post({name: scope.survey_name, description: scope.survey_description, spec: scope.survey_questions })
|
||||||
.success(function (data) {
|
.success(function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Failed to add new survey. POST returned status: ' + status });
|
msg: 'Failed to add new survey. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
var updateSurveyEnabled = function() {
|
var updateSurveyEnabled = function() {
|
||||||
Rest.setUrl(GetBasePath('job_templates') + id+ '/');
|
Rest.setUrl(GetBasePath('job_templates') + id+ '/');
|
||||||
return Rest.patch({"survey_enabled": scope.survey_enabled})
|
return Rest.patch({"survey_enabled": scope.survey_enabled})
|
||||||
.success(function (data) {
|
.success(function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, form, {
|
ProcessErrors(scope, data, status, form, {
|
||||||
hdr: 'Error!',
|
hdr: 'Error!',
|
||||||
msg: 'Failed to retrieve save survey_enabled: ' + $routeParams.template_id + '. GET status: ' + status
|
msg: 'Failed to save survey_enabled: GET status: ' + status
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
updateSurveyQuestions()
|
updateSurveyQuestions()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
@@ -130,7 +128,7 @@ export default
|
|||||||
.then(function() {
|
.then(function() {
|
||||||
scope.closeSurvey('survey-modal-dialog');
|
scope.closeSurvey('survey-modal-dialog');
|
||||||
scope.$emit('SurveySaved');
|
scope.$emit('SurveySaved');
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -173,7 +171,7 @@ export default
|
|||||||
scope.questionToBeDeleted = deleteIndex;
|
scope.questionToBeDeleted = deleteIndex;
|
||||||
// Show the delete overlay with mode='question'
|
// Show the delete overlay with mode='question'
|
||||||
scope.showDeleteOverlay('question');
|
scope.showDeleteOverlay('question');
|
||||||
}
|
};
|
||||||
|
|
||||||
// Called after a user confirms question deletion (hitting the DELETE button on the delete question overlay).
|
// Called after a user confirms question deletion (hitting the DELETE button on the delete question overlay).
|
||||||
scope.deleteQuestion = function(index){
|
scope.deleteQuestion = function(index){
|
||||||
@@ -181,7 +179,7 @@ export default
|
|||||||
// one being edited in the array. This makes sure that our pointer to the question
|
// one being edited in the array. This makes sure that our pointer to the question
|
||||||
// currently being edited gets updated independently from a deleted question.
|
// currently being edited gets updated independently from a deleted question.
|
||||||
if(GenerateForm.mode === 'edit' && !isNaN(scope.editQuestionIndex)){
|
if(GenerateForm.mode === 'edit' && !isNaN(scope.editQuestionIndex)){
|
||||||
if(scope.editQuestionIndex == index) {
|
if(scope.editQuestionIndex === index) {
|
||||||
// The user is deleting the question being edited - need to roll back to Add Question mode
|
// The user is deleting the question being edited - need to roll back to Add Question mode
|
||||||
scope.editQuestionIndex = null;
|
scope.editQuestionIndex = null;
|
||||||
scope.generateAddQuestionForm();
|
scope.generateAddQuestionForm();
|
||||||
@@ -238,7 +236,7 @@ export default
|
|||||||
|
|
||||||
// Set the whole form to pristine
|
// Set the whole form to pristine
|
||||||
scope.survey_question_form.$setPristine();
|
scope.survey_question_form.$setPristine();
|
||||||
}
|
};
|
||||||
|
|
||||||
// Gets called when the "type" dropdown value changes. In that case, we want to clear out
|
// Gets called when the "type" dropdown value changes. In that case, we want to clear out
|
||||||
// all the "type" specific fields/errors and start fresh.
|
// all the "type" specific fields/errors and start fresh.
|
||||||
@@ -258,12 +256,11 @@ export default
|
|||||||
// Function that gets called when a user hits ADD/UPDATE on the survey question form. This
|
// Function that gets called when a user hits ADD/UPDATE on the survey question form. This
|
||||||
// function handles some validation as well as eventually adding the question to the
|
// function handles some validation as well as eventually adding the question to the
|
||||||
// scope.survey_questions array.
|
// scope.survey_questions array.
|
||||||
scope.submitQuestion = function(event){
|
scope.submitQuestion = function(){
|
||||||
var data = {},
|
var data = {},
|
||||||
fld, i,
|
fld, i,
|
||||||
choiceArray,
|
choiceArray,
|
||||||
answerArray,
|
answerArray;
|
||||||
key, elementID;
|
|
||||||
scope.invalidChoice = false;
|
scope.invalidChoice = false;
|
||||||
scope.duplicate = false;
|
scope.duplicate = false;
|
||||||
scope.minTextError = false;
|
scope.minTextError = false;
|
||||||
@@ -333,7 +330,7 @@ export default
|
|||||||
if(GenerateForm.mode === 'edit'){
|
if(GenerateForm.mode === 'edit'){
|
||||||
// Loop across the survey questions and see if a different question already has
|
// Loop across the survey questions and see if a different question already has
|
||||||
// the same variable name
|
// the same variable name
|
||||||
for(var i=0; i<scope.survey_questions.length; i++){
|
for( i=0; i<scope.survey_questions.length; i++){
|
||||||
if(scope.survey_questions[i].variable === scope.variable && i!==scope.editQuestionIndex){
|
if(scope.survey_questions[i].variable === scope.variable && i!==scope.editQuestionIndex){
|
||||||
scope.duplicate = true;
|
scope.duplicate = true;
|
||||||
}
|
}
|
||||||
@@ -475,11 +472,11 @@ export default
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
// return true here signals that the drop is allowed, but that we've already taken care of inserting the element
|
// return true here signals that the drop is allowed, but that we've already taken care of inserting the element
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Gets called when a user is creating/editing a question that has a password
|
// Gets called when a user is creating/editing a question that has a password
|
||||||
// field. The password field in the form has a SHOW/HIDE button that calls this.
|
// field. The password field in the form has a SHOW/HIDE button that calls this.
|
||||||
@@ -508,7 +505,7 @@ export default
|
|||||||
scope.deleteMode = mode;
|
scope.deleteMode = mode;
|
||||||
// Flip the deleteOverlayVisible flag so that the overlay becomes visible via ng-show
|
// Flip the deleteOverlayVisible flag so that the overlay becomes visible via ng-show
|
||||||
scope.deleteOverlayVisible = true;
|
scope.deleteOverlayVisible = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Called by the cancel/close buttons on the delete overlay. Also called after deletion has been confirmed.
|
// Called by the cancel/close buttons on the delete overlay. Also called after deletion has been confirmed.
|
||||||
scope.hideDeleteOverlay = function() {
|
scope.hideDeleteOverlay = function() {
|
||||||
@@ -518,14 +515,14 @@ export default
|
|||||||
scope.questionToBeDeleted = null;
|
scope.questionToBeDeleted = null;
|
||||||
// Hide the delete overlay
|
// Hide the delete overlay
|
||||||
scope.deleteOverlayVisible = false;
|
scope.deleteOverlayVisible = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
/* END DELETE OVERLAY RELATED FUNCTIONS */
|
/* END DELETE OVERLAY RELATED FUNCTIONS */
|
||||||
|
|
||||||
// Watcher that updates the survey enabled/disabled tooltip based on scope.survey_enabled
|
// Watcher that updates the survey enabled/disabled tooltip based on scope.survey_enabled
|
||||||
scope.$watch('survey_enabled', function(newVal, oldVal) {
|
scope.$watch('survey_enabled', function(newVal) {
|
||||||
scope.surveyEnabledTooltip = (newVal) ? "Disable survey" : "Enable survey";
|
scope.surveyEnabledTooltip = (newVal) ? "Disable survey" : "Enable survey";
|
||||||
})
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
return Rest.get()
|
return Rest.get()
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
return res
|
return res;
|
||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||||
@@ -26,7 +26,7 @@ export default
|
|||||||
data.eula_accepted = eula;
|
data.eula_accepted = eula;
|
||||||
return Rest.post(JSON.stringify(data))
|
return Rest.post(JSON.stringify(data))
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
return res
|
return res;
|
||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||||
@@ -38,25 +38,27 @@ export default
|
|||||||
// Returns false if invalid
|
// Returns false if invalid
|
||||||
valid: function(license) {
|
valid: function(license) {
|
||||||
if (!license.valid_key){
|
if (!license.valid_key){
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
else if (license.free_instances <= 0){
|
else if (license.free_instances <= 0){
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
// notify if less than 15 days remaining
|
// notify if less than 15 days remaining
|
||||||
else if (license.time_remaining / 1000 / 60 / 60 / 24 > 15){
|
else if (license.time_remaining / 1000 / 60 / 60 / 24 > 15){
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
return true
|
return true;
|
||||||
},
|
},
|
||||||
notify: function(){
|
notify: function(){
|
||||||
self = this;
|
var self = this;
|
||||||
this.get()
|
this.get()
|
||||||
.then(function(res){
|
.then(function(res){
|
||||||
self.valid(res.data.license_info) ? null : $state.go('license');
|
if(self.valid(res.data.license_info) === false) {
|
||||||
|
$state.go('license');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ export default
|
|||||||
var onChange = scope.$eval(attrs.fileOnChange);
|
var onChange = scope.$eval(attrs.fileOnChange);
|
||||||
el.bind('change', onChange);
|
el.bind('change', onChange);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default
|
|||||||
catch(err) {
|
catch(err) {
|
||||||
ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'});
|
ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
try {
|
try {
|
||||||
raw.readAsText(event.target.files[0]);
|
raw.readAsText(event.target.files[0]);
|
||||||
}
|
}
|
||||||
@@ -34,12 +34,12 @@ export default
|
|||||||
// So we hide the default input, show our own, and simulate clicks to the hidden input
|
// So we hide the default input, show our own, and simulate clicks to the hidden input
|
||||||
$scope.fakeClick = function(){
|
$scope.fakeClick = function(){
|
||||||
$('#License-file').click();
|
$('#License-file').click();
|
||||||
}
|
};
|
||||||
$scope.newLicense = {};
|
$scope.newLicense = {};
|
||||||
$scope.submit = function(event){
|
$scope.submit = function(){
|
||||||
Wait('start');
|
Wait('start');
|
||||||
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
|
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
|
||||||
.success(function(res){
|
.success(function(){
|
||||||
reset();
|
reset();
|
||||||
init();
|
init();
|
||||||
$scope.success = true;
|
$scope.success = true;
|
||||||
@@ -53,15 +53,15 @@ export default
|
|||||||
var calcDaysRemaining = function(ms){
|
var calcDaysRemaining = function(ms){
|
||||||
// calculate the number of days remaining on the license
|
// calculate the number of days remaining on the license
|
||||||
var duration = moment.duration(ms);
|
var duration = moment.duration(ms);
|
||||||
return duration.days()
|
return duration.days();
|
||||||
};
|
};
|
||||||
|
|
||||||
var calcExpiresOn = function(days){
|
var calcExpiresOn = function(days){
|
||||||
// calculate the expiration date of the license
|
// calculate the expiration date of the license
|
||||||
return moment().add(days, 'days').calendar()
|
return moment().add(days, 'days').calendar();
|
||||||
};
|
};
|
||||||
var init = function(){
|
var init = function(){
|
||||||
$scope.fileName = "Please choose a file..."
|
$scope.fileName = "Please choose a file...";
|
||||||
Wait('start');
|
Wait('start');
|
||||||
CheckLicense.get()
|
CheckLicense.get()
|
||||||
.then(function(res){
|
.then(function(res){
|
||||||
@@ -70,13 +70,13 @@ export default
|
|||||||
$scope.time = {};
|
$scope.time = {};
|
||||||
$scope.time.remaining = calcDaysRemaining($scope.license.license_info.time_remaining);
|
$scope.time.remaining = calcDaysRemaining($scope.license.license_info.time_remaining);
|
||||||
$scope.time.expiresOn = calcExpiresOn($scope.time.remaining);
|
$scope.time.expiresOn = calcExpiresOn($scope.time.remaining);
|
||||||
$scope.valid = CheckLicense.valid($scope.license.license_info);
|
$scope.valid = CheckLicense.valid($scope.license.license_info);
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var reset = function(){
|
var reset = function(){
|
||||||
document.getElementById('License-form').reset()
|
document.getElementById('License-form').reset();
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ export default {
|
|||||||
parent: 'setup',
|
parent: 'setup',
|
||||||
label: 'LICENSE'
|
label: 'LICENSE'
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ import thirdPartySignOnService from './thirdPartySignOn.service';
|
|||||||
export default
|
export default
|
||||||
angular.module('thirdPartySignOn', [])
|
angular.module('thirdPartySignOn', [])
|
||||||
.directive('thirdPartySignOn', thirdPartySignOnDirective)
|
.directive('thirdPartySignOn', thirdPartySignOnDirective)
|
||||||
.factory('thirdPartySignOnService', thirdPartySignOnService)
|
.factory('thirdPartySignOnService', thirdPartySignOnService);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default ['$window', '$scope', 'thirdPartySignOnService',
|
|||||||
if (data && data.error) {
|
if (data && data.error) {
|
||||||
$scope.$parent.thirdPartyAttemptFailed = data.error;
|
$scope.$parent.thirdPartyAttemptFailed = data.error;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
$scope.goTo = function(link) {
|
$scope.goTo = function(link) {
|
||||||
// this is used because $location only lets you navigate inside
|
// this is used because $location only lets you navigate inside
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default
|
|||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
|
|
||||||
scope.isCurrentState = function(name){
|
scope.isCurrentState = function(name){
|
||||||
return $state.current.name == name
|
return $state.current.name === name;
|
||||||
};
|
};
|
||||||
|
|
||||||
// set up the user tooltip
|
// set up the user tooltip
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ export default
|
|||||||
};
|
};
|
||||||
getManagementJobs();
|
getManagementJobs();
|
||||||
var scope = $rootScope.$new(),
|
var scope = $rootScope.$new(),
|
||||||
parent_scope = scope,
|
parent_scope = scope;
|
||||||
list = managementJobsListObject;
|
|
||||||
scope.cleanupJob = true;
|
scope.cleanupJob = true;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import route from './organizations-add.route';
|
import route from './organizations-add.route';
|
||||||
import controller from './organizations-add.controller';
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('organizationsAdd', [])
|
angular.module('organizationsAdd', [])
|
||||||
|
|||||||
@@ -63,4 +63,4 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
|||||||
$state.transitionTo('organizations');
|
$state.transitionTo('organizations');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import route from './organizations-list.route';
|
import route from './organizations-list.route';
|
||||||
import controller from './organizations-list.controller';
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('organizationsList', [])
|
angular.module('organizationsList', [])
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
|
|
||||||
var paginationContainer = $('#pagination-container');
|
var paginationContainer = $('#pagination-container');
|
||||||
paginationContainer.html($scope.PaginateWidget);
|
paginationContainer.html($scope.PaginateWidget);
|
||||||
$compile(paginationContainer.contents())($scope)
|
$compile(paginationContainer.contents())($scope);
|
||||||
|
|
||||||
var parseCardData = function(cards) {
|
var parseCardData = function(cards) {
|
||||||
return cards.map(function(card) {
|
return cards.map(function(card) {
|
||||||
@@ -187,4 +187,4 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePath, GenerateList, PortalJobTemplateList, SearchInit, PaginateInit, PlaybookRun){
|
export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePath, GenerateList, PortalJobTemplateList, SearchInit, PaginateInit, PlaybookRun){
|
||||||
|
|
||||||
|
|
||||||
var jobs_scope,
|
var list = PortalJobTemplateList,
|
||||||
list = PortalJobTemplateList,
|
|
||||||
view= GenerateList,
|
view= GenerateList,
|
||||||
defaultUrl = GetBasePath('job_templates'),
|
defaultUrl = GetBasePath('job_templates'),
|
||||||
pageSize = 12;
|
pageSize = 12;
|
||||||
@@ -40,7 +39,7 @@ export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePat
|
|||||||
|
|
||||||
$scope.search(list.iterator);
|
$scope.search(list.iterator);
|
||||||
};
|
};
|
||||||
init()
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
PortalModeJobTemplatesController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun'
|
PortalModeJobTemplatesController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun'
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
|||||||
id: 'portal-jobs',
|
id: 'portal-jobs',
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
|
searchSize: 'col-md-10 col-xs-12'
|
||||||
});
|
});
|
||||||
|
|
||||||
SearchInit({
|
SearchInit({
|
||||||
@@ -56,4 +57,4 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
|||||||
}
|
}
|
||||||
|
|
||||||
PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
||||||
'PaginateInit']
|
'PaginateInit'];
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ export default [
|
|||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var base, e, id, url, parentObject;
|
var base, id, url, parentObject;
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||||
if (base == 'management_jobs') {
|
if (base === 'management_jobs') {
|
||||||
$scope.base = base = 'system_job_templates';
|
$scope.base = base = 'system_job_templates';
|
||||||
}
|
}
|
||||||
if ($stateParams.job_type){
|
if ($stateParams.job_type){
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$
|
|||||||
|
|
||||||
$scope.formCancel = function() {
|
$scope.formCancel = function() {
|
||||||
$state.go("^");
|
$state.go("^");
|
||||||
}
|
};
|
||||||
|
|
||||||
// extra_data field is not manifested in the UI when scheduling a Management Job
|
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||||
if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){
|
if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function ($rootScope, Rest, GetBasePath, ProcessErrors, $http, $q) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
featureEnabled: function(feature) {
|
featureEnabled: function(feature) {
|
||||||
if($rootScope.features && $rootScope.features[feature] && $rootScope.features[feature] == true) {
|
if($rootScope.features && $rootScope.features[feature] && $rootScope.features[feature] === true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default
|
|||||||
|
|
||||||
scope.userInteractionSelect = function() {
|
scope.userInteractionSelect = function() {
|
||||||
scope.$emit("selectedOrDeselected", scope.decoratedItem);
|
scope.$emit("selectedOrDeselected", scope.decoratedItem);
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default {
|
|||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}],
|
}],
|
||||||
inventorySyncSocket: ['Socket', '$rootScope', function(Socket, $rootScope) {
|
inventorySyncSocket: [function() {
|
||||||
// TODO: determine whether or not we have socket support for inventory sync standard out
|
// TODO: determine whether or not we have socket support for inventory sync standard out
|
||||||
return true;
|
return true;
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
|||||||
|
|
||||||
// Open up a socket for events depending on the type of job
|
// Open up a socket for events depending on the type of job
|
||||||
function openSockets() {
|
function openSockets() {
|
||||||
if ($state.current.name == 'jobDetail') {
|
if ($state.current.name === 'jobDetail') {
|
||||||
$log.debug("socket watching on job_events-" + job_id);
|
$log.debug("socket watching on job_events-" + job_id);
|
||||||
$rootScope.event_socket.on("job_events-" + job_id, function() {
|
$rootScope.event_socket.on("job_events-" + job_id, function() {
|
||||||
$log.debug("socket fired on job_events-" + job_id);
|
$log.debug("socket fired on job_events-" + job_id);
|
||||||
@@ -30,7 +30,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if ($state.current.name == 'adHocJobStdout') {
|
if ($state.current.name === 'adHocJobStdout') {
|
||||||
$log.debug("socket watching on ad_hoc_command_events-" + job_id);
|
$log.debug("socket watching on ad_hoc_command_events-" + job_id);
|
||||||
$rootScope.adhoc_event_socket.on("ad_hoc_command_events-" + job_id, function() {
|
$rootScope.adhoc_event_socket.on("ad_hoc_command_events-" + job_id, function() {
|
||||||
$log.debug("socket fired on ad_hoc_command_events-" + job_id);
|
$log.debug("socket fired on ad_hoc_command_events-" + job_id);
|
||||||
@@ -50,7 +50,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
|||||||
}
|
}
|
||||||
$scope.removeLoadStdout = $scope.$on('LoadStdout', function() {
|
$scope.removeLoadStdout = $scope.$on('LoadStdout', function() {
|
||||||
if (loaded_sections.length === 0) {
|
if (loaded_sections.length === 0) {
|
||||||
loadStdout()
|
loadStdout();
|
||||||
}
|
}
|
||||||
else if (live_event_processing) {
|
else if (live_event_processing) {
|
||||||
getNextSection();
|
getNextSection();
|
||||||
@@ -80,7 +80,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
|||||||
// This watcher fires off loadStdout() when the endpoint becomes
|
// This watcher fires off loadStdout() when the endpoint becomes
|
||||||
// available.
|
// available.
|
||||||
$scope.$watch('stdoutEndpoint', function(newVal, oldVal) {
|
$scope.$watch('stdoutEndpoint', function(newVal, oldVal) {
|
||||||
if(newVal && newVal != oldVal) {
|
if(newVal && newVal !== oldVal) {
|
||||||
// Fire off the server call
|
// Fire off the server call
|
||||||
loadStdout();
|
loadStdout();
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
|||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
|
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
function getNextSection() {
|
function getNextSection() {
|
||||||
// get the next range of data from the API
|
// get the next range of data from the API
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default {
|
|||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}],
|
}],
|
||||||
managementJobSocket: ['Socket', '$rootScope', function(Socket, $rootScope) {
|
managementJobSocket: [function() {
|
||||||
// TODO: determine whether or not we have socket support for management job standard out
|
// TODO: determine whether or not we have socket support for management job standard out
|
||||||
return true;
|
return true;
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default {
|
|||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}],
|
}],
|
||||||
scmUpdateSocket: ['Socket', '$rootScope', function(Socket, $rootScope) {
|
scmUpdateSocket: [function() {
|
||||||
// TODO: determine whether or not we have socket support for scm update standard out
|
// TODO: determine whether or not we have socket support for scm update standard out
|
||||||
return true;
|
return true;
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName, ParseTypeChange, ParseVariableString) {
|
export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -164,10 +164,10 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C
|
|||||||
// Click binding for the expand/collapse button on the standard out log
|
// Click binding for the expand/collapse button on the standard out log
|
||||||
$scope.toggleStdoutFullscreen = function() {
|
$scope.toggleStdoutFullscreen = function() {
|
||||||
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
||||||
}
|
};
|
||||||
|
|
||||||
getJobDetails();
|
getJobDetails();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName', 'ParseTypeChange', 'ParseVariableString'];
|
JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName'];
|
||||||
|
|||||||
@@ -263,26 +263,21 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'StreamList', 'SearchInit',
|
.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath',
|
||||||
'PaginateInit', 'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
'ProcessErrors', 'Wait', 'StreamList', 'SearchInit', 'PaginateInit',
|
||||||
'ShowDetail', 'setStreamHeight', 'Find', 'Store',
|
'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
||||||
function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors, Wait, StreamList, SearchInit, PaginateInit, GenerateList,
|
'ShowDetail', 'setStreamHeight',
|
||||||
FormatDate, BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight,
|
function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors,
|
||||||
Find, Store) {
|
Wait, StreamList, SearchInit, PaginateInit, GenerateList, FormatDate,
|
||||||
|
BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var list = StreamList,
|
var list = StreamList,
|
||||||
defaultUrl = GetBasePath('activity_stream'),
|
defaultUrl = GetBasePath('activity_stream'),
|
||||||
view = GenerateList,
|
view = GenerateList,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
|
||||||
parent_scope = params.scope,
|
parent_scope = params.scope,
|
||||||
scope = parent_scope.$new(),
|
scope = parent_scope.$new(),
|
||||||
search_iterator = params.search_iterator, // use to get correct current_search_params from local store
|
url = (params && params.url) ? params.url : null;
|
||||||
PreviousSearchParams = (search_iterator) ? Store(search_iterator + '_current_search_params') : Store('CurrentSearchParams'),
|
|
||||||
inventory_name = (params && params.inventory_name) ? params.inventory_name : null,
|
|
||||||
onClose = params.onClose, // optional callback to $emit after AS closes
|
|
||||||
url = (params && params.url) ? params.url : null,
|
|
||||||
type, paths, itm;
|
|
||||||
|
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user