mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
Management job modals restyled & shows correct modals.
This commit is contained in:
@@ -12,18 +12,19 @@ export default
|
|||||||
'SchedulesList',
|
'SchedulesList',
|
||||||
'Rest' , 'ProcessErrors', 'managementJobsListObject', '$rootScope',
|
'Rest' , 'ProcessErrors', 'managementJobsListObject', '$rootScope',
|
||||||
'$state','$scope',
|
'$state','$scope',
|
||||||
function( Wait, $location, $compile, CreateDialog,
|
function( Wait, $location, $compile, CreateDialog,
|
||||||
GetBasePath, SearchInit, PaginateInit,
|
GetBasePath, SearchInit, PaginateInit,
|
||||||
SchedulesList,
|
SchedulesList,
|
||||||
Rest, ProcessErrors, managementJobsListObject, $rootScope,
|
Rest, ProcessErrors, managementJobsListObject, $rootScope,
|
||||||
$state, $scope) {
|
$state, $scope) {
|
||||||
|
|
||||||
var defaultUrl = GetBasePath('system_job_templates');
|
var defaultUrl = GetBasePath('system_job_templates');
|
||||||
|
|
||||||
var getManagementJobs = function(){
|
var getManagementJobs = function(){
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function(data){
|
.success(function(data){
|
||||||
|
console.info(data.results);
|
||||||
$scope.mgmtCards = data.results;
|
$scope.mgmtCards = data.results;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
@@ -32,7 +33,7 @@ export default
|
|||||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getManagementJobs();
|
getManagementJobs();
|
||||||
var scope = $rootScope.$new(),
|
var scope = $rootScope.$new(),
|
||||||
parent_scope = scope,
|
parent_scope = scope,
|
||||||
list = managementJobsListObject;
|
list = managementJobsListObject;
|
||||||
@@ -51,9 +52,6 @@ export default
|
|||||||
if (scope.searchCleanup) {
|
if (scope.searchCleanup) {
|
||||||
scope.searchCleanup();
|
scope.searchCleanup();
|
||||||
}
|
}
|
||||||
// if (!Empty(parent_scope) && parent_scope.restoreSearch) {
|
|
||||||
// parent_scope.restoreSearch();
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
}
|
}
|
||||||
@@ -69,6 +67,7 @@ export default
|
|||||||
height: 470,
|
height: 470,
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
callback: 'PromptForDaysFacts',
|
callback: 'PromptForDaysFacts',
|
||||||
|
resizable: false,
|
||||||
onOpen: function(){
|
onOpen: function(){
|
||||||
scope.$watch('prompt_for_days_facts_form.$invalid', function(invalid) {
|
scope.$watch('prompt_for_days_facts_form.$invalid', function(invalid) {
|
||||||
if (invalid === true) {
|
if (invalid === true) {
|
||||||
@@ -113,41 +112,40 @@ export default
|
|||||||
fieldScope.keep_amount = 30;
|
fieldScope.keep_amount = 30;
|
||||||
fieldScope.granularity_keep_amount = 1;
|
fieldScope.granularity_keep_amount = 1;
|
||||||
},
|
},
|
||||||
buttons: [{
|
buttons: [
|
||||||
"label": "Cancel",
|
{
|
||||||
"onClick": function() {
|
"label": "Launch",
|
||||||
$(this).dialog('close');
|
"onClick": function() {
|
||||||
|
var extra_vars = {
|
||||||
|
"older_than": scope.keep_amount+scope.keep_unit.value,
|
||||||
|
"granularity": scope.granularity_keep_amount+scope.granularity_keep_unit.value
|
||||||
|
},
|
||||||
|
data = {};
|
||||||
|
data.extra_vars = JSON.stringify(extra_vars);
|
||||||
|
|
||||||
},
|
Rest.setUrl(defaultUrl);
|
||||||
"icon": "fa-times",
|
Rest.post(data)
|
||||||
"class": "btn btn-default",
|
.success(function() {
|
||||||
"id": "prompt-for-days-facts-cancel"
|
Wait('stop');
|
||||||
},{
|
$("#prompt-for-days-facts").dialog("close");
|
||||||
"label": "Launch",
|
$("#configure-tower-dialog").dialog('close');
|
||||||
"onClick": function() {
|
$location.path('/jobs/');
|
||||||
var extra_vars = {
|
})
|
||||||
"older_than": scope.keep_amount+scope.keep_unit.value,
|
.error(function(data, status) {
|
||||||
"granularity": scope.granularity_keep_amount+scope.granularity_keep_unit.value
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
|
msg: 'Failed updating job ' + scope.job_template_id + ' with variables. POST returned: ' + status });
|
||||||
|
});
|
||||||
},
|
},
|
||||||
data = {};
|
"class": "btn btn-primary",
|
||||||
data.extra_vars = JSON.stringify(extra_vars);
|
"id": "prompt-for-days-facts-launch",
|
||||||
|
|
||||||
Rest.setUrl(defaultUrl);
|
|
||||||
Rest.post(data)
|
|
||||||
.success(function() {
|
|
||||||
Wait('stop');
|
|
||||||
$("#prompt-for-days-facts").dialog("close");
|
|
||||||
$("#configure-tower-dialog").dialog('close');
|
|
||||||
$location.path('/jobs/');
|
|
||||||
})
|
|
||||||
.error(function(data, status) {
|
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Failed updating job ' + scope.job_template_id + ' with variables. POST returned: ' + status });
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
"icon": "fa-rocket",
|
{
|
||||||
"class": "btn btn-primary",
|
"label": "Cancel",
|
||||||
"id": "prompt-for-days-facts-launch"
|
"onClick": function() {
|
||||||
|
$(this).dialog('close');
|
||||||
|
},
|
||||||
|
"class": "btn btn-default",
|
||||||
|
"id": "prompt-for-days-facts-cancel"
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -162,12 +160,8 @@ export default
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.submitJob = function (id, name) {
|
$scope.submitJob = function (id, name, card) {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
if(this.configure_job.job_type === "cleanup_facts"){
|
|
||||||
scope.submitCleanupJob(id, name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
defaultUrl = GetBasePath('system_job_templates')+id+'/launch/';
|
defaultUrl = GetBasePath('system_job_templates')+id+'/launch/';
|
||||||
CreateDialog({
|
CreateDialog({
|
||||||
id: 'prompt-for-days' ,
|
id: 'prompt-for-days' ,
|
||||||
@@ -177,6 +171,7 @@ export default
|
|||||||
height: 300,
|
height: 300,
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
callback: 'PromptForDays',
|
callback: 'PromptForDays',
|
||||||
|
resizable: false,
|
||||||
onOpen: function(){
|
onOpen: function(){
|
||||||
scope.$watch('prompt_for_days_form.$invalid', function(invalid) {
|
scope.$watch('prompt_for_days_form.$invalid', function(invalid) {
|
||||||
if (invalid === true) {
|
if (invalid === true) {
|
||||||
@@ -191,16 +186,8 @@ export default
|
|||||||
scope.prompt_for_days_form.$setPristine();
|
scope.prompt_for_days_form.$setPristine();
|
||||||
scope.prompt_for_days_form.$invalid = false;
|
scope.prompt_for_days_form.$invalid = false;
|
||||||
},
|
},
|
||||||
buttons: [{
|
buttons: [
|
||||||
"label": "Cancel",
|
{
|
||||||
"onClick": function() {
|
|
||||||
$(this).dialog('close');
|
|
||||||
|
|
||||||
},
|
|
||||||
"icon": "fa-times",
|
|
||||||
"class": "btn btn-default",
|
|
||||||
"id": "prompt-for-days-cancel"
|
|
||||||
},{
|
|
||||||
"label": "Launch",
|
"label": "Launch",
|
||||||
"onClick": function() {
|
"onClick": function() {
|
||||||
var extra_vars = {"days": scope.days_to_keep },
|
var extra_vars = {"days": scope.days_to_keep },
|
||||||
@@ -220,9 +207,17 @@ export default
|
|||||||
msg: 'Failed updating job ' + scope.job_template_id + ' with variables. POST returned: ' + status });
|
msg: 'Failed updating job ' + scope.job_template_id + ' with variables. POST returned: ' + status });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"icon": "fa-rocket",
|
|
||||||
"class": "btn btn-primary",
|
"class": "btn btn-primary",
|
||||||
"id": "prompt-for-days-launch"
|
"id": "prompt-for-days-launch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Cancel",
|
||||||
|
"onClick": function() {
|
||||||
|
$(this).dialog('close');
|
||||||
|
|
||||||
|
},
|
||||||
|
"class": "btn btn-default",
|
||||||
|
"id": "prompt-for-days-cancel"
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -235,6 +230,14 @@ export default
|
|||||||
$('#prompt-for-days').dialog('open');
|
$('#prompt-for-days').dialog('open');
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.chooseRunJob = function(id, name) {
|
||||||
|
if(id === 4) {
|
||||||
|
// Run only for 'Cleanup Fact Details'
|
||||||
|
$scope.submitCleanupJob(id, name);
|
||||||
|
} else {
|
||||||
|
$scope.submitJob(id, name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<h3 class="MgmtCards-label"> {{ card.name }}</h3>
|
<h3 class="MgmtCards-label"> {{ card.name }}</h3>
|
||||||
<div class="MgmtCards-actionItems">
|
<div class="MgmtCards-actionItems">
|
||||||
<button class="MgmtCards-actionItem List-actionButton"
|
<button class="MgmtCards-actionItem List-actionButton"
|
||||||
ng-click='submitCleanupJob(card.id, card.name)'>
|
ng-click='chooseRunJob(card.id, card.name)'>
|
||||||
<i class="MgmtCards-actionItemIcon fa fa-rocket"></i>
|
<i class="MgmtCards-actionItemIcon fa fa-rocket"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="MgmtCards-actionItem List-actionButton"
|
<button class="MgmtCards-actionItem List-actionButton"
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
<p>{{card.description || "Place organization description here"}}</p>
|
<p>{{card.description || "Place organization description here"}}</p>
|
||||||
<!-- End Card Body -->
|
<!-- End Card Body -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -114,3 +114,12 @@
|
|||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#prompt-for-days-facts, #prompt-for-days {
|
||||||
|
overflow-x: hidden;
|
||||||
|
font-family: "Open Sans";
|
||||||
|
.label-text {
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -171,10 +171,11 @@
|
|||||||
<div style="padding-bottom:15px;">For facts collected older than the time period specified,
|
<div style="padding-bottom:15px;">For facts collected older than the time period specified,
|
||||||
save one fact scan (snapshot) per time window (frequency).
|
save one fact scan (snapshot) per time window (frequency).
|
||||||
For example, facts older than 30 days are purged, while one
|
For example, facts older than 30 days are purged, while one
|
||||||
weekly fact scan is kept.<br>
|
weekly fact scan is kept.<br> <br>
|
||||||
Caution: Setting both numerical variables to "0" will delete all facts.<br>
|
|
||||||
|
CAUTION: Setting both numerical variables to "0" will delete all facts.<br><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group ">
|
<div class="form-group">
|
||||||
<label for="description">
|
<label for="description">
|
||||||
<span class="label-text">
|
<span class="label-text">
|
||||||
Select a time period after which to remove old facts
|
Select a time period after which to remove old facts
|
||||||
@@ -197,7 +198,7 @@
|
|||||||
<label for="description">
|
<label for="description">
|
||||||
<span class="label-text">
|
<span class="label-text">
|
||||||
Select a frequency for snapshot retention
|
Select a frequency for snapshot retention
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user