diff options
Diffstat (limited to 'moon_gui/static/app/policy/action/mapping')
4 files changed, 0 insertions, 277 deletions
diff --git a/moon_gui/static/app/policy/action/mapping/policy-map.tpl.html b/moon_gui/static/app/policy/action/mapping/policy-map.tpl.html deleted file mode 100755 index 8b787f14..00000000 --- a/moon_gui/static/app/policy/action/mapping/policy-map.tpl.html +++ /dev/null @@ -1,64 +0,0 @@ -<div ng-controller="PolicyMapController as map" class="modal" tabindex="-1" data-role="modalMappingPolicy"> - - <div class="modal-dialog"> - - <div class="modal-content"> - - <div class="modal-header"> - <button type="button" class="close" ng-click="$hide()">×</button> - <h4 class="modal-title" data-translate="moon.policy.map.title" data-translate-values="{ pdpName: map.pdp.name}"></h4> - </div> - - <div class="modal-body"> - - <form class="form-horizontal" role="form" name="map.form"> - - <div class="form-group" ng-class="{'has-error': map.form.policy.$dirty && (map.form.policy.$invalid || !map.selectedPolicy)}"> - - <label class="col-sm-3 control-label" data-translate="moon.policy.map.form.list">List of Policies</label> - - <div class="col-sm-6"> - - <ui-select ng-model="map.selectedPolicy" name="policy" required> - <ui-select-match placeholder="(None)" ng-bind="$select.selected.name"></ui-select-match> - <ui-select-choices repeat="policy in map.policies"> - <div ng-bind="policy.name" ng-value="policy"></div> - </ui-select-choices> - </ui-select> - - <moon-loader ng-if="map.policiesLoading"></moon-loader> - - <div class="help-block" ng-show="map.form.policy.$dirty && (map.form.policy.$invalid || !map.selectedPolicy)"> - <small class="error" ng-show="map.form.policy.$error.required" data-translate="moon.policy.map.check.policy.required">Policy is required</small> - </div> - - </div> - - </div> - - </form> - - </div> - - <div class="modal-footer"> - <div class="btn-toolbar" style="float: right;"> - - <a href="" ng-click="$hide()" class="btn btn-default"> - <span data-translate="moon.policy.map.action.cancel">Cancel</span> - </a> - - <a href="" ng-disabled="map.mappingLoading" ng-click="map.map()" class="btn btn-warning"> - <span class="glyphicon glyphicon-link"></span> - <span data-translate="moon.policy.map.action.map">Map</span> - </a> - - <moon-loader ng-if="map.mappingLoading"></moon-loader> - - </div> - </div> - - </div> - - </div> - -</div> diff --git a/moon_gui/static/app/policy/action/mapping/policy-unmap.tpl.html b/moon_gui/static/app/policy/action/mapping/policy-unmap.tpl.html deleted file mode 100755 index a2cda52a..00000000 --- a/moon_gui/static/app/policy/action/mapping/policy-unmap.tpl.html +++ /dev/null @@ -1,33 +0,0 @@ -<div ng-controller="PolicyUnMapController as unmap" class="modal" tabindex="-1" data-role="modalUnmapPolicy"> - - <div class="modal-dialog"> - - <div class="modal-content"> - - <div class="modal-header"> - <button type="button" class="close" ng-click="$hide()">×</button> - <h4 class="modal-title" data-translate="moon.policy.unmap.title"></h4> - </div> - - <div class="modal-body"> - <span data-translate="moon.policy.unmap.content" data-translate-values="{ policyName: unmap.policy.name, pdpName: unmap.pdp.name }"></span> - </div> - - <div class="modal-footer"> - <div class="btn-toolbar" style="float: right;"> - <a href="" ng-click="$hide()" class="btn btn-default"> - <span data-translate="moon.policy.unmap.action.cancel">Cancel</span> - </a> - <a href="" ng-disabled="unmap.unMappingLoading" ng-click="unmap.unmap()" class="btn btn-warning"> - <span class="glyphicon glyphicon-transfer"></span> - <span data-translate="moon.policy.unmap.action.unmap">Unmap</span> - </a> - <moon-loader ng-if="unmap.unMappingLoading"></moon-loader> - </div> - </div> - - </div> - - </div> - -</div>
\ No newline at end of file diff --git a/moon_gui/static/app/policy/action/mapping/policy.controller.map.js b/moon_gui/static/app/policy/action/mapping/policy.controller.map.js deleted file mode 100755 index 6ad8caa7..00000000 --- a/moon_gui/static/app/policy/action/mapping/policy.controller.map.js +++ /dev/null @@ -1,106 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('moon') - .controller('PolicyMapController', PolicyMapController); - - PolicyMapController.$inject = ['$scope', 'alertService', '$translate', 'formService', 'policyService', 'pdpService', 'utilService']; - - function PolicyMapController($scope, alertService, $translate, formService, policyService, pdpService, utilService ) { - - var map = this; - - /* - * - */ - - map.pdps = []; - - map.pdp = $scope.pdp; - - map.addPolicyToList = false; - - map.map = mapToPdp; - - activate(); - - function activate() { - - resolvePolicies(); - - } - - function resolvePolicies() { - - map.policiesLoading = true; - - policyService.findAllWithCallback(function(policies){ - map.policies = policies; - map.policiesLoading = false; - } - ); - - } - - function mapToPdp() { - - if (formService.isInvalid(map.form)) { - - formService.checkFieldsValidity(map.form); - - } else { - - map.mappingLoading = true; - - var pdpToSend = angular.copy(map.pdp); - - pdpToSend.security_pipeline.push(map.selectedPolicy.id); - - pdpService.update(pdpToSend, mapSuccess, mapError); - - } - - function mapSuccess(data) { - - var pdpReceived = utilService.transformOne(data, 'pdps'); - - - $translate('moon.policy.map.success', {pdpName: pdpReceived.name, policyName: map.selectedPolicy.name}).then(function (translatedValue) { - - alertService.alertSuccess(translatedValue); - - }); - - map.mappingLoading = false; - - $scope.$emit('event:policyMapToPdpSuccess', pdpReceived); - - } - - function mapError(response) { - - $translate('moon.policy.map.error', { - - pdpName: map.pdp.name, - policyName: map.selectedPolicy.name - - }).then(function (translatedValue) { - - alertService.alertError(translatedValue); - - }); - - map.mappingLoading = false; - - $scope.$emit('event:policyMapToPdpError'); - - } - } - - - - } - -})();
\ No newline at end of file diff --git a/moon_gui/static/app/policy/action/mapping/policy.controller.unmap.js b/moon_gui/static/app/policy/action/mapping/policy.controller.unmap.js deleted file mode 100755 index d309ec0f..00000000 --- a/moon_gui/static/app/policy/action/mapping/policy.controller.unmap.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .controller('PolicyUnMapController', PolicyUnMapController); - - PolicyUnMapController.$inject = ['$scope', '$translate', 'alertService', 'pdpService', 'utilService']; - - function PolicyUnMapController($scope, $translate, alertService, pdpService, utilService) { - - var unmap = this; - - /* - * - */ - - unmap.pdp = $scope.pdp; - unmap.policy = $scope.policy; - - unmap.unMappingLoading = false; - - unmap.unmap = unMapPolicyToPdp; - - /* - * - */ - - function unMapPolicyToPdp() { - - unmap.unMappingLoading = true; - - var pdpToUpdate = angular.copy(unmap.pdp); - - pdpToUpdate.security_pipeline = _.without(pdpToUpdate.security_pipeline, unmap.policy.id); - - pdpService.update(pdpToUpdate, unMapSuccess, unMapError); - - function unMapSuccess(data) { - - $translate('moon.policy.unmap.success', { pdpName: unmap.pdp.name, policyName: unmap.policy.name }) - .then(function (translatedValue) { - alertService.alertSuccess(translatedValue); - }); - - unmap.unMappingLoading = false; - - $scope.$emit('event:policyUnMappedToPdpSuccess', utilService.transformOne(data, 'pdps')); - - } - - function unMapError(reason) { - - $translate('moon.policy.unmap.error', { pdpName: unmap.pdp.name, policyName: unmap.policy.name }) - .then(function (translatedValue) { - alertService.alertError(translatedValue); - }); - - unmap.unMappingLoading = false; - - $scope.$emit('event:policyUnMappedToPdpError'); - - } - - } - - } - -})(); |