mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
additional merge conflict fixes for JShint linting
This commit is contained in:
parent
83e79724d1
commit
cd6fff70a8
@ -50,15 +50,11 @@ import adhoc from './adhoc/main';
|
||||
import login from './login/main';
|
||||
import activityStream from './activity-stream/main';
|
||||
import standardOut from './standard-out/main';
|
||||
import lookUpHelper from './lookup/main';
|
||||
import JobTemplates from './job-templates/main';
|
||||
import search from './search/main';
|
||||
import {ScheduleEditController} from './controllers/Schedules';
|
||||
import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects';
|
||||
import OrganizationsList from './organizations/list/organizations-list.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 {UsersList, UsersAdd, UsersEdit} from './controllers/Users';
|
||||
import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams';
|
||||
@ -199,7 +195,7 @@ var tower = angular.module('Tower', [
|
||||
'pendolytics',
|
||||
'ui.router',
|
||||
'ncy-angular-breadcrumb',
|
||||
'scheduler',
|
||||
scheduler.name,
|
||||
'ApiModelHelper',
|
||||
'ActivityStreamHelper',
|
||||
'dndLists'
|
||||
@ -917,7 +913,7 @@ var tower = angular.module('Tower', [
|
||||
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
|
||||
if (fromState.name === 'signIn'){
|
||||
CheckLicense.notify();
|
||||
|
||||
@ -15,17 +15,14 @@ var hostEventModal = {
|
||||
features: ['FeaturesService', function(FeaturesService){
|
||||
return FeaturesService.get();
|
||||
}],
|
||||
event: ['JobDetailService','$stateParams', 'moment', function(JobDetailService, $stateParams, moment) {
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
id: $stateParams.eventId,
|
||||
}).then(function(res){
|
||||
res.data.results[0].created = moment(res.data.results[0].created).format('MMMM Do YYYY, h:mm:ss a');
|
||||
return res.data.results[0];
|
||||
});
|
||||
event: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) {
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
id: $stateParams.eventId
|
||||
}).success(function(res){ return res.results[0];});
|
||||
}]
|
||||
},
|
||||
onExit: function($state){
|
||||
// close the modal
|
||||
onExit: function(){
|
||||
// close the modal
|
||||
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||
$('#HostEvent').modal('hide');
|
||||
// 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')
|
||||
};
|
||||
|
||||
export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal}
|
||||
export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal};
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default
|
||||
export default
|
||||
['$stateParams', '$scope', '$rootScope', '$state', 'Wait',
|
||||
'JobDetailService', 'CreateSelect2', 'hosts',
|
||||
function($stateParams, $scope, $rootScope, $state, Wait,
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
$scope.search = function(){
|
||||
Wait('start');
|
||||
if ($scope.searchStr == undefined){
|
||||
return
|
||||
if ($scope.searchStr === undefined){
|
||||
return;
|
||||
}
|
||||
//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 ""
|
||||
@ -32,7 +32,7 @@
|
||||
page_size: $scope.pageSize})
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop')
|
||||
Wait('stop');
|
||||
});
|
||||
};
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
var filter = function(filter){
|
||||
Wait('start');
|
||||
|
||||
if (filter == 'all'){
|
||||
if (filter === 'all'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
page_size: $scope.pageSize})
|
||||
@ -51,25 +51,25 @@
|
||||
});
|
||||
}
|
||||
// handle runner cases
|
||||
if (filter == 'skipped'){
|
||||
if (filter === 'skipped'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
host_name: $stateParams.hostName,
|
||||
event: 'runner_on_skipped'})
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
});
|
||||
}
|
||||
if (filter == 'unreachable'){
|
||||
if (filter === 'unreachable'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
host_name: $stateParams.hostName,
|
||||
event: 'runner_on_unreachable'})
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
});
|
||||
}
|
||||
if (filter == 'ok'){
|
||||
if (filter === 'ok'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
or__field__event: 'runner_on_ok',
|
||||
@ -79,31 +79,31 @@
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
});
|
||||
});
|
||||
}
|
||||
// handle convience properties .changed .failed
|
||||
if (filter == 'changed'){
|
||||
if (filter === 'changed'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
host_name: $stateParams.hostName,
|
||||
changed: true})
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
});
|
||||
});
|
||||
}
|
||||
if (filter == 'failed'){
|
||||
if (filter === 'failed'){
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
host_name: $stateParams.hostName,
|
||||
failed: true})
|
||||
.success(function(res){
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// watch select2 for changes
|
||||
$('.HostEvents-select').on("select2:select", function (e) {
|
||||
$('.HostEvents-select').on("select2:select", function () {
|
||||
filter($('.HostEvents-select').val());
|
||||
});
|
||||
|
||||
@ -121,15 +121,15 @@
|
||||
$scope.results = res.results;
|
||||
Wait('stop');
|
||||
$('#HostEvents').modal('show');
|
||||
});;
|
||||
});
|
||||
}
|
||||
else{
|
||||
$scope.results = hosts.data.results;
|
||||
$('#HostEvents').modal('show');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
|
||||
}];
|
||||
}];
|
||||
|
||||
@ -29,7 +29,7 @@ export default {
|
||||
hosts: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) {
|
||||
return JobDetailService.getRelatedJobEvents($stateParams.id, {
|
||||
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', [])
|
||||
.controller('HostEventsController', controller)
|
||||
.run(['$stateExtender', function($stateExtender){
|
||||
$stateExtender.addState(route)
|
||||
}]);
|
||||
$stateExtender.addState(route);
|
||||
}]);
|
||||
|
||||
@ -42,7 +42,7 @@ export default
|
||||
scope.parseType = 'yaml';
|
||||
scope.previousTaskFailed = false;
|
||||
$scope.stdoutFullScreen = false;
|
||||
|
||||
|
||||
scope.$watch('job_status', function(job_status) {
|
||||
if (job_status && job_status.explanation && job_status.explanation.split(":")[0] === "Previous Task Failed") {
|
||||
scope.previousTaskFailed = true;
|
||||
@ -248,14 +248,14 @@ export default
|
||||
})
|
||||
.error(function(data, status) {
|
||||
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(scope.jobData);
|
||||
}
|
||||
else {
|
||||
api_complete = true; //trigger events to start processing
|
||||
UpdateDOM({ scope: scope})
|
||||
UpdateDOM({ scope: scope});
|
||||
}
|
||||
});
|
||||
|
||||
@ -274,10 +274,11 @@ export default
|
||||
var params = {
|
||||
parent: task.id,
|
||||
event__startswith: 'runner',
|
||||
page_size: scope.hostResultsMaxRows
|
||||
};
|
||||
JobDetailService.getRelatedJobEvents(scope.job.id, params)
|
||||
.success(function(data) {
|
||||
var event, status, status_text, item, msg;
|
||||
var event, status, item, msg;
|
||||
if (data.results.length > 0) {
|
||||
lastEventId = data.results[0].id;
|
||||
}
|
||||
@ -305,7 +306,7 @@ export default
|
||||
event_id: play.id,
|
||||
page_size: scope.tasksMaxRows,
|
||||
order: 'id'
|
||||
}
|
||||
};
|
||||
JobDetailService.getJobTasks(scope.job.id, params)
|
||||
.success(function(data) {
|
||||
scope.next_tasks = data.next;
|
||||
@ -395,7 +396,7 @@ export default
|
||||
})
|
||||
.error(function(data) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
msg: 'Call failed. GET returned: ' + status });
|
||||
});
|
||||
} else {
|
||||
scope.$emit('InitialLoadComplete');
|
||||
@ -413,7 +414,7 @@ export default
|
||||
var params = {
|
||||
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)
|
||||
.success( function(data) {
|
||||
scope.next_plays = data.next;
|
||||
@ -839,12 +840,12 @@ export default
|
||||
page_size: scope.hostResultsMaxRows,
|
||||
order: 'host_name,counter',
|
||||
host_name__icontains: scope.search_host_name
|
||||
}
|
||||
};
|
||||
if (scope.search_host_status === 'failed'){
|
||||
params.failed = true;
|
||||
}
|
||||
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
||||
scope.hostResults = JobDetailService.processHostEvents(res.results)
|
||||
scope.hostResults = JobDetailService.processHostEvents(res.results);
|
||||
scope.hostResultsLoading = false;
|
||||
});
|
||||
}
|
||||
@ -1093,7 +1094,7 @@ export default
|
||||
// Click binding for the expand/collapse button on the standard out log
|
||||
$scope.toggleStdoutFullscreen = function() {
|
||||
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
||||
}
|
||||
};
|
||||
|
||||
scope.editSchedule = function() {
|
||||
// We need to get the schedule's ID out of the related links
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
export default
|
||||
['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', function($rootScope, Rest, GetBasePath, ProcessErrors){
|
||||
return {
|
||||
|
||||
stringifyParams: function(params){
|
||||
return _.reduce(params, (result, value, key) => {
|
||||
return result + key + '=' + value + '&'}, '');
|
||||
@ -14,15 +13,15 @@ export default
|
||||
var result = $.extend(true, {}, data);
|
||||
// configure fields to ignore
|
||||
var ignored = [
|
||||
'event_data',
|
||||
'related',
|
||||
'summary_fields',
|
||||
'url',
|
||||
'event_data',
|
||||
'related',
|
||||
'summary_fields',
|
||||
'url',
|
||||
'ansible_facts',
|
||||
];
|
||||
|
||||
// remove ignored properties
|
||||
Object.keys(result).forEach(function(key, index){
|
||||
Object.keys(result).forEach(function(key){
|
||||
if (ignored.indexOf(key) > -1) {
|
||||
delete result[key];
|
||||
}
|
||||
@ -31,7 +30,7 @@ export default
|
||||
// flatten Ansible's passed-through response
|
||||
try{
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6,9 +6,9 @@
|
||||
|
||||
export default
|
||||
[ 'Wait', '$state', '$scope', 'jobTemplateCopyService',
|
||||
'ProcessErrors', 'GetBasePath',
|
||||
'ProcessErrors', '$rootScope',
|
||||
function(Wait, $state, $scope, jobTemplateCopyService,
|
||||
ProcessErrors, GetBasePath){
|
||||
ProcessErrors, $rootScope){
|
||||
// GETs the job_template to copy
|
||||
// POSTs a new job_template
|
||||
// routes to JobTemplates.edit when finished
|
||||
@ -24,9 +24,9 @@
|
||||
})
|
||||
.error(function(res, status){
|
||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
||||
msg: 'Call failed. Return status: '+ status});
|
||||
});
|
||||
};
|
||||
init();
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
@ -4,10 +4,9 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import {templateUrl} from '../../shared/template-url/template-url.factory';
|
||||
|
||||
export default {
|
||||
name: 'jobTemplates.copy',
|
||||
route: '/:id/copy',
|
||||
controller: 'jobTemplateCopyController'
|
||||
}
|
||||
};
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
Rest.setUrl(defaultUrl);
|
||||
return Rest.get()
|
||||
.success(function(res){
|
||||
return res
|
||||
return res;
|
||||
})
|
||||
.error(function(res, status){
|
||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||
@ -23,21 +23,21 @@
|
||||
set: function(data){
|
||||
var defaultUrl = GetBasePath('job_templates');
|
||||
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
|
||||
return Rest.post(data.results[0])
|
||||
.success(function(res){
|
||||
return res
|
||||
return res;
|
||||
})
|
||||
.error(function(res, status){
|
||||
.error(function(res, status){
|
||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
||||
});
|
||||
},
|
||||
buildName: function(name){
|
||||
var result = name.split('@')[0];
|
||||
return result
|
||||
return result;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
];
|
||||
|
||||
@ -13,5 +13,5 @@ export default
|
||||
.service('jobTemplateCopyService', service)
|
||||
.controller('jobTemplateCopyController', controller)
|
||||
.run(['$stateExtender', function($stateExtender) {
|
||||
$stateExtender.addState(route)
|
||||
$stateExtender.addState(route);
|
||||
}]);
|
||||
|
||||
@ -14,5 +14,5 @@ export default ['Rest', 'GetBasePath', function(Rest, GetBasePath){
|
||||
Rest.setUrl(url);
|
||||
return Rest.destroy();
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
}];
|
||||
|
||||
@ -4,7 +4,6 @@ export default
|
||||
|
||||
var scope = params.scope,
|
||||
index = params.index,
|
||||
element,
|
||||
tmpVar,
|
||||
i,
|
||||
question = params.question,
|
||||
@ -12,7 +11,7 @@ export default
|
||||
|
||||
// Update the index so that we know which question is being edited.
|
||||
scope.editQuestionIndex = index;
|
||||
|
||||
|
||||
scope.text_min = null;
|
||||
scope.text_max = null;
|
||||
scope.int_min = null;
|
||||
|
||||
@ -31,7 +31,9 @@ function link($sce, $filter, Empty, scope, element, attrs) {
|
||||
|
||||
function sanitizeDefault() {
|
||||
|
||||
var defaultValue = "";
|
||||
var defaultValue = "",
|
||||
min,
|
||||
max;
|
||||
|
||||
if(scope.question.type === 'text'|| scope.question.type === "password" ){
|
||||
defaultValue = (scope.question.default) ? scope.question.default : "";
|
||||
@ -61,14 +63,14 @@ function link($sce, $filter, Empty, scope, element, attrs) {
|
||||
}
|
||||
|
||||
if(scope.question.type === 'integer'){
|
||||
var min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||
var max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
||||
min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||
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 : "" ;
|
||||
|
||||
}
|
||||
if(scope.question.type === "float"){
|
||||
var min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||
var max = (!Empty(scope.question.max)) ? scope.question.max : "" ;
|
||||
min = (!Empty(scope.question.min)) ? scope.question.min : "";
|
||||
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 : "" ;
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ export default
|
||||
return function(params) {
|
||||
var scope = params.scope,
|
||||
id = params.id,
|
||||
url = GetBasePath('job_templates') + id + '/survey_spec/', i;
|
||||
url = GetBasePath('job_templates') + id + '/survey_spec/';
|
||||
|
||||
if (scope.removeDialogReady) {
|
||||
scope.removeDialogReady();
|
||||
|
||||
@ -4,8 +4,6 @@ export default
|
||||
return function(params) {
|
||||
var scope = params.scope,
|
||||
id = params.id,
|
||||
i, url, html, element,
|
||||
questions = [],
|
||||
form = SurveyQuestionForm,
|
||||
sce = params.sce;
|
||||
scope.sce = sce;
|
||||
@ -73,7 +71,7 @@ export default
|
||||
scope.survey_questions = [];
|
||||
}
|
||||
$('#' + id).dialog('destroy');
|
||||
}
|
||||
};
|
||||
|
||||
// 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
|
||||
@ -83,8 +81,8 @@ export default
|
||||
Wait('start');
|
||||
if(scope.mode ==="add"){
|
||||
// Loop across the survey questions and remove any new_question flags
|
||||
angular.forEach(scope.survey_questions, function(question, key) {
|
||||
delete question['new_question'];
|
||||
angular.forEach(scope.survey_questions, function(question) {
|
||||
delete question.new_question;
|
||||
});
|
||||
|
||||
$('#survey-modal-dialog').dialog('destroy');
|
||||
@ -100,28 +98,28 @@ export default
|
||||
var updateSurveyQuestions = function() {
|
||||
Rest.setUrl(GetBasePath('job_templates') + id + '/survey_spec/');
|
||||
return Rest.post({name: scope.survey_name, description: scope.survey_description, spec: scope.survey_questions })
|
||||
.success(function (data) {
|
||||
.success(function () {
|
||||
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Failed to add new survey. POST returned status: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var updateSurveyEnabled = function() {
|
||||
Rest.setUrl(GetBasePath('job_templates') + id+ '/');
|
||||
return Rest.patch({"survey_enabled": scope.survey_enabled})
|
||||
.success(function (data) {
|
||||
.success(function () {
|
||||
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors(scope, data, status, form, {
|
||||
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()
|
||||
.then(function() {
|
||||
@ -130,7 +128,7 @@ export default
|
||||
.then(function() {
|
||||
scope.closeSurvey('survey-modal-dialog');
|
||||
scope.$emit('SurveySaved');
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
@ -173,7 +171,7 @@ export default
|
||||
scope.questionToBeDeleted = deleteIndex;
|
||||
// Show the delete overlay with mode='question'
|
||||
scope.showDeleteOverlay('question');
|
||||
}
|
||||
};
|
||||
|
||||
// Called after a user confirms question deletion (hitting the DELETE button on the delete question overlay).
|
||||
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
|
||||
// currently being edited gets updated independently from a deleted question.
|
||||
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
|
||||
scope.editQuestionIndex = null;
|
||||
scope.generateAddQuestionForm();
|
||||
@ -238,7 +236,7 @@ export default
|
||||
|
||||
// Set the whole form to pristine
|
||||
scope.survey_question_form.$setPristine();
|
||||
}
|
||||
};
|
||||
|
||||
// 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.
|
||||
@ -258,12 +256,11 @@ export default
|
||||
// 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
|
||||
// scope.survey_questions array.
|
||||
scope.submitQuestion = function(event){
|
||||
scope.submitQuestion = function(){
|
||||
var data = {},
|
||||
fld, i,
|
||||
choiceArray,
|
||||
answerArray,
|
||||
key, elementID;
|
||||
answerArray;
|
||||
scope.invalidChoice = false;
|
||||
scope.duplicate = false;
|
||||
scope.minTextError = false;
|
||||
@ -333,7 +330,7 @@ export default
|
||||
if(GenerateForm.mode === 'edit'){
|
||||
// Loop across the survey questions and see if a different question already has
|
||||
// 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){
|
||||
scope.duplicate = true;
|
||||
}
|
||||
@ -475,11 +472,11 @@ export default
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
// return true here signals that the drop is allowed, but that we've already taken care of inserting the element
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// 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.
|
||||
@ -508,7 +505,7 @@ export default
|
||||
scope.deleteMode = mode;
|
||||
// Flip the deleteOverlayVisible flag so that the overlay becomes visible via ng-show
|
||||
scope.deleteOverlayVisible = true;
|
||||
}
|
||||
};
|
||||
|
||||
// Called by the cancel/close buttons on the delete overlay. Also called after deletion has been confirmed.
|
||||
scope.hideDeleteOverlay = function() {
|
||||
@ -518,14 +515,14 @@ export default
|
||||
scope.questionToBeDeleted = null;
|
||||
// Hide the delete overlay
|
||||
scope.deleteOverlayVisible = false;
|
||||
}
|
||||
};
|
||||
|
||||
/* END DELETE OVERLAY RELATED FUNCTIONS */
|
||||
|
||||
// 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";
|
||||
})
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ export default
|
||||
Rest.setUrl(defaultUrl);
|
||||
return Rest.get()
|
||||
.success(function(res){
|
||||
return res
|
||||
return res;
|
||||
})
|
||||
.error(function(res, status){
|
||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||
@ -26,7 +26,7 @@ export default
|
||||
data.eula_accepted = eula;
|
||||
return Rest.post(JSON.stringify(data))
|
||||
.success(function(res){
|
||||
return res
|
||||
return res;
|
||||
})
|
||||
.error(function(res, status){
|
||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
||||
@ -38,25 +38,27 @@ export default
|
||||
// Returns false if invalid
|
||||
valid: function(license) {
|
||||
if (!license.valid_key){
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
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){
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
return true;
|
||||
},
|
||||
notify: function(){
|
||||
self = this;
|
||||
var self = this;
|
||||
this.get()
|
||||
.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);
|
||||
el.bind('change', onChange);
|
||||
}
|
||||
}
|
||||
}];
|
||||
};
|
||||
}];
|
||||
|
||||
@ -22,7 +22,7 @@ export default
|
||||
catch(err) {
|
||||
ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'});
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
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
|
||||
$scope.fakeClick = function(){
|
||||
$('#License-file').click();
|
||||
}
|
||||
};
|
||||
$scope.newLicense = {};
|
||||
$scope.submit = function(event){
|
||||
$scope.submit = function(){
|
||||
Wait('start');
|
||||
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
|
||||
.success(function(res){
|
||||
.success(function(){
|
||||
reset();
|
||||
init();
|
||||
$scope.success = true;
|
||||
@ -53,15 +53,15 @@ export default
|
||||
var calcDaysRemaining = function(ms){
|
||||
// calculate the number of days remaining on the license
|
||||
var duration = moment.duration(ms);
|
||||
return duration.days()
|
||||
return duration.days();
|
||||
};
|
||||
|
||||
var calcExpiresOn = function(days){
|
||||
// calculate the expiration date of the license
|
||||
return moment().add(days, 'days').calendar()
|
||||
return moment().add(days, 'days').calendar();
|
||||
};
|
||||
var init = function(){
|
||||
$scope.fileName = "Please choose a file..."
|
||||
$scope.fileName = "Please choose a file...";
|
||||
Wait('start');
|
||||
CheckLicense.get()
|
||||
.then(function(res){
|
||||
@ -70,13 +70,13 @@ export default
|
||||
$scope.time = {};
|
||||
$scope.time.remaining = calcDaysRemaining($scope.license.license_info.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');
|
||||
});
|
||||
};
|
||||
var reset = function(){
|
||||
document.getElementById('License-form').reset()
|
||||
document.getElementById('License-form').reset();
|
||||
};
|
||||
init();
|
||||
init();
|
||||
}
|
||||
];
|
||||
];
|
||||
|
||||
@ -16,4 +16,4 @@ export default {
|
||||
parent: 'setup',
|
||||
label: 'LICENSE'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -10,4 +10,4 @@ import thirdPartySignOnService from './thirdPartySignOn.service';
|
||||
export default
|
||||
angular.module('thirdPartySignOn', [])
|
||||
.directive('thirdPartySignOn', thirdPartySignOnDirective)
|
||||
.factory('thirdPartySignOnService', thirdPartySignOnService)
|
||||
.factory('thirdPartySignOnService', thirdPartySignOnService);
|
||||
|
||||
@ -26,7 +26,7 @@ export default ['$window', '$scope', 'thirdPartySignOnService',
|
||||
if (data && data.error) {
|
||||
$scope.$parent.thirdPartyAttemptFailed = data.error;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$scope.goTo = function(link) {
|
||||
// this is used because $location only lets you navigate inside
|
||||
|
||||
@ -8,7 +8,7 @@ export default
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
scope.isCurrentState = function(name){
|
||||
return $state.current.name == name
|
||||
return $state.current.name === name;
|
||||
};
|
||||
|
||||
// set up the user tooltip
|
||||
|
||||
@ -34,8 +34,7 @@ export default
|
||||
};
|
||||
getManagementJobs();
|
||||
var scope = $rootScope.$new(),
|
||||
parent_scope = scope,
|
||||
list = managementJobsListObject;
|
||||
parent_scope = scope;
|
||||
scope.cleanupJob = true;
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
*************************************************/
|
||||
|
||||
import route from './organizations-add.route';
|
||||
import controller from './organizations-add.controller';
|
||||
|
||||
export default
|
||||
angular.module('organizationsAdd', [])
|
||||
|
||||
@ -63,4 +63,4 @@ export default ['$scope', '$rootScope', '$compile', '$location',
|
||||
$state.transitionTo('organizations');
|
||||
};
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
*************************************************/
|
||||
|
||||
import route from './organizations-list.route';
|
||||
import controller from './organizations-list.controller';
|
||||
|
||||
export default
|
||||
angular.module('organizationsList', [])
|
||||
|
||||
@ -44,7 +44,7 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
||||
|
||||
var paginationContainer = $('#pagination-container');
|
||||
paginationContainer.html($scope.PaginateWidget);
|
||||
$compile(paginationContainer.contents())($scope)
|
||||
$compile(paginationContainer.contents())($scope);
|
||||
|
||||
var parseCardData = function(cards) {
|
||||
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){
|
||||
|
||||
|
||||
var jobs_scope,
|
||||
list = PortalJobTemplateList,
|
||||
var list = PortalJobTemplateList,
|
||||
view= GenerateList,
|
||||
defaultUrl = GetBasePath('job_templates'),
|
||||
pageSize = 12;
|
||||
@ -40,7 +39,7 @@ export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePat
|
||||
|
||||
$scope.search(list.iterator);
|
||||
};
|
||||
init()
|
||||
init();
|
||||
}
|
||||
|
||||
PortalModeJobTemplatesController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun'
|
||||
|
||||
@ -21,6 +21,7 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
||||
id: 'portal-jobs',
|
||||
mode: 'edit',
|
||||
scope: $scope,
|
||||
searchSize: 'col-md-10 col-xs-12'
|
||||
});
|
||||
|
||||
SearchInit({
|
||||
@ -56,4 +57,4 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
||||
}
|
||||
|
||||
PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
||||
'PaginateInit']
|
||||
'PaginateInit'];
|
||||
|
||||
@ -20,9 +20,9 @@ export default [
|
||||
|
||||
ClearScope();
|
||||
|
||||
var base, e, id, url, parentObject;
|
||||
var base, id, url, parentObject;
|
||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||
if (base == 'management_jobs') {
|
||||
if (base === 'management_jobs') {
|
||||
$scope.base = base = 'system_job_templates';
|
||||
}
|
||||
if ($stateParams.job_type){
|
||||
|
||||
@ -46,7 +46,7 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$
|
||||
|
||||
$scope.formCancel = function() {
|
||||
$state.go("^");
|
||||
}
|
||||
};
|
||||
|
||||
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||
if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){
|
||||
|
||||
@ -33,7 +33,7 @@ function ($rootScope, Rest, GetBasePath, ProcessErrors, $http, $q) {
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -54,7 +54,7 @@ export default
|
||||
|
||||
scope.userInteractionSelect = function() {
|
||||
scope.$emit("selectedOrDeselected", scope.decoratedItem);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ export default {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
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
|
||||
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
|
||||
function openSockets() {
|
||||
if ($state.current.name == 'jobDetail') {
|
||||
if ($state.current.name === 'jobDetail') {
|
||||
$log.debug("socket watching on job_events-" + job_id);
|
||||
$rootScope.event_socket.on("job_events-" + job_id, function() {
|
||||
$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);
|
||||
$rootScope.adhoc_event_socket.on("ad_hoc_command_events-" + job_id, function() {
|
||||
$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() {
|
||||
if (loaded_sections.length === 0) {
|
||||
loadStdout()
|
||||
loadStdout();
|
||||
}
|
||||
else if (live_event_processing) {
|
||||
getNextSection();
|
||||
@ -80,7 +80,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
||||
// This watcher fires off loadStdout() when the endpoint becomes
|
||||
// available.
|
||||
$scope.$watch('stdoutEndpoint', function(newVal, oldVal) {
|
||||
if(newVal && newVal != oldVal) {
|
||||
if(newVal && newVal !== oldVal) {
|
||||
// Fire off the server call
|
||||
loadStdout();
|
||||
}
|
||||
@ -112,7 +112,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
|
||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function getNextSection() {
|
||||
// get the next range of data from the API
|
||||
|
||||
@ -22,7 +22,7 @@ export default {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
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
|
||||
return true;
|
||||
}]
|
||||
|
||||
@ -24,7 +24,7 @@ export default {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
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
|
||||
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();
|
||||
|
||||
@ -164,10 +164,10 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C
|
||||
// Click binding for the expand/collapse button on the standard out log
|
||||
$scope.toggleStdoutFullscreen = function() {
|
||||
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;
|
||||
}
|
||||
};
|
||||
|
||||
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',
|
||||
'PaginateInit', 'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
||||
'ShowDetail', 'setStreamHeight', 'Find', 'Store',
|
||||
function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors, Wait, StreamList, SearchInit, PaginateInit, GenerateList,
|
||||
FormatDate, BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight,
|
||||
Find, Store) {
|
||||
.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath',
|
||||
'ProcessErrors', 'Wait', 'StreamList', 'SearchInit', 'PaginateInit',
|
||||
'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
||||
'ShowDetail', 'setStreamHeight',
|
||||
function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors,
|
||||
Wait, StreamList, SearchInit, PaginateInit, GenerateList, FormatDate,
|
||||
BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight) {
|
||||
return function (params) {
|
||||
|
||||
var list = StreamList,
|
||||
defaultUrl = GetBasePath('activity_stream'),
|
||||
view = GenerateList,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
parent_scope = params.scope,
|
||||
scope = parent_scope.$new(),
|
||||
search_iterator = params.search_iterator, // use to get correct current_search_params from local store
|
||||
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;
|
||||
url = (params && params.url) ? params.url : null;
|
||||
|
||||
$rootScope.flashMessage = null;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user