mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 20:37:39 -02:30
Fixed jshint errors and fixed bug where edge types were not being properly limited based on sibling edge types
This commit is contained in:
@@ -33,7 +33,6 @@ if ($basePath) {
|
|||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import './helpers';
|
import './helpers';
|
||||||
import * as forms from './forms';
|
|
||||||
import './lists';
|
import './lists';
|
||||||
import './widgets';
|
import './widgets';
|
||||||
import './filters';
|
import './filters';
|
||||||
@@ -219,9 +218,8 @@ var tower = angular.module('Tower', [
|
|||||||
.config(['$urlRouterProvider', '$breadcrumbProvider', 'QuerySetProvider',
|
.config(['$urlRouterProvider', '$breadcrumbProvider', 'QuerySetProvider',
|
||||||
'$urlMatcherFactoryProvider', 'stateDefinitionsProvider', '$stateProvider', '$stateExtenderProvider',
|
'$urlMatcherFactoryProvider', 'stateDefinitionsProvider', '$stateProvider', '$stateExtenderProvider',
|
||||||
function($urlRouterProvider, $breadcrumbProvider, QuerySet,
|
function($urlRouterProvider, $breadcrumbProvider, QuerySet,
|
||||||
$urlMatcherFactoryProvider, stateDefinitionsProvider, $stateProvider, $stateExtenderProvider) {
|
$urlMatcherFactoryProvider, stateDefinitionsProvider, $stateProvider) {
|
||||||
let $stateExtender = $stateExtenderProvider.$get(),
|
let stateDefinitions = stateDefinitionsProvider.$get();
|
||||||
stateDefinitions = stateDefinitionsProvider.$get();
|
|
||||||
$urlMatcherFactoryProvider.strictMode(false);
|
$urlMatcherFactoryProvider.strictMode(false);
|
||||||
$breadcrumbProvider.setOptions({
|
$breadcrumbProvider.setOptions({
|
||||||
templateUrl: urlPrefix + 'partials/breadcrumb.html'
|
templateUrl: urlPrefix + 'partials/breadcrumb.html'
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ UsersList.$inject = ['$scope', '$rootScope', '$stateParams',
|
|||||||
|
|
||||||
export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
|
export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope,
|
||||||
GetBasePath, ResetForm, Wait, CreateSelect2, $state, i18n) {
|
GetBasePath, ResetForm, Wait, CreateSelect2, $state, $location) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
|
|||||||
|
|
||||||
UsersAdd.$inject = ['$scope', '$rootScope', '$stateParams', 'UserForm', 'GenerateForm',
|
UsersAdd.$inject = ['$scope', '$rootScope', '$stateParams', 'UserForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath',
|
'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath',
|
||||||
'ResetForm', 'Wait', 'CreateSelect2', '$state', 'i18n'
|
'ResetForm', 'Wait', 'CreateSelect2', '$state', '$location'
|
||||||
];
|
];
|
||||||
|
|
||||||
export function UsersEdit($scope, $rootScope, $location,
|
export function UsersEdit($scope, $rootScope, $location,
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ angular.module('InventoryFormDefinition', ['ScanJobsListDefinition'])
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
relatedSets: function(urls) {
|
relatedSets: function() {
|
||||||
return {
|
return {
|
||||||
permissions: {
|
permissions: {
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
|
|||||||
@@ -31,15 +31,18 @@ export default
|
|||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: 'On Success',
|
label: 'On Success',
|
||||||
value: 'success'
|
value: 'success',
|
||||||
|
ngShow: '!edgeTypeRestriction || edgeTypeRestriction === "successFailure"'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'On Failure',
|
label: 'On Failure',
|
||||||
value: 'failure'
|
value: 'failure',
|
||||||
|
ngShow: '!edgeTypeRestriction || edgeTypeRestriction === "successFailure"'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Always',
|
label: 'Always',
|
||||||
value: 'always'
|
value: 'always',
|
||||||
|
ngShow: '!edgeTypeRestriction || edgeTypeRestriction === "always"'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
|
|||||||
@@ -1039,7 +1039,6 @@ export default
|
|||||||
//plays = JSON.parse(JSON.stringify(scope.jobData.plays)),
|
//plays = JSON.parse(JSON.stringify(scope.jobData.plays)),
|
||||||
plays = scope.jobData.plays,
|
plays = scope.jobData.plays,
|
||||||
filteredListX = [],
|
filteredListX = [],
|
||||||
filteredListA = [],
|
|
||||||
filteredListB = [],
|
filteredListB = [],
|
||||||
key,
|
key,
|
||||||
keys;
|
keys;
|
||||||
@@ -1113,7 +1112,6 @@ export default
|
|||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
result = [],
|
result = [],
|
||||||
filteredListX = [],
|
filteredListX = [],
|
||||||
filteredListA = [],
|
|
||||||
filteredListB = [],
|
filteredListB = [],
|
||||||
idx, key, keys, newKeys, tasks, t;
|
idx, key, keys, newKeys, tasks, t;
|
||||||
|
|
||||||
@@ -1196,11 +1194,9 @@ export default
|
|||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
result = [],
|
result = [],
|
||||||
filteredListA = [],
|
|
||||||
filteredListB = [],
|
filteredListB = [],
|
||||||
idx = 0,
|
idx = 0,
|
||||||
hostResults,
|
hostResults,
|
||||||
key,
|
|
||||||
keys;
|
keys;
|
||||||
|
|
||||||
if (scope.activePlay && scope.activeTask && scope.jobData.plays[scope.activePlay] &&
|
if (scope.activePlay && scope.activeTask && scope.jobData.plays[scope.activePlay] &&
|
||||||
@@ -1232,7 +1228,7 @@ export default
|
|||||||
// else {
|
// else {
|
||||||
// filteredListB = filteredListA;
|
// filteredListB = filteredListA;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
keys = Object.keys(filteredListB);
|
keys = Object.keys(filteredListB);
|
||||||
keys.sort(function compare(a, b) {
|
keys.sort(function compare(a, b) {
|
||||||
if (filteredListB[a].name === filteredListB[b].name) {
|
if (filteredListB[a].name === filteredListB[b].name) {
|
||||||
|
|||||||
@@ -381,7 +381,6 @@ export default
|
|||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
id = params.id,
|
id = params.id,
|
||||||
callback = params.callback,
|
|
||||||
url = GetBasePath('schedules') + id +'/';
|
url = GetBasePath('schedules') + id +'/';
|
||||||
|
|
||||||
// Perform the update
|
// Perform the update
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ export default
|
|||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
set = params.set,
|
set = params.set;
|
||||||
iterator = params.iterator;
|
|
||||||
|
|
||||||
// Listeners to perform lookups after main inventory list loads
|
// Listeners to perform lookups after main inventory list loads
|
||||||
|
|
||||||
@@ -86,8 +85,7 @@ export default
|
|||||||
scope.lookUpOrganization = function () {
|
scope.lookUpOrganization = function () {
|
||||||
var list = OrganizationList,
|
var list = OrganizationList,
|
||||||
listGenerator = GenerateList,
|
listGenerator = GenerateList,
|
||||||
listScope = listGenerator.inject(list, { mode: 'lookup', hdr: 'Select Organization' }),
|
listScope = listGenerator.inject(list, { mode: 'lookup', hdr: 'Select Organization' });
|
||||||
defaultUrl = '/api/v1/organizations/';
|
|
||||||
|
|
||||||
listScope.selectAction = function () {
|
listScope.selectAction = function () {
|
||||||
var i, found = false;
|
var i, found = false;
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ export function format(f) {
|
|||||||
var args = arguments;
|
var args = arguments;
|
||||||
var len = args.length;
|
var len = args.length;
|
||||||
var str = String(f).replace(formatRegExp, function(x) {
|
var str = String(f).replace(formatRegExp, function(x) {
|
||||||
if (x === '%%') return '%';
|
if (x === '%%') {return '%';}
|
||||||
if (i >= len) return x;
|
if (i >= len) {return x;}
|
||||||
switch (x) {
|
switch (x) {
|
||||||
case '%s': return String(args[i++]);
|
case '%s': return String(args[i++]);
|
||||||
case '%d': return Number(args[i++]);
|
case '%d': return Number(args[i++]);
|
||||||
@@ -57,6 +57,7 @@ export function format(f) {
|
|||||||
} catch (_) {
|
} catch (_) {
|
||||||
return '[Circular]';
|
return '[Circular]';
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
@@ -78,12 +79,12 @@ export default
|
|||||||
return function() {
|
return function() {
|
||||||
var langInfo = $window.navigator.language ||
|
var langInfo = $window.navigator.language ||
|
||||||
$window.navigator.userLanguage;
|
$window.navigator.userLanguage;
|
||||||
var langUrl = langInfo.replace('-', '_');
|
//var langUrl = langInfo.replace('-', '_');
|
||||||
//gettextCatalog.debug = true;
|
//gettextCatalog.debug = true;
|
||||||
gettextCatalog.setCurrentLanguage(langInfo);
|
gettextCatalog.setCurrentLanguage(langInfo);
|
||||||
// TODO: the line below is commented out temporarily until
|
// TODO: the line below is commented out temporarily until
|
||||||
// the .po files are received from the i18n team, in order to avoid
|
// the .po files are received from the i18n team, in order to avoid
|
||||||
// 404 file not found console errors in dev
|
// 404 file not found console errors in dev
|
||||||
// gettextCatalog.loadRemote('/static/languages/' + langUrl + '.json');
|
// gettextCatalog.loadRemote('/static/languages/' + langUrl + '.json');
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ export default ['$state', '$stateParams', '$scope', 'GroupForm', 'CredentialList
|
|||||||
'GroupManageService', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'rbacUiControlService', 'ToJSON',
|
'GroupManageService', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'rbacUiControlService', 'ToJSON',
|
||||||
function($state, $stateParams, $scope, GroupForm, CredentialList, ParseTypeChange, GenerateForm, inventoryData,
|
function($state, $stateParams, $scope, GroupForm, CredentialList, ParseTypeChange, GenerateForm, inventoryData,
|
||||||
GroupManageService, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, rbacUiControlService, ToJSON) {
|
GroupManageService, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, rbacUiControlService, ToJSON) {
|
||||||
var generator = GenerateForm,
|
|
||||||
form = GroupForm();
|
let form = GroupForm();
|
||||||
init();
|
init();
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
export default
|
export default
|
||||||
['$scope', '$rootScope', '$state', '$stateParams', 'InventoryGroups', 'generateList', 'InventoryUpdate',
|
['$scope', '$rootScope', '$state', '$stateParams', 'InventoryGroups', 'generateList', 'InventoryUpdate',
|
||||||
'GroupManageService', 'GroupsCancelUpdate', 'ViewUpdateStatus', 'rbacUiControlService', 'GetBasePath',
|
'GroupManageService', 'GroupsCancelUpdate', 'ViewUpdateStatus', 'rbacUiControlService', 'GetBasePath',
|
||||||
'InventoryManageService', 'groupsUrl', 'GetSyncStatusMsg', 'GetHostsStatusMsg', 'groupsDataset',
|
'InventoryManageService', 'groupsUrl', 'GetSyncStatusMsg', 'GetHostsStatusMsg', 'groupsDataset', 'Find',
|
||||||
function($scope, $rootScope, $state, $stateParams, InventoryGroups, generateList, InventoryUpdate,
|
function($scope, $rootScope, $state, $stateParams, InventoryGroups, generateList, InventoryUpdate,
|
||||||
GroupManageService, GroupsCancelUpdate, ViewUpdateStatus, rbacUiControlService, GetBasePath,
|
GroupManageService, GroupsCancelUpdate, ViewUpdateStatus, rbacUiControlService, GetBasePath,
|
||||||
InventoryManageService, groupsUrl, GetSyncStatusMsg, GetHostsStatusMsg, groupsDataset){
|
InventoryManageService, groupsUrl, GetSyncStatusMsg, GetHostsStatusMsg, groupsDataset, Find){
|
||||||
|
|
||||||
let list = InventoryGroups;
|
let list = InventoryGroups;
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ export default
|
|||||||
Rest.setUrl(GetBasePath('projects') + $scope.project + '/');
|
Rest.setUrl(GetBasePath('projects') + $scope.project + '/');
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
console.log(data)
|
|
||||||
var msg;
|
var msg;
|
||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
case 'failed':
|
case 'failed':
|
||||||
@@ -252,7 +251,7 @@ export default
|
|||||||
if ($scope.cloudCredentialReadyRemove) {
|
if ($scope.cloudCredentialReadyRemove) {
|
||||||
$scope.cloudCredentialReadyRemove();
|
$scope.cloudCredentialReadyRemove();
|
||||||
}
|
}
|
||||||
$scope.cloudCredentialReadyRemove = $scope.$on('cloudCredentialReady', function (e, name) {
|
$scope.cloudCredentialReadyRemove = $scope.$on('cloudCredentialReady', function () {
|
||||||
$scope.$emit('jobTemplateLoadFinished');
|
$scope.$emit('jobTemplateLoadFinished');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -261,7 +260,7 @@ export default
|
|||||||
if ($scope.jobTemplateLoadedRemove) {
|
if ($scope.jobTemplateLoadedRemove) {
|
||||||
$scope.jobTemplateLoadedRemove();
|
$scope.jobTemplateLoadedRemove();
|
||||||
}
|
}
|
||||||
$scope.jobTemplateLoadedRemove = $scope.$on('jobTemplateLoaded', function (e, related_cloud_credential, masterObject, relatedSets) {
|
$scope.jobTemplateLoadedRemove = $scope.$on('jobTemplateLoaded', function (e, related_cloud_credential, masterObject) {
|
||||||
var dft;
|
var dft;
|
||||||
|
|
||||||
master = masterObject;
|
master = masterObject;
|
||||||
|
|||||||
@@ -297,6 +297,10 @@ angular.module('jobTemplates', [surveyMaker.name, jobTemplatesList.name, jobTemp
|
|||||||
$scope[key] = value;
|
$scope[key] = value;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on('setEdgeType', function(e, edgeType) {
|
||||||
|
$scope.edgeType = edgeType;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ export default ['$scope', 'WorkflowHelpService', 'generateList', 'JobTemplateLis
|
|||||||
formIsValid: false
|
formIsValid: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set the intial edge type to success
|
|
||||||
$scope.edgeType = "success";
|
|
||||||
|
|
||||||
$scope.job_type_options = [{
|
$scope.job_type_options = [{
|
||||||
label: "Run",
|
label: "Run",
|
||||||
value: "run"
|
value: "run"
|
||||||
@@ -35,14 +32,6 @@ export default ['$scope', 'WorkflowHelpService', 'generateList', 'JobTemplateLis
|
|||||||
function init() {
|
function init() {
|
||||||
$scope.treeDataMaster = angular.copy($scope.treeData.data);
|
$scope.treeDataMaster = angular.copy($scope.treeData.data);
|
||||||
$scope.$broadcast("refreshWorkflowChart");
|
$scope.$broadcast("refreshWorkflowChart");
|
||||||
|
|
||||||
$scope.$watchGroup(['selectedTemplate', 'edgeType'], function() {
|
|
||||||
if ($scope.selectedTemplate && $scope.edgeType) {
|
|
||||||
$scope.workflowMakerFormConfig.formIsValid = true;
|
|
||||||
} else {
|
|
||||||
$scope.workflowMakerFormConfig.formIsValid = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetNodeForm() {
|
function resetNodeForm() {
|
||||||
@@ -55,7 +44,6 @@ export default ['$scope', 'WorkflowHelpService', 'generateList', 'JobTemplateLis
|
|||||||
delete $scope.placeholderNode;
|
delete $scope.placeholderNode;
|
||||||
delete $scope.betweenTwoNodes;
|
delete $scope.betweenTwoNodes;
|
||||||
$scope.nodeBeingEdited = null;
|
$scope.nodeBeingEdited = null;
|
||||||
$scope.edgeType = "success";
|
|
||||||
$scope.edgeTypeRestriction = null;
|
$scope.edgeTypeRestriction = null;
|
||||||
$scope.workflowMakerFormConfig.activeTab = "jobs";
|
$scope.workflowMakerFormConfig.activeTab = "jobs";
|
||||||
}
|
}
|
||||||
@@ -104,25 +92,29 @@ export default ['$scope', 'WorkflowHelpService', 'generateList', 'JobTemplateLis
|
|||||||
parentId: betweenTwoNodes ? parent.source.id : parent.id
|
parentId: betweenTwoNodes ? parent.source.id : parent.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set the default to success
|
||||||
|
let edgeType = "success";
|
||||||
|
|
||||||
if (parent && ((betweenTwoNodes && parent.source.isStartNode) || (!betweenTwoNodes && parent.isStartNode))) {
|
if (parent && ((betweenTwoNodes && parent.source.isStartNode) || (!betweenTwoNodes && parent.isStartNode))) {
|
||||||
// We don't want to give the user the option to select
|
// We don't want to give the user the option to select
|
||||||
// a type as this node will always be executed
|
// a type as this node will always be executed
|
||||||
$scope.edgeType = "always";
|
edgeType = "always";
|
||||||
$scope.showTypeOptions = false;
|
$scope.showTypeOptions = false;
|
||||||
} else {
|
} else {
|
||||||
if ((_.includes(siblingConnectionTypes, "success") || _.includes(siblingConnectionTypes, "failure")) && _.includes(siblingConnectionTypes, "always")) {
|
if ((_.includes(siblingConnectionTypes, "success") || _.includes(siblingConnectionTypes, "failure")) && _.includes(siblingConnectionTypes, "always")) {
|
||||||
// This is a problem...
|
// This is a problem...
|
||||||
} else if (_.includes(siblingConnectionTypes, "success") || _.includes(siblingConnectionTypes, "failure")) {
|
} else if (_.includes(siblingConnectionTypes, "success") || _.includes(siblingConnectionTypes, "failure")) {
|
||||||
$scope.edgeTypeRestriction = "successFailure";
|
$scope.edgeTypeRestriction = "successFailure";
|
||||||
$scope.edgeType = "success";
|
edgeType = "success";
|
||||||
} else if (_.includes(siblingConnectionTypes, "always")) {
|
} else if (_.includes(siblingConnectionTypes, "always")) {
|
||||||
$scope.edgeTypeRestriction = "always";
|
$scope.edgeTypeRestriction = "always";
|
||||||
$scope.edgeType = "always";
|
edgeType = "always";
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.showTypeOptions = true;
|
$scope.showTypeOptions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.$broadcast("setEdgeType", edgeType);
|
||||||
$scope.$broadcast("refreshWorkflowChart");
|
$scope.$broadcast("refreshWorkflowChart");
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -343,9 +335,11 @@ export default ['$scope', 'WorkflowHelpService', 'generateList', 'JobTemplateLis
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
formValues.edgeType = $scope.nodeBeingEdited.edgeType;
|
//formValues.edgeType = $scope.nodeBeingEdited.edgeType;
|
||||||
$scope.showTypeOptions = (parent && parent.isStartNode) ? false : true;
|
$scope.showTypeOptions = (parent && parent.isStartNode) ? false : true;
|
||||||
|
|
||||||
|
$scope.$broadcast('setEdgeType', $scope.nodeBeingEdited.edgeType);
|
||||||
|
|
||||||
$scope.$broadcast('templateSelected', {
|
$scope.$broadcast('templateSelected', {
|
||||||
presetValues: formValues,
|
presetValues: formValues,
|
||||||
activeTab: $scope.workflowMakerFormConfig.activeTab
|
activeTab: $scope.workflowMakerFormConfig.activeTab
|
||||||
|
|||||||
@@ -13,6 +13,48 @@ export default
|
|||||||
function( Wait, $state, $scope, $rootScope, $location, GetBasePath, Rest,
|
function( Wait, $state, $scope, $rootScope, $location, GetBasePath, Rest,
|
||||||
ProcessErrors, CheckLicense, moment, $window, ConfigService,
|
ProcessErrors, CheckLicense, moment, $window, ConfigService,
|
||||||
FeaturesService, pendoService, i18n){
|
FeaturesService, pendoService, i18n){
|
||||||
|
|
||||||
|
var calcDaysRemaining = function(seconds){
|
||||||
|
// calculate the number of days remaining on the license
|
||||||
|
var duration = moment.duration(seconds, 'seconds').asDays();
|
||||||
|
duration = Math.floor(duration);
|
||||||
|
if(duration < 0 ){
|
||||||
|
duration = 0;
|
||||||
|
}
|
||||||
|
duration = (duration!==1) ? `${duration} Days` : `${duration} Day`;
|
||||||
|
return duration;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var calcExpiresOn = function(days){
|
||||||
|
// calculate the expiration date of the license
|
||||||
|
days = parseInt(days);
|
||||||
|
return moment().add(days, 'days').calendar();
|
||||||
|
};
|
||||||
|
|
||||||
|
var reset = function(){
|
||||||
|
document.getElementById('License-form').reset();
|
||||||
|
};
|
||||||
|
|
||||||
|
var init = function(){
|
||||||
|
// license/license.partial.html compares fileName
|
||||||
|
$scope.fileName = N_("No file selected.");
|
||||||
|
$scope.title = $rootScope.licenseMissing ? ("Tower " + i18n._("License")) : i18n._("License Management");
|
||||||
|
Wait('start');
|
||||||
|
ConfigService.getConfig().then(function(config){
|
||||||
|
$scope.license = config;
|
||||||
|
$scope.license.version = config.version.split('-')[0];
|
||||||
|
$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.compliant = $scope.license.license_info.compliant;
|
||||||
|
Wait('stop');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
$scope.getKey = function(event){
|
$scope.getKey = function(event){
|
||||||
// Mimic HTML5 spec, show filename
|
// Mimic HTML5 spec, show filename
|
||||||
$scope.fileName = event.target.files[0].name;
|
$scope.fileName = event.target.files[0].name;
|
||||||
@@ -73,43 +115,5 @@ export default
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var calcDaysRemaining = function(seconds){
|
|
||||||
// calculate the number of days remaining on the license
|
|
||||||
var duration = moment.duration(seconds, 'seconds').asDays();
|
|
||||||
duration = Math.floor(duration);
|
|
||||||
if(duration < 0 ){
|
|
||||||
duration = 0;
|
|
||||||
}
|
|
||||||
duration = (duration!==1) ? `${duration} Days` : `${duration} Day`;
|
|
||||||
return duration;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var calcExpiresOn = function(days){
|
|
||||||
// calculate the expiration date of the license
|
|
||||||
days = parseInt(days);
|
|
||||||
return moment().add(days, 'days').calendar();
|
|
||||||
};
|
|
||||||
|
|
||||||
var init = function(){
|
|
||||||
// license/license.partial.html compares fileName
|
|
||||||
$scope.fileName = N_("No file selected.");
|
|
||||||
$scope.title = $rootScope.licenseMissing ? ("Tower " + i18n._("License")) : i18n._("License Management");
|
|
||||||
Wait('start');
|
|
||||||
ConfigService.getConfig().then(function(config){
|
|
||||||
$scope.license = config;
|
|
||||||
$scope.license.version = config.version.split('-')[0];
|
|
||||||
$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.compliant = $scope.license.license_info.compliant;
|
|
||||||
Wait('stop');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var reset = function(){
|
|
||||||
document.getElementById('License-form').reset();
|
|
||||||
};
|
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
issuePendoIdentity: function () {
|
issuePendoIdentity: function () {
|
||||||
var config,
|
var options,
|
||||||
options,
|
|
||||||
c = ConfigService.get(),
|
c = ConfigService.get(),
|
||||||
config = c.license_info;
|
config = c.license_info;
|
||||||
|
|
||||||
config.analytics_status = c.analytics_status;
|
config.analytics_status = c.analytics_status;
|
||||||
config.version = c.version;
|
config.version = c.version;
|
||||||
config.ansible_version = c.ansible_version;
|
config.ansible_version = c.ansible_version;
|
||||||
@@ -114,7 +114,7 @@ export default
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$log.debug('Pendo is turned off.')
|
$log.debug('Pendo is turned off.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* jshint ignore:start */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pendo.io Angular Module
|
* pendo.io Angular Module
|
||||||
*
|
*
|
||||||
@@ -25,7 +27,7 @@
|
|||||||
setTimeout(waitFn, delay);
|
setTimeout(waitFn, delay);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
angular.module('pendolytics', [])
|
angular.module('pendolytics', [])
|
||||||
.provider('$pendolytics', function() {
|
.provider('$pendolytics', function() {
|
||||||
|
|
||||||
|
|||||||
@@ -11,15 +11,11 @@
|
|||||||
* Controller for handling permissions adding
|
* Controller for handling permissions adding
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default ['$scope', '$rootScope', 'ProcessErrors', 'generateList', 'GetBasePath',
|
export default ['$scope', '$rootScope', 'ProcessErrors', 'GetBasePath',
|
||||||
'SelectionInit', 'templateUrl', '$state', 'Rest', '$q', 'Wait',
|
'SelectionInit', 'templateUrl', '$state', 'Rest', '$q', 'Wait',
|
||||||
function($scope, $rootScope, ProcessErrors, generateList, GetBasePath,
|
function($scope, $rootScope, ProcessErrors, GetBasePath,
|
||||||
SelectionInit, templateUrl, $state, Rest, $q, Wait) {
|
SelectionInit, templateUrl, $state, Rest, $q, Wait) {
|
||||||
$scope.$on("linkLists", function() {
|
$scope.$on("linkLists", function() {
|
||||||
var generator = generateList,
|
|
||||||
//list = AddUserList,
|
|
||||||
id = "addUsersList",
|
|
||||||
mode = "add";
|
|
||||||
|
|
||||||
if ($state.current.name.split(".")[1] === "users") {
|
if ($state.current.name.split(".")[1] === "users") {
|
||||||
$scope.addType = "Users";
|
$scope.addType = "Users";
|
||||||
@@ -36,7 +32,7 @@ function($scope, $rootScope, ProcessErrors, generateList, GetBasePath,
|
|||||||
$scope.add_users = $scope.$parent.add_user_dataset.results;
|
$scope.add_users = $scope.$parent.add_user_dataset.results;
|
||||||
|
|
||||||
$scope.selectedItems = [];
|
$scope.selectedItems = [];
|
||||||
$scope.$on('selectedOrDeselected', (item)=>{
|
$scope.$on('selectedOrDeselected', ()=>{
|
||||||
throw {name: 'NotYetImplemented'};
|
throw {name: 'NotYetImplemented'};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import routes from './organizations-linkout.route';
|
|
||||||
import AddUsers from './addUsers/main';
|
import AddUsers from './addUsers/main';
|
||||||
|
|
||||||
export default angular.module('organizationsLinkout', [AddUsers.name]);
|
export default angular.module('organizationsLinkout', [AddUsers.name]);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import { templateUrl } from '../../shared/template-url/template-url.factory';
|
|
||||||
import OrganizationsAdmins from './controllers/organizations-admins.controller';
|
import OrganizationsAdmins from './controllers/organizations-admins.controller';
|
||||||
import OrganizationsInventories from './controllers/organizations-inventories.controller';
|
import OrganizationsInventories from './controllers/organizations-inventories.controller';
|
||||||
import OrganizationsJobTemplates from './controllers/organizations-job-templates.controller';
|
import OrganizationsJobTemplates from './controllers/organizations-job-templates.controller';
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ export default {
|
|||||||
views: {
|
views: {
|
||||||
'list@': {
|
'list@': {
|
||||||
templateUrl: templateUrl('portal-mode/portal-mode-layout'),
|
templateUrl: templateUrl('portal-mode/portal-mode-layout'),
|
||||||
controller: ['$scope', '$rootScope', '$state', '$stateParams', 'GetBasePath', 'QuerySet', 'jobsDataset',
|
controller: ['$scope', '$rootScope', '$state', '$stateParams', 'GetBasePath', 'QuerySet',
|
||||||
function($scope, $rootScope, $state, $stateParams, GetBasePath, qs, Dataset) {
|
function($scope, $rootScope, $state, $stateParams, GetBasePath, qs) {
|
||||||
let path;
|
let path;
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|||||||
@@ -90,9 +90,8 @@ export default [
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||||
console.log(base)
|
|
||||||
if (base === 'management_jobs') {
|
if (base === 'management_jobs') {
|
||||||
$scope.base = base = 'system_job_templates';
|
$scope.base = base = 'system_job_templates';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,10 +142,10 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
.factory('GenerateForm', ['$rootScope', '$location', '$compile', 'generateList',
|
.factory('GenerateForm', ['$rootScope', '$location', '$compile', 'generateList',
|
||||||
'Attr', 'Icon', 'Column',
|
'Attr', 'Icon', 'Column',
|
||||||
'NavigationLink', 'HelpCollapse', 'DropDown', 'Empty', 'SelectIcon',
|
'NavigationLink', 'HelpCollapse', 'DropDown', 'Empty', 'SelectIcon',
|
||||||
'Store', 'ActionButton', '$log', 'i18n', '$timeout',
|
'Store', 'ActionButton', '$log', 'i18n',
|
||||||
function ($rootScope, $location, $compile, GenerateList,
|
function ($rootScope, $location, $compile, GenerateList,
|
||||||
Attr, Icon, Column, NavigationLink, HelpCollapse,
|
Attr, Icon, Column, NavigationLink, HelpCollapse,
|
||||||
DropDown, Empty, SelectIcon, Store, ActionButton, $log, i18n, $timeout) {
|
DropDown, Empty, SelectIcon, Store, ActionButton, $log, i18n) {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
setForm: function (form) { this.form = form; },
|
setForm: function (form) { this.form = form; },
|
||||||
@@ -1079,6 +1079,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
|
html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
|
||||||
html += (field.readonly) ? "disabled " : "";
|
html += (field.readonly) ? "disabled " : "";
|
||||||
html += (field.required) ? "required " : "";
|
html += (field.required) ? "required " : "";
|
||||||
|
html += (field.ngshow) ? "ng-show=\"" + field.ngShow + "\" " : "";
|
||||||
if(field.awRequiredWhen) {
|
if(field.awRequiredWhen) {
|
||||||
html += field.awRequiredWhen.init ? "data-awrequired-init=\"" + field.awRequiredWhen.init + "\" " : "";
|
html += field.awRequiredWhen.init ? "data-awrequired-init=\"" + field.awRequiredWhen.init + "\" " : "";
|
||||||
html += field.awRequiredWhen.reqExpression ? "aw-required-when=\"" + field.awRequiredWhen.reqExpression + "\" " : "";
|
html += field.awRequiredWhen.reqExpression ? "aw-required-when=\"" + field.awRequiredWhen.reqExpression + "\" " : "";
|
||||||
@@ -1233,8 +1234,8 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
// Generate HTML. Do NOT call this function directly. Called by inject(). Returns an HTML
|
// Generate HTML. Do NOT call this function directly. Called by inject(). Returns an HTML
|
||||||
// string to be injected into the current view.
|
// string to be injected into the current view.
|
||||||
//
|
//
|
||||||
var btn, button, fld, field, html = '', i, section, group,
|
var btn, button, fld, field, html = '', section, group,
|
||||||
tab, sectionShow, offset, width,ngDisabled, itm;
|
sectionShow, offset, width,ngDisabled, itm;
|
||||||
|
|
||||||
// title and exit button
|
// title and exit button
|
||||||
if(!(this.form.showHeader !== undefined && this.form.showHeader === false)) {
|
if(!(this.form.showHeader !== undefined && this.form.showHeader === false)) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default ['templateUrl', '$compile', function(templateUrl, $compile) {
|
export default ['templateUrl', function(templateUrl) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
replace: true,
|
replace: true,
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import lookupModal from './lookup/main';
|
|||||||
import smartSearch from './smart-search/main';
|
import smartSearch from './smart-search/main';
|
||||||
import paginate from './paginate/main';
|
import paginate from './paginate/main';
|
||||||
import columnSort from './column-sort/main';
|
import columnSort from './column-sort/main';
|
||||||
import title from './title.directive';
|
|
||||||
import lodashAsPromised from './lodash-as-promised';
|
import lodashAsPromised from './lodash-as-promised';
|
||||||
import stringFilters from './string-filters/main';
|
import stringFilters from './string-filters/main';
|
||||||
import truncatedText from './truncated-text.directive';
|
import truncatedText from './truncated-text.directive';
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calcDataRange() {
|
function calcDataRange() {
|
||||||
if ($scope.current() == 1 && $scope.dataset.count < parseInt(pageSize)) {
|
if ($scope.current() === 1 && $scope.dataset.count < parseInt(pageSize)) {
|
||||||
return `1 - ${$scope.dataset.count}`;
|
return `1 - ${$scope.dataset.count}`;
|
||||||
} else if ($scope.current() == 1) {
|
} else if ($scope.current() === 1) {
|
||||||
return `1 - ${pageSize}`;
|
return `1 - ${pageSize}`;
|
||||||
} else {
|
} else {
|
||||||
let floor = (($scope.current() - 1) * parseInt(pageSize)) + 1;
|
let floor = (($scope.current() - 1) * parseInt(pageSize)) + 1;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSearchModel', '$cacheFactory', 'GetBasePath',
|
export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSearchModel', '$cacheFactory',
|
||||||
function($q, Rest, ProcessErrors, $rootScope, Wait, DjangoSearchModel, $cacheFactory, GetBasePath) {
|
function($q, Rest, ProcessErrors, $rootScope, Wait, DjangoSearchModel, $cacheFactory) {
|
||||||
return {
|
return {
|
||||||
// kick off building a model for a specific endpoint
|
// kick off building a model for a specific endpoint
|
||||||
// this is usually a list's basePath
|
// this is usually a list's basePath
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ export default
|
|||||||
$log.debug('Websocket Error Logged: ' + error); //log errors
|
$log.debug('Websocket Error Logged: ' + error); //log errors
|
||||||
};
|
};
|
||||||
|
|
||||||
self.socket.onconnecting = function (event) {
|
self.socket.onconnecting = function () {
|
||||||
self.checkStatus();
|
self.checkStatus();
|
||||||
$log.debug('Websocket reconnecting');
|
$log.debug('Websocket reconnecting');
|
||||||
needsResubscribing = true;
|
needsResubscribing = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.socket.onclose = function (event) {
|
self.socket.onclose = function () {
|
||||||
self.checkStatus();
|
self.checkStatus();
|
||||||
$log.debug(`Websocket disconnected`);
|
$log.debug(`Websocket disconnected`);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
* generateLookupNodes - Attaches to a form node. Builds an abstract '*.lookup' node with field-specific 'lookup.*' children e.g. {name: 'projects.add.lookup.organizations', ...}
|
* generateLookupNodes - Attaches to a form node. Builds an abstract '*.lookup' node with field-specific 'lookup.*' children e.g. {name: 'projects.add.lookup.organizations', ...}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { templateUrl } from './template-url/template-url.factory';
|
|
||||||
|
|
||||||
export default ['$injector', '$stateExtender', '$log', function($injector, $stateExtender, $log) {
|
export default ['$injector', '$stateExtender', '$log', function($injector, $stateExtender, $log) {
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default ['workflowData',
|
|||||||
workflowNodes,
|
workflowNodes,
|
||||||
$scope,
|
$scope,
|
||||||
ParseTypeChange,
|
ParseTypeChange,
|
||||||
ParseVariableString,
|
ParseVariableString
|
||||||
) {
|
) {
|
||||||
var getTowerLinks = function() {
|
var getTowerLinks = function() {
|
||||||
var getTowerLink = function(key) {
|
var getTowerLink = function(key) {
|
||||||
@@ -48,10 +48,10 @@ export default ['workflowData',
|
|||||||
$scope.verbosity_label = getTowerLabel('verbosity');
|
$scope.verbosity_label = getTowerLabel('verbosity');
|
||||||
};
|
};
|
||||||
|
|
||||||
var getTotalHostCount = function(count) {
|
// var getTotalHostCount = function(count) {
|
||||||
return Object
|
// return Object
|
||||||
.keys(count).reduce((acc, i) => acc += count[i], 0);
|
// .keys(count).reduce((acc, i) => acc += count[i], 0);
|
||||||
};
|
// };
|
||||||
|
|
||||||
// put initially resolved request data on scope
|
// put initially resolved request data on scope
|
||||||
$scope.workflow = workflowData;
|
$scope.workflow = workflowData;
|
||||||
@@ -101,60 +101,60 @@ export default ['workflowData',
|
|||||||
|
|
||||||
// This is where the async updates to the UI actually happen.
|
// This is where the async updates to the UI actually happen.
|
||||||
// Flow is event queue munging in the service -> $scope setting in here
|
// Flow is event queue munging in the service -> $scope setting in here
|
||||||
var processEvent = function(event) {
|
// var processEvent = function(event) {
|
||||||
// put the event in the queue
|
// // put the event in the queue
|
||||||
eventQueue.populate(event).then(mungedEvent => {
|
// eventQueue.populate(event).then(mungedEvent => {
|
||||||
// make changes to ui based on the event returned from the queue
|
// // make changes to ui based on the event returned from the queue
|
||||||
if (mungedEvent.changes) {
|
// if (mungedEvent.changes) {
|
||||||
mungedEvent.changes.forEach(change => {
|
// mungedEvent.changes.forEach(change => {
|
||||||
// we've got a change we need to make to the UI!
|
// // we've got a change we need to make to the UI!
|
||||||
// update the necessary scope and make the change
|
// // update the necessary scope and make the change
|
||||||
if (change === 'startTime' && !$scope.workflow.start) {
|
// if (change === 'startTime' && !$scope.workflow.start) {
|
||||||
$scope.workflow.start = mungedEvent.startTime;
|
// $scope.workflow.start = mungedEvent.startTime;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (change === 'count' && !$scope.countFinished) {
|
// if (change === 'count' && !$scope.countFinished) {
|
||||||
// for all events that affect the host count,
|
// // for all events that affect the host count,
|
||||||
// update the status bar as well as the host
|
// // update the status bar as well as the host
|
||||||
// count badge
|
// // count badge
|
||||||
$scope.count = mungedEvent.count;
|
// $scope.count = mungedEvent.count;
|
||||||
$scope.hostCount = getTotalHostCount(mungedEvent
|
// $scope.hostCount = getTotalHostCount(mungedEvent
|
||||||
.count);
|
// .count);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (change === 'playCount') {
|
// if (change === 'playCount') {
|
||||||
$scope.playCount = mungedEvent.playCount;
|
// $scope.playCount = mungedEvent.playCount;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (change === 'taskCount') {
|
// if (change === 'taskCount') {
|
||||||
$scope.taskCount = mungedEvent.taskCount;
|
// $scope.taskCount = mungedEvent.taskCount;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (change === 'finishedTime' && !$scope.workflow.finished) {
|
// if (change === 'finishedTime' && !$scope.workflow.finished) {
|
||||||
$scope.workflow.finished = mungedEvent.finishedTime;
|
// $scope.workflow.finished = mungedEvent.finishedTime;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (change === 'countFinished') {
|
// if (change === 'countFinished') {
|
||||||
// the playbook_on_stats event actually lets
|
// // the playbook_on_stats event actually lets
|
||||||
// us know that we don't need to iteratively
|
// // us know that we don't need to iteratively
|
||||||
// look at event to update the host counts
|
// // look at event to update the host counts
|
||||||
// any more.
|
// // any more.
|
||||||
$scope.countFinished = true;
|
// $scope.countFinished = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if(change === 'stdout'){
|
// if(change === 'stdout'){
|
||||||
angular
|
// angular
|
||||||
.element(".JobResultsStdOut-stdoutContainer")
|
// .element(".JobResultsStdOut-stdoutContainer")
|
||||||
.append($compile(mungedEvent
|
// .append($compile(mungedEvent
|
||||||
.stdout)($scope));
|
// .stdout)($scope));
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// the changes have been processed in the ui, mark it in the queue
|
// // the changes have been processed in the ui, mark it in the queue
|
||||||
eventQueue.markProcessed(event);
|
// eventQueue.markProcessed(event);
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
// PULL! grab completed event data and process each event
|
// PULL! grab completed event data and process each event
|
||||||
// TODO: implement retry logic in case one of these requests fails
|
// TODO: implement retry logic in case one of these requests fails
|
||||||
@@ -174,10 +174,10 @@ export default ['workflowData',
|
|||||||
// };
|
// };
|
||||||
// getEvents($scope.job.related.job_events);
|
// getEvents($scope.job.related.job_events);
|
||||||
|
|
||||||
// Processing of job_events messages from the websocket
|
// // Processing of job_events messages from the websocket
|
||||||
$scope.$on(`ws-job_events-${$scope.workflow.id}`, function(e, data) {
|
// $scope.$on(`ws-job_events-${$scope.workflow.id}`, function(e, data) {
|
||||||
processEvent(data);
|
// processEvent(data);
|
||||||
});
|
// });
|
||||||
|
|
||||||
// Processing of job-status messages from the websocket
|
// Processing of job-status messages from the websocket
|
||||||
$scope.$on(`ws-jobs`, function(e, data) {
|
$scope.$on(`ws-jobs`, function(e, data) {
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ export default {
|
|||||||
defer.resolve(data.results);
|
defer.resolve(data.results);
|
||||||
})
|
})
|
||||||
.error(function() {
|
.error(function() {
|
||||||
defer.resolve(data);
|
// TODO: handle this
|
||||||
|
//defer.resolve(data);
|
||||||
});
|
});
|
||||||
return defer.promise;
|
return defer.promise;
|
||||||
}],
|
}],
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
|
|||||||
</div>`,
|
</div>`,
|
||||||
action: function() {
|
action: function() {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
Rest.setUrl(job.url);
|
Rest.setUrl(workflow.url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function() {
|
.success(function() {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
Reference in New Issue
Block a user