2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 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", "Optimization 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","Header Default Values","MicroService ConfigName","MicroService Location", "MicroService Models", "MicroService Dictionary","MicroService Dictionary Input"],
31 ["ONAP Optimization Models"],
32 ["Closed Loop", "Group Policy Scope", "Resource", "Service", "Type"],
33 ["Risk Type", "Safe Policy Warning"]];
34 app.controller('dictionaryTabController', function ($scope, PolicyAppService, modalService, $modal){
35 $( "#dialog" ).hide();
37 $scope.isDisabled = true;
38 PolicyAppService.getData('get_LockDownData').then(function(data){
40 $scope.data = JSON.parse(j.data);
41 $scope.lockdowndata = JSON.parse($scope.data.lockdowndata);
42 if($scope.lockdowndata[0].lockdown == true){
43 $scope.isDisabled = true;
44 this.isDisabled = true;
46 $scope.isDisabled = false;
47 this.isDisabled = false;
49 console.log($scope.data);
51 console.log("failed");
54 $scope.options1 = mainDictionarys;
56 $scope.getOptions2 = function(){
57 var key = $scope.options1.indexOf($scope.option1);
58 var myNewOptions = subDictionarys[key];
59 $scope.options2 = myNewOptions;
62 $scope.import = function() {
64 var modalInstance = $modal.open({
65 backdrop: 'static', keyboard: false,
66 templateUrl : 'import_dictionary_popup.html',
67 controller: 'importDictionaryController',
69 message: function () {
77 modalInstance.result.then(function(response){
78 console.log('response', response);