mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
more updates to ui crud
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
export function JobsListController ($rootScope, $log, $scope, $compile, $stateParams,
|
export function JobsListController ($rootScope, $log, $scope, $compile, $stateParams,
|
||||||
ClearScope, LoadSchedulesScope,
|
ClearScope, LoadSchedulesScope,
|
||||||
LoadJobsScope, AllJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait) {
|
LoadJobsScope, AllJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait, $state) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -61,6 +61,11 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
jobs_scope = $scope.$new(true);
|
jobs_scope = $scope.$new(true);
|
||||||
|
|
||||||
|
jobs_scope.viewJob = function (id) {
|
||||||
|
$state.transitionTo('jobDetail', {id: id});
|
||||||
|
};
|
||||||
|
|
||||||
jobs_scope.showJobType = true;
|
jobs_scope.showJobType = true;
|
||||||
LoadJobsScope({
|
LoadJobsScope({
|
||||||
parent_scope: $scope,
|
parent_scope: $scope,
|
||||||
@@ -153,4 +158,4 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
|
|
||||||
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',
|
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',
|
||||||
'ClearScope', 'LoadSchedulesScope', 'LoadJobsScope',
|
'ClearScope', 'LoadSchedulesScope', 'LoadJobsScope',
|
||||||
'AllJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait'];
|
'AllJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait', '$state'];
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default
|
|||||||
LookUpInit, OrganizationList, inventory_script,
|
LookUpInit, OrganizationList, inventory_script,
|
||||||
$scope, $state
|
$scope, $state
|
||||||
) {
|
) {
|
||||||
|
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
id = inventory_script.id,
|
id = inventory_script.id,
|
||||||
form = inventoryScriptsFormObject,
|
form = inventoryScriptsFormObject,
|
||||||
@@ -24,13 +25,15 @@ export default
|
|||||||
url = GetBasePath('inventory_scripts');
|
url = GetBasePath('inventory_scripts');
|
||||||
|
|
||||||
|
|
||||||
$scope.canEdit = false;
|
$scope.canEditInvScripts = false;
|
||||||
|
|
||||||
Rest.setUrl(GetBasePath('inventory_scripts') + id);
|
Rest.setUrl(GetBasePath('inventory_scripts') + id);
|
||||||
Rest.options()
|
Rest.options()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
if (data.actions.PUT) {
|
if (data.actions.PUT) {
|
||||||
$scope.canEdit = true;
|
$scope.canEditInvScripts = true;
|
||||||
|
} else {
|
||||||
|
$scope.canEditInvScripts = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ export default function() {
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false,
|
capitalize: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!canEditInvScripts'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!canEditInvScripts'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -44,7 +44,7 @@ export default function() {
|
|||||||
sourceModel: 'organization',
|
sourceModel: 'organization',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
ngClick: 'lookUpOrganization()',
|
ngClick: 'lookUpOrganization()',
|
||||||
ngDisabled: '!canEdit'
|
ngDisabled: '!canEditInvScripts'
|
||||||
},
|
},
|
||||||
script: {
|
script: {
|
||||||
label: 'Custom Script',
|
label: 'Custom Script',
|
||||||
@@ -54,7 +54,7 @@ export default function() {
|
|||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
awDropFile: true,
|
awDropFile: true,
|
||||||
ngDisabled: '!canEdit',
|
ngDisabled: '!canEditInvScripts',
|
||||||
rows: 10,
|
rows: 10,
|
||||||
awPopOver: "<p>Drag and drop your custom inventory script file here or create one in the field to import your custom inventory. " +
|
awPopOver: "<p>Drag and drop your custom inventory script file here or create one in the field to import your custom inventory. " +
|
||||||
"<br><br> Script must begin with a hashbang sequence: i.e.... #!/usr/bin/env python</p>",
|
"<br><br> Script must begin with a hashbang sequence: i.e.... #!/usr/bin/env python</p>",
|
||||||
@@ -67,16 +67,16 @@ export default function() {
|
|||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: 'canEdit'
|
ngShow: 'canEditInvScripts'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!canEdit'
|
ngShow: '!canEditInvScripts'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid || !canEdit', //Disable when $pristine or $invalid, optional
|
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid || !canEdit', //Disable when $pristine or $invalid, optional
|
||||||
ngShow: 'canEdit'
|
ngShow: 'canEditInvScripts'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -94,7 +94,12 @@ export default
|
|||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-4',
|
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-4',
|
||||||
|
"view": {
|
||||||
|
mode: "all",
|
||||||
|
ngClick: "viewJob(all_job.id)",
|
||||||
|
awToolTip: "View the job",
|
||||||
|
dataPlacement: "top"
|
||||||
|
},
|
||||||
submit: {
|
submit: {
|
||||||
icon: 'icon-rocket',
|
icon: 'icon-rocket',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
|
|||||||
@@ -78,13 +78,22 @@ export default
|
|||||||
mode: "all",
|
mode: "all",
|
||||||
ngClick: "editSchedule(schedule)",
|
ngClick: "editSchedule(schedule)",
|
||||||
awToolTip: "Edit the schedule",
|
awToolTip: "Edit the schedule",
|
||||||
dataPlacement: "top"
|
dataPlacement: "top",
|
||||||
|
ngShow: 'schedule.summary_fields.user_capabilities.edit'
|
||||||
|
},
|
||||||
|
"view": {
|
||||||
|
mode: "all",
|
||||||
|
ngClick: "editSchedule(schedule)",
|
||||||
|
awToolTip: "View the schedule",
|
||||||
|
dataPlacement: "top",
|
||||||
|
ngShow: '!schedule.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: 'deleteSchedule(schedule.id)',
|
ngClick: 'deleteSchedule(schedule.id)',
|
||||||
awToolTip: 'Delete the schedule',
|
awToolTip: 'Delete the schedule',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top',
|
||||||
|
ngShow: 'schedule.summary_fields.user_capabilities.delete'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ export default
|
|||||||
ngClick: 'addSchedule()',
|
ngClick: 'addSchedule()',
|
||||||
awToolTip: 'Add a new schedule',
|
awToolTip: 'Add a new schedule',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD'
|
buttonContent: '+ ADD',
|
||||||
|
ngShow: 'canAdd'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -82,6 +83,13 @@ export default
|
|||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: 'schedule.summary_fields.user_capabilities.edit'
|
ngShow: 'schedule.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
|
view: {
|
||||||
|
label: 'View',
|
||||||
|
ngClick: "editSchedule(schedule.id)",
|
||||||
|
awToolTip: 'View schedule',
|
||||||
|
dataPlacement: 'top',
|
||||||
|
ngShow: '!schedule.summary_fields.user_capabilities.edit'
|
||||||
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
ngClick: "deleteSchedule(schedule.id)",
|
ngClick: "deleteSchedule(schedule.id)",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<div class="MgmtCards-actionItems">
|
<div class="MgmtCards-actionItems">
|
||||||
<button class="MgmtCards-actionItem List-actionButton"
|
<button class="MgmtCards-actionItem List-actionButton"
|
||||||
ng-click='chooseRunJob(card.id, card.name)'
|
ng-click='chooseRunJob(card.id, card.name)'
|
||||||
|
ng-show='current_user.is_superuser'
|
||||||
data-placement="top" aw-tool-tip="Launch Management Job" data-original-title="" title="">
|
data-placement="top" aw-tool-tip="Launch Management Job" data-original-title="" title="">
|
||||||
<i class="MgmtCards-actionItemIcon icon-launch"></i>
|
<i class="MgmtCards-actionItemIcon icon-launch"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button class="MgmtCards-actionItem List-actionButton"
|
<button class="MgmtCards-actionItem List-actionButton"
|
||||||
ng-click='goToNotifications(card, card.id)'
|
ng-click='goToNotifications(card, card.id)'
|
||||||
|
ng-show='current_user.is_superuser'
|
||||||
data-placement="top" aw-tool-tip="Configure Notifications" data-original-title="" title="" ng-class="{'List-editButton--selected': activeCard === card.id && cardAction === 'notifications'}">
|
data-placement="top" aw-tool-tip="Configure Notifications" data-original-title="" title="" ng-class="{'List-editButton--selected': activeCard === card.id && cardAction === 'notifications'}">
|
||||||
<i class="MgmtCards-actionItemIcon fa fa-bell-o"></i>
|
<i class="MgmtCards-actionItemIcon fa fa-bell-o"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -9,14 +9,23 @@ export default
|
|||||||
'NotificationsFormObject', 'ProcessErrors', 'GetBasePath', 'Empty',
|
'NotificationsFormObject', 'ProcessErrors', 'GetBasePath', 'Empty',
|
||||||
'GenerateForm', 'SearchInit' , 'PaginateInit', 'LookUpInit',
|
'GenerateForm', 'SearchInit' , 'PaginateInit', 'LookUpInit',
|
||||||
'OrganizationList', '$scope', '$state', 'CreateSelect2', 'GetChoices',
|
'OrganizationList', '$scope', '$state', 'CreateSelect2', 'GetChoices',
|
||||||
'NotificationsTypeChange', 'ParseTypeChange',
|
'NotificationsTypeChange', 'ParseTypeChange', 'Alert',
|
||||||
function(
|
function(
|
||||||
$rootScope, pagination, $compile, SchedulerInit, Rest, Wait,
|
$rootScope, pagination, $compile, SchedulerInit, Rest, Wait,
|
||||||
NotificationsFormObject, ProcessErrors, GetBasePath, Empty,
|
NotificationsFormObject, ProcessErrors, GetBasePath, Empty,
|
||||||
GenerateForm, SearchInit, PaginateInit, LookUpInit,
|
GenerateForm, SearchInit, PaginateInit, LookUpInit,
|
||||||
OrganizationList, $scope, $state, CreateSelect2, GetChoices,
|
OrganizationList, $scope, $state, CreateSelect2, GetChoices,
|
||||||
NotificationsTypeChange, ParseTypeChange
|
NotificationsTypeChange, ParseTypeChange, Alert
|
||||||
) {
|
) {
|
||||||
|
Rest.setUrl(GetBasePath('projects'));
|
||||||
|
Rest.options()
|
||||||
|
.success(function(data) {
|
||||||
|
if (!data.actions.POST) {
|
||||||
|
$state.go("^");
|
||||||
|
Alert('Permission Error', 'You do not have permission to add a notification template.', 'alert-info');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = NotificationsFormObject,
|
form = NotificationsFormObject,
|
||||||
url = GetBasePath('notification_templates');
|
url = GetBasePath('notification_templates');
|
||||||
|
|||||||
@@ -25,6 +25,16 @@ export default
|
|||||||
master = {},
|
master = {},
|
||||||
url = GetBasePath('notification_templates');
|
url = GetBasePath('notification_templates');
|
||||||
|
|
||||||
|
$scope.canEdit = false;
|
||||||
|
|
||||||
|
Rest.setUrl(GetBasePath('notification_templates') + id);
|
||||||
|
Rest.options()
|
||||||
|
.success(function(data) {
|
||||||
|
if (data.actions.PUT) {
|
||||||
|
$scope.canEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$scope.notification_template = notification_template;
|
$scope.notification_template = notification_template;
|
||||||
generator.inject(form, {
|
generator.inject(form, {
|
||||||
mode: 'edit' ,
|
mode: 'edit' ,
|
||||||
|
|||||||
@@ -24,6 +24,18 @@ export default
|
|||||||
scope: scope
|
scope: scope
|
||||||
});
|
});
|
||||||
|
|
||||||
|
scope.canAdd = false;
|
||||||
|
scope.canEdit = false;
|
||||||
|
|
||||||
|
Rest.setUrl(GetBasePath('notification_templates'));
|
||||||
|
Rest.options()
|
||||||
|
.success(function(data) {
|
||||||
|
if (data.actions.POST) {
|
||||||
|
scope.canAdd = true;
|
||||||
|
scope.canEdit = true;;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scope.removePostRefresh = scope.$on('PostRefresh', function () {
|
scope.removePostRefresh = scope.$on('PostRefresh', function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
if (scope.notification_templates) {
|
if (scope.notification_templates) {
|
||||||
|
|||||||
@@ -27,13 +27,15 @@ export default function() {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
capitalize: false
|
capitalize: false,
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false
|
editRequired: false,
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -44,7 +46,8 @@ export default function() {
|
|||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: "organizationrequired",
|
reqExpression: "organizationrequired",
|
||||||
init: "true"
|
init: "true"
|
||||||
}
|
},
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
notification_type: {
|
notification_type: {
|
||||||
label: 'Type',
|
label: 'Type',
|
||||||
@@ -54,13 +57,15 @@ export default function() {
|
|||||||
class: 'NotificationsForm-typeSelect',
|
class: 'NotificationsForm-typeSelect',
|
||||||
ngOptions: 'type.label for type in notification_type_options track by type.value',
|
ngOptions: 'type.label for type in notification_type_options track by type.value',
|
||||||
ngChange: 'typeChange()',
|
ngChange: 'typeChange()',
|
||||||
hasSubForm: true
|
hasSubForm: true,
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
label: 'Username',
|
label: 'Username',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
|
|
||||||
host: {
|
host: {
|
||||||
@@ -71,7 +76,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
sender: {
|
sender: {
|
||||||
label: 'Sender Email',
|
label: 'Sender Email',
|
||||||
@@ -81,7 +87,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
recipients: {
|
recipients: {
|
||||||
label: 'Recipient List',
|
label: 'Recipient List',
|
||||||
@@ -97,7 +104,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
labelBind: 'passwordLabel',
|
labelBind: 'passwordLabel',
|
||||||
@@ -108,7 +116,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
port: {
|
port: {
|
||||||
labelBind: 'portLabel',
|
labelBind: 'portLabel',
|
||||||
@@ -122,7 +131,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc'",
|
ngShow: "notification_type.value == 'email' || notification_type.value == 'irc'",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
channels: {
|
channels: {
|
||||||
label: 'Destination Channels',
|
label: 'Destination Channels',
|
||||||
@@ -138,7 +148,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'slack'",
|
ngShow: "notification_type.value == 'slack'",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
rooms: {
|
rooms: {
|
||||||
label: 'Destination Channels',
|
label: 'Destination Channels',
|
||||||
@@ -154,7 +165,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat'",
|
ngShow: "notification_type.value == 'hipchat'",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
token: {
|
token: {
|
||||||
labelBind: 'tokenLabel',
|
labelBind: 'tokenLabel',
|
||||||
@@ -165,7 +177,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'slack' || notification_type.value == 'pagerduty' || notification_type.value == 'hipchat'",
|
ngShow: "notification_type.value == 'slack' || notification_type.value == 'pagerduty' || notification_type.value == 'hipchat'",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
account_token: {
|
account_token: {
|
||||||
label: 'Account Token',
|
label: 'Account Token',
|
||||||
@@ -176,7 +189,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
from_number: {
|
from_number: {
|
||||||
label: 'Source Phone Number',
|
label: 'Source Phone Number',
|
||||||
@@ -188,7 +202,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
to_numbers: {
|
to_numbers: {
|
||||||
label: 'Destination SMS Number',
|
label: 'Destination SMS Number',
|
||||||
@@ -204,7 +219,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
account_sid: {
|
account_sid: {
|
||||||
label: 'Account SID',
|
label: 'Account SID',
|
||||||
@@ -214,7 +230,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'twilio' ",
|
ngShow: "notification_type.value == 'twilio' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
subdomain: {
|
subdomain: {
|
||||||
label: 'Pagerduty subdomain',
|
label: 'Pagerduty subdomain',
|
||||||
@@ -224,7 +241,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
service_key: {
|
service_key: {
|
||||||
label: 'API Service/Integration Key',
|
label: 'API Service/Integration Key',
|
||||||
@@ -234,7 +252,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
client_name: {
|
client_name: {
|
||||||
label: 'Client Identifier',
|
label: 'Client Identifier',
|
||||||
@@ -244,7 +263,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'pagerduty' ",
|
ngShow: "notification_type.value == 'pagerduty' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
message_from: {
|
message_from: {
|
||||||
label: 'Label to be shown with notification',
|
label: 'Label to be shown with notification',
|
||||||
@@ -254,7 +274,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
api_url: {
|
api_url: {
|
||||||
label: 'API URL',
|
label: 'API URL',
|
||||||
@@ -265,7 +286,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
label: 'Notification Color',
|
label: 'Notification Color',
|
||||||
@@ -277,13 +299,15 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
notify: {
|
notify: {
|
||||||
label: 'Notify Channel',
|
label: 'Notify Channel',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'hipchat' ",
|
ngShow: "notification_type.value == 'hipchat' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
label: 'Target URL',
|
label: 'Target URL',
|
||||||
@@ -293,7 +317,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'webhook' ",
|
ngShow: "notification_type.value == 'webhook' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
label: 'HTTP Headers',
|
label: 'HTTP Headers',
|
||||||
@@ -313,7 +338,8 @@ export default function() {
|
|||||||
'</pre></p>',
|
'</pre></p>',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
ngShow: "notification_type.value == 'webhook' ",
|
ngShow: "notification_type.value == 'webhook' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
label: 'IRC Server Address',
|
label: 'IRC Server Address',
|
||||||
@@ -323,7 +349,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
nickname: {
|
nickname: {
|
||||||
label: 'IRC Nick',
|
label: 'IRC Nick',
|
||||||
@@ -333,7 +360,8 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
targets: {
|
targets: {
|
||||||
label: 'Destination Channels or Users',
|
label: 'Destination Channels or Users',
|
||||||
@@ -349,13 +377,15 @@ export default function() {
|
|||||||
init: "false"
|
init: "false"
|
||||||
},
|
},
|
||||||
ngShow: "notification_type.value == 'irc' ",
|
ngShow: "notification_type.value == 'irc' ",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
use_ssl: {
|
use_ssl: {
|
||||||
label: 'SSL Connection',
|
label: 'SSL Connection',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'irc'",
|
ngShow: "notification_type.value == 'irc'",
|
||||||
subForm: 'typeSubForm'
|
subForm: 'typeSubForm',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: 'Options',
|
label: 'Options',
|
||||||
@@ -367,13 +397,15 @@ export default function() {
|
|||||||
label: 'Use TLS',
|
label: 'Use TLS',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'email' ",
|
ngShow: "notification_type.value == 'email' ",
|
||||||
labelClass: 'checkbox-options stack-inline'
|
labelClass: 'checkbox-options stack-inline',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
}, {
|
}, {
|
||||||
name: 'use_ssl',
|
name: 'use_ssl',
|
||||||
label: 'Use SSL',
|
label: 'Use SSL',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
ngShow: "notification_type.value == 'email'",
|
ngShow: "notification_type.value == 'email'",
|
||||||
labelClass: 'checkbox-options stack-inline'
|
labelClass: 'checkbox-options stack-inline',
|
||||||
|
ngDisabled: '!canEdit'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -381,9 +413,15 @@ export default function() {
|
|||||||
buttons: { //for now always generates <button> tags
|
buttons: { //for now always generates <button> tags
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
|
ngShow: 'canEdit'
|
||||||
|
},
|
||||||
|
close: {
|
||||||
|
ngClick: 'formCancel()',
|
||||||
|
ngShow: '!canEdit'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()',
|
||||||
|
ngShow: 'canEdit', //$scope.function to call on click, optional
|
||||||
ngDisabled: true //Disable when $pristine or $invalid, optional
|
ngDisabled: true //Disable when $pristine or $invalid, optional
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ export default function(){
|
|||||||
ngClick: 'addNotification()',
|
ngClick: 'addNotification()',
|
||||||
awToolTip: 'Create a new custom inventory',
|
awToolTip: 'Create a new custom inventory',
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: '+ ADD'
|
buttonContent: '+ ADD',
|
||||||
|
ngShow: 'canAdd'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -62,7 +63,8 @@ export default function(){
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
"class": 'btn-sm',
|
"class": 'btn-sm',
|
||||||
awToolTip: 'Test notification',
|
awToolTip: 'Test notification',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top',
|
||||||
|
ngShow: 'notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
edit: {
|
edit: {
|
||||||
ngClick: "editNotification(notification_template.id)",
|
ngClick: "editNotification(notification_template.id)",
|
||||||
@@ -70,7 +72,16 @@ export default function(){
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
"class": 'btn-sm',
|
"class": 'btn-sm',
|
||||||
awToolTip: 'Edit notification',
|
awToolTip: 'Edit notification',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top',
|
||||||
|
ngShow: 'notification_template.summary_fields.user_capabilities.edit'
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
ngClick: "editNotification(notification_template.id)",
|
||||||
|
label: 'View',
|
||||||
|
"class": 'btn-sm',
|
||||||
|
awToolTip: 'View notification',
|
||||||
|
dataPlacement: 'top',
|
||||||
|
ngShow: '!notification_template.summary_fields.user_capabilities.edit'
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
ngClick: "deleteNotification(notification_template.id, notification_template.name)",
|
ngClick: "deleteNotification(notification_template.id, notification_template.name)",
|
||||||
@@ -78,7 +89,8 @@ export default function(){
|
|||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
"class": 'btn-sm',
|
"class": 'btn-sm',
|
||||||
awToolTip: 'Delete notification',
|
awToolTip: 'Delete notification',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top',
|
||||||
|
ngShow: 'notification_template.summary_fields.user_capabilities.delete'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,19 @@ export default [
|
|||||||
}
|
}
|
||||||
$scope.removeParentLoaded = $scope.$on('ParentLoaded', function() {
|
$scope.removeParentLoaded = $scope.$on('ParentLoaded', function() {
|
||||||
url += "schedules/";
|
url += "schedules/";
|
||||||
|
|
||||||
|
$scope.canAdd = false;
|
||||||
|
$scope.canEdit = false;
|
||||||
|
|
||||||
|
Rest.setUrl(url);
|
||||||
|
Rest.options()
|
||||||
|
.success(function(data) {
|
||||||
|
if (data.actions.POST) {
|
||||||
|
$scope.canAdd = true;
|
||||||
|
$scope.canEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
schedList.well = true;
|
schedList.well = true;
|
||||||
|
|
||||||
// include name of item in listTitle
|
// include name of item in listTitle
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export default ['$compile', '$filter', '$state', '$stateParams', 'AddSchedule',
|
|||||||
'Rest', 'ParamPass',
|
'Rest', 'ParamPass',
|
||||||
function($compile, $filter, $state, $stateParams, AddSchedule, Wait, $scope,
|
function($compile, $filter, $state, $stateParams, AddSchedule, Wait, $scope,
|
||||||
$rootScope, CreateSelect2, ParseTypeChange, GetBasePath, Rest, ParamPass) {
|
$rootScope, CreateSelect2, ParseTypeChange, GetBasePath, Rest, ParamPass) {
|
||||||
|
|
||||||
$scope.processSchedulerEndDt = function(){
|
$scope.processSchedulerEndDt = function(){
|
||||||
// set the schedulerEndDt to be equal to schedulerStartDt + 1 day @ midnight
|
// set the schedulerEndDt to be equal to schedulerStartDt + 1 day @ midnight
|
||||||
var dt = new Date($scope.schedulerUTCTime);
|
var dt = new Date($scope.schedulerUTCTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user