2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 var mainDictionarys = ["Action Policy", "BRMS Policy", "Common Dictionary", "ClosedLoop Policy","Decision Policy", "Descriptive Policy",
22 "Firewall Policy", "MicroService Policy", "Policy Scope", "Safe Policy Dictionary"];
23 var subDictionarys = [["Action Dictionary"],
24 ["BRMS Controller" , "BRMS Dependency", "BRMS Param Template"],
25 ["Attribute Dictionary","OnapName Dictionary"],
26 ["PEP Options","Site Dictionary","Service Dictionary","Varbind Dictionary", "VNF Type","VSCL Action"],
27 ["Settings Dictionary","Rainy Day Allowed Treatments"],
28 ["Descriptive Scope"],
29 ["Action List", "Address Group", "Parent Dictionary List", "Port List", "Prefix List", "Protocol List", "Security Zone", "Service Group", "Service List", "Tag List", "Tag Picker List", "Term List", "Zone"],
30 ["DCAE UUID","MicroService ConfigName","MicroService Location", "MicroService Models", "MicroService Dictionary"],
31 ["Closed Loop", "Group Policy Scope", "Resource", "Service", "Type"],
32 ["Risk Type", "Safe Policy Warning"]];
33 app.controller('dictionaryTabController', function ($scope, PolicyAppService, modalService, $modal){
34 $( "#dialog" ).hide();
36 $scope.isDisabled = true;
37 PolicyAppService.getData('get_LockDownData').then(function(data){
39 $scope.data = JSON.parse(j.data);
40 $scope.lockdowndata = JSON.parse($scope.data.lockdowndata);
41 if($scope.lockdowndata[0].lockdown == true){
42 $scope.isDisabled = true;
43 this.isDisabled = true;
45 $scope.isDisabled = false;
46 this.isDisabled = false;
48 console.log($scope.data);
50 console.log("failed");
53 $scope.options1 = mainDictionarys;
55 $scope.getOptions2 = function(){
56 var key = $scope.options1.indexOf($scope.option1);
57 var myNewOptions = subDictionarys[key];
58 $scope.options2 = myNewOptions;
61 $scope.import = function() {
63 var modalInstance = $modal.open({
64 backdrop: 'static', keyboard: false,
65 templateUrl : 'import_dictionary_popup.html',
66 controller: 'importDictionaryController',
68 message: function () {
76 modalInstance.result.then(function(response){
77 console.log('response', response);