2 ============LICENSE_START=======================================================
4 ================================================================================
5 Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
20 ===================================================================
28 background-color: #dddd;
32 background-color: #dddd;
42 vertical-align: middle;
52 background-color: #f2bfab;
63 background-color: #f5f5f5;
64 padding: 15px 5px 0 5px;
67 .form-group.clearfix {
68 display: -webkit-flex;
80 padding: 2px 2px 2px 30px;
91 border-bottom: 1px solid #ddd;
92 border-collapse: collapse;
102 #policyTable tr.highlight {
103 background-color: #f5f5f5;
116 <div attribute-test="policywindowproperties" id="configure-widgets"
117 class="disabled-block-container">
118 <div attribute-test="policywindowpropertiesh" class="modal-header">
119 <button type="button" class="close" ng-click="close(false)"
120 aria-hidden="true" style="margin-top: -3px">×</button>
121 <h4>Operational Policy</h4>
125 <div class="modal-body">
126 <div attribute-test="policywindowpropertiesb" class="modal-body row">
128 <div class="leftPolicyPanel">
129 <div class="panel panel-default">
130 <i class="glyphicon glyphicon-search modelSearchBox"></i> <input
131 type="text" id="policySearch" onkeyup="searchPolicyList()"
132 placeholder="Search ...">
133 <div id="policyTableHolder">
134 <table id="policyTable"></table>
137 <div style="float: left">
138 <button type="button" id="createNewPolicy" class="btn btn-sm">New
142 <div style="float: right">
143 <button type="button" id="deletePolicy"
144 class="btn btn-sm glyphicon glyphicon-trash" disabled></button>
147 <div id="repeatIdError" class="idError">Error: This Policy
148 name is already taken.</div>
149 <div id="newIdError" class="idError">Error: Please rename your
151 <div id="spaceError" class="idError">Error: Spaces are not
152 allowed in the ID.</div>
155 <div class="panel panel-default col-sm-9 policyPanel"
156 style="display: none;">
157 <form id="Timeoutform" class="form-horizontal">
159 <div class="form-group clearfix row">
160 <label class="col-sm-2">Name</label>
161 <div class="col-sm-3" style="padding: 0px;">
162 <input type="text" id="pname" name="pname" maxlength="48"
163 placeholder="Enter Unique Name" class="form-control">
166 <label class="col-sm-1">ID</label>
167 <div class="col-sm-1" style="padding: 0px;">
168 <input onkeydown="return false;" type="text" id="pid" name="pid"
169 class="form-control" readonly>
172 <label for="userID" class="col-sm-3"
173 style="padding-left: 5px; padding-right: 10px;">Overall
175 <div class="col-sm-2" style="padding-left: 0px;">
176 <input type="text" maxlength="10"
177 onkeypress="return isNumberKey(event)" class="form-control"
178 id="timeout" name="timeout">
183 <div class="panel-heading" style="background-color: white;">
184 <ul id="nav_Tabs" class="nav nav-tabs">
185 <li class><a id="add_one_more" href="#desc_tab"><span
186 class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></li>
189 <div class="panel-body">
190 <div class="tab-content">
191 <div id="properties_tab" class="tab-pane fade in active"></div>
196 <span id="formSpan" style="display: none">
197 <form class="saveProps" class="form-horizontal">
199 <div class="form-group clearfix">
200 <label class="col-sm-4 control-label" for="recipe">Recipe</label>
201 <div class="col-sm-8">
202 <select class="form-control" name="recipe" id="recipe"
203 enableFilter="true"></select>
206 <div class="form-group clearfix">
207 <label for="maxRetries" class="col-sm-4 control-label">
209 <div class="col-sm-8">
210 <input type="text" maxlength="5" class="form-control"
211 id="maxRetries" onkeypress="return isNumberKey(event)"
212 name="maxRetries"> </input>
215 <div class="form-group clearfix">
216 <label for="retryTimeLimit" class="col-sm-4 control-label">
217 Retry Time Limit</label>
218 <div class="col-sm-8">
219 <input type="text" maxlength="5" class="form-control"
220 id="retryTimeLimit" onkeypress="return isNumberKey(event)"
221 name="retryTimeLimit"></input>
224 <div style="display: none;" class="form-group clearfix">
225 <label for="_id" class="col-sm-4 control-label"> PolicyID</label>
226 <div class="col-sm-8">
227 <input type="text" onkeydown="return false;"
228 class="form-control" id="_id" name="_id" value=""></input>
231 <div class="form-group clearfix">
232 <label for="parentPolicy" class="col-sm-4 control-label">
233 Parent Policy</label>
234 <div class="col-sm-8">
235 <select class="form-control" id="parentPolicy"
236 name="parentPolicy" enableFilter="true"><option
237 value=""></option></select>
240 <div class="form-group clearfix">
241 <label for="parentPolicyConditions"
242 class="col-sm-4 control-label"> Parent Policy Conditions</label>
243 <div class="col-sm-8">
244 <select class="form-control" id="parentPolicyConditions"
245 name="parentPolicyConditions" multiple></select>
248 <div class="form-group clearfix">
250 <label for="actor" class="col-sm-4 control-label"> Actor</label>
251 <div class="col-sm-8">
252 <select class="form-control" id="actor" name="actor"></select>
255 <label for="payload" class="col-sm-4 control-label">
257 <div class="col-sm-8">
258 <textarea class="form-control" id="recipeInput" name=recipeInput></textarea>
261 <div class="form-group clearfix">
262 <label for="targetType" class="col-sm-4 control-label">
264 <div class="col-sm-8">
265 <select class="form-control" name="recipeLevel" id="recipeLevel">
269 <label for="targetResourceId" class="col-sm-4 control-label">
270 Target ResourceId</label>
271 <div class="col-sm-8">
272 <select class="form-control" name="targetResourceId"
273 id="targetResourceId" enableFilter="true"
274 onchange="changeTargetResourceIdOther();">
275 <option value=""></option>
276 <option value="Other:">Other:</option>
279 <input type="text" style="display: none" class="form-control"
280 id="targetResourceIdOther" name="targetResourceIdOther" value=""></input>
282 <div style="border: 2px dotted gray;">
283 <div class="form-group clearfix">
284 <label for="enableGuardPolicy" class="col-sm-4 control-label">
285 Enable Guard Policy</label>
286 <div class="col-sm-8">
287 <input type="checkbox" class="form-control"
288 name="enableGuardPolicy" id="enableGuardPolicy">
290 <div class="col-sm-8">
291 <label for="guardPolicyType" class="col-sm-4 control-label">
292 Guard Policy Type</label>
293 <select class="form-control"
294 name="guardPolicyType" id="guardPolicyType"
295 onchange="changeGuardPolicyType();">
296 <option value="MinMax">MinMax</option>
297 <option value="FrequencyLimiter">FrequencyLimiter</option>
300 <label for="guardTargets" class="col-sm-4 control-label">Guard
302 <div class="col-sm-8">
303 <input class="form-control" name="guardTargets"
308 <div class="form-group clearfix" id="minMaxGuardPolicyDiv">
309 <label for="minGuard" class="col-sm-4 control-label">
311 <div class="col-sm-8">
312 <input class="form-control" name="minGuard" id="minGuard" />
314 <label for="maxGuard" class="col-sm-4 control-label">
316 <div class="col-sm-8">
317 <input class="form-control" name="maxGuard" id="maxGuard" />
320 <div class="form-group clearfix"
321 id="frequencyLimiterGuardPolicyDiv" style="display: none">
322 <label for="limitGuard" class="col-sm-4 control-label">Limit</label>
323 <div class="col-sm-8">
324 <input class="form-control" name="limitGuard" id="limitGuard" />
326 <div class="col-sm-8">
327 <select class="form-control" name="timeUnitsGuard"
328 id="timeUnitsGuard" /> <label for="timeWindowGuard"
329 class="col-sm-4 control-label">Time Window</label>
331 <div class="col-sm-8">
332 <input class="form-control" name="timeWindowGuard"
333 id="timeWindowGuard" />
336 <div class="form-group clearfix">
337 <label for="guardActiveStart" class="col-sm-4 control-label">
338 Guard Active Start</label>
339 <div class="col-sm-8">
340 <input class="form-control" name="guardActiveStart"
341 id="guardActiveStart" />
343 <label for="guardActiveEnd" class="col-sm-4 control-label">
344 Guard Active End</label>
345 <div class="col-sm-8">
346 <input class="form-control" name="guardActiveEnd"
347 id="guardActiveEnd" />
357 <div attribute-test="policywindowpropertiesf" class="modal-footer">
358 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
359 <button id="savePropsBtn" class="btn btn-primary">Close</button>
360 <button ng-click="close(true)" id="close_button"
361 class="btn btn-primary">Cancel</button>
366 function initTargetResourceId() {
367 // Set all the Resource Invariant UUID in the target resource ID list (+Empty and other)
368 Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key){
369 $('#targetResourceId').append($('<option></option>').val(key).html(key));
373 function changeTargetResourceIdOther() {
374 if ($("#targetResourceId").val()==="Other:") {
375 $("#targetResourceIdOther").show();
377 $("#targetResourceIdOther").hide();
378 $("#targetResourceIdOther").val("");
382 function changeGuardPolicyType() {
383 console.log("executing GuardPolicyType")
384 console.log("GuardPolicyType value:"+$("#guardPolicyType").val())
385 if ($("#guardPolicyType").val()==="MinMax") {
386 console.log("executing GuardPolicyType")
387 $("#minMaxGuardPolicyDiv").show();
388 $("#frequencyLimiterGuardPolicyDiv").hide();
389 } else if ($("#guardPolicyType").val()==="FrequencyLimiter") {
390 console.log("executing GuardPolicyType")
391 $("#minMaxGuardPolicyDiv").hide();
392 $("#frequencyLimiterGuardPolicyDiv").show();
395 //Basically this method will add a new form. All forms share the same class. When you want one form to show(active form) the other forms get the
396 // css attribute display:none
397 $("#add_one_more").click(function(event) {
398 event.preventDefault();
399 var num = add_one_more();
402 loadPropertyWindow("policy")
404 // by default, parentPolicyConditions is disabled
405 //$("#parentPolicyConditions").prop('disabled', 'disabled');
412 //Grab saved values for dropdowns
413 var obj = elementMap[lastElementSelected];
415 if (!($.isEmptyObject(obj))){
416 allPolicies = jQuery.extend({}, obj);
417 for (var x in allPolicies){
418 $("#policyTable").prepend("<tr><td>"+x+"</td></tr>");
419 if (allPolicies[x][1]['value']){
420 allPolIds.push(parseInt(allPolicies[x][1]['value']));
426 //load recipes for a chosen policy
427 function disperseConfig(policyObj, id){
429 //remove old gui forms
430 for (var i=1; i<($(".formId").length + 1); i++){
431 $("#go_properties_tab"+i).parent().remove();
433 $(".formId").remove();
435 if (policyObj !== undefined) {
436 var el = policyObj[id][3]['policyConfigurations']
437 for (var i = 0; i < el.length; i++) {
439 var num = add_one_more();
441 for (var j = 0; j < el[i].length; j++) {
442 if(el[i][j].hasOwnProperty("name")){
443 $("#formId" + num + " #" + el[i][j].name).val(
445 if(el[i][j].name==="_id")
446 policy_ids["#formId" + num]=el[i][j].value
447 if(el[i][j].name==='parentPolicy')
448 parent_policy[num]=el[i][j].value
449 if(el[i][j].name==='recipe' && el[i][j].value.toString()!==''){
450 $("#go_properties_tab"+num).text(el[i][j].value)
452 if(el[i][j].name==="targetResourceIdOther" && el[i][j].value.toString()!=='') {
453 // Add the entry and set it
454 $('#targetResourceId').append($('<option></option>').val($('#targetResourceIdOther').val()).html($('#targetResourceIdOther').val()));
455 $('#targetResourceId').val($('#targetResourceIdOther').val());
462 //Adding all the ids for parent policy options
463 for(var i=1;i<=$(".formId").length;i++){
464 for(k in policy_ids){
465 if($("#formId"+i+" #_id").val()!==policy_ids[k].toString() && $(k+" #recipe").val()!==undefined && $(k+" #recipe").val()!==""){
466 $("#formId"+i+" #parentPolicy").append("<option value=\""+policy_ids[k]+"\">" +$(k+" #recipe").val()+"</option>");
471 for(k in parent_policy){
472 $("#formId"+k+" #parentPolicy").val(parent_policy[k]);
473 if($("#formId"+k+" #parentPolicy").val() ==""){
474 $("#formId" +k+ " #parentPolicyConditions").multiselect("disable");
476 $("#formId" +k+ " #parentPolicyConditions").multiselect("enable");
478 // force the change event
479 $("#formId"+k+" #parentPolicy").change();
482 // Now load all component with the right value defined in policyObj JSON
483 for (headInd in policyObj[id]){
484 if (!(policyObj[id][headInd].hasOwnProperty("policyConfigurations"))){
485 $("#" + policyObj[id][headInd].name).val(policyObj[id][headInd].value);
493 $('select[multiple] option').each(function() {
494 var input = $('input[value="' + $(this).val() + '"]');
495 input.prop('disabled', true);
496 input.parent('li').addClass('disabled');
498 $('input[value="multiselect-all"]').prop('disabled', true).parent('li').addClass('disabled');
500 changeGuardPolicyType();
503 function addSelectListen(count) {
504 var onSelectChange = function() {
505 var opselected = this.selectedOptions[0].text;
507 if (this.id == "recipe"){
509 var polCount = $(this).closest("[id^='formId']").attr("id").substring(6);
510 $(this).closest(".policyPanel").find("#go_properties_tab"+polCount).text(opselected);
512 $(this).closest("[id^='go_properties_tab']").text("Policy");
516 if (this.id=="parentPolicy"){
517 var ppCond = $(this).closest("[id^='formId']").find("#parentPolicyConditions");
519 ppCond.multiselect("clearSelection");
520 ppCond.multiselect("disable");
522 ppCond.multiselect("enable");
526 $("#formId"+count+" select").each( function () {
527 this.change = onSelectChange;
532 //This is ensure there are no repeated keys in the map
533 function noRepeats(form) {
534 //triggered per policy.
536 for (var i = 0; i < form.length; i++) {
537 if (select[form[i].name] === undefined)
538 select[form[i].name] = []
539 select[form[i].name].push(form[i].value);
551 $("#savePropsBtn").click(function(event) {
552 if($("#targetResourceIdOther").is(":visible")) {
553 $('#targetResourceId').append($('<option></option>').val($("#targetResourceIdOther").val()).html($("#targetResourceIdOther").val()))
554 $("#targetResourceId").val($("#targetResourceIdOther").val());
556 $(".idError").hide();
557 if ($("#policyTable .highlight td").html() !== $("#pname").val()){
559 if ($.inArray($("#pname").val(), Object.keys(allPolicies)) > -1){
560 $("#repeatIdError").show();
562 } else { //not repeated
563 delete allPolicies[$("#policyTable .highlight td").html()];
566 if ($("#pname").val().trim() == "New_Policy"){
567 $("#newIdError").show();
572 /* if ($("#policyTable .highlight").length > 0){
573 saveLastPolicyLocally($("#policyTable .highlight").attr("id"));
577 //Removes outdated (deleted) policies by checking against left menu
578 var finalSaveList = {};
579 $("#policyTable td").each(function(){
580 var tableVal = $(this).text();
581 if (tableVal in allPolicies){
582 finalSaveList[tableVal] = allPolicies[tableVal];
586 saveProperties(finalSaveList);
587 $("#close_button").click();
590 function add_one_more() {
591 $("#nav_Tabs li").removeClass("active");
593 //FormSpan contains a block of the form that is not being displayed. We will create clones of that and add them to tabs
594 var form = $($("#formSpan").children()[0]).clone()
596 //Each new tab will have the formId class attached to it. This way we can track how many forms we currently have out there and assign listeners to them
597 if ($(".formId").length > 0) {
599 var s = $(".formId");
600 for (var i = 0; i < s.length; i++) {
601 if (parseInt($(s[i]).attr("id").substring(6)) > greatest) {
602 greatest = parseInt($(s[i]).attr("id").substring(6))
605 count = greatest + 1;
606 $("#properties_tab").append(
607 ('<span class="formId" id="formId'+count+'"></span>'));
610 $("#properties_tab").append(
611 '<span class="formId" id="formId1"></span>');
614 //$(form).find("#policyName").val("Recipe "+makid(2))
615 //TODO change up how we auto assign policyName. There could be the case where we do this and it will have repeats
616 //alert($(form).find("#_id").val())
617 //policyNameChangeListener(form)
621 ' <li class="active"><a id="go_properties_tab'+count+'">Policy</a><button id="tab_close'+count+'" type="button" class="close tab-close-popup" aria-hidden="true" style="margin-top: -30px;margin-right: 5px">×</button></li>');
622 $("#formId" + count).append(form);
623 $(".formId").not($("#formId" + count)).css("display", "none")
626 addSelectListen(count);
627 // This is for when the process is not loading from map but being created
630 $(form).find("#_id").val(l)
631 policy_ids["#formId" + count]=l
634 for(var i=1;i<=greatestIdNum();i++){
635 if($("#formId"+i).length>0){
636 answers["#formId"+i+" #parentPolicy"]=$("#formId"+i+" #parentPolicy").val();
637 $("#formId"+i+" #parentPolicy").empty();
639 for(k in policy_ids){
640 if(($("#formId"+i+" #_id").val()!==policy_ids[k].toString()) && $(k+" #recipe").val()!==undefined && $(k+" #recipe").val()!==""){
641 $("#formId"+i+" #parentPolicy").append("<option value='"+policy_ids[k]+"'>"+$(k+" #recipe").val()+"</option>")
644 $("#formId"+i+" #parentPolicy").prepend("<option value=''></option>")
648 $("#formId"+count+" #parentPolicyConditions").multiselect("disable");
650 //re-populate parent policy with chosen options
659 function add_new_policy(issueNewNames) {
660 //remove old gui forms
661 for (var i=1; i<($(".formId").length + 1); i++){
662 $("#go_properties_tab"+i).parent().remove();
664 $(".formId").remove();
667 //$("#pname").val("0");
668 $("#pname").val("New_Policy");
669 $("#timeout").val(defaults_props.policy.timeout);
671 $("#add_one_more").click();
674 function addCustListen(count) {
675 $('#go_properties_tab' + count).click(function(event) {
676 $("#nav_Tabs li").removeClass("active");
677 $(this).parent().addClass("active");
678 $("#formId" + count).css("display", "")
679 $(".formId").not($("#formId" + count)).css("display", "none")
682 $('#tab_close' + count).click(function(event) {
683 if(document.getElementById("timeout").disabled){
686 $(this).parent().remove();
687 for(var i=1;i<=greatestIdNum();i++){
688 if( $("#formId"+i).length>0){
690 if( $("#formId"+i+" #parentPolicy").val()===$("#formId"+count+" #_id").val().toString())
691 $("#formId"+i+" #parentPolicy").val("")
692 $("#formId"+i+" #parentPolicy option[value='"+$("#formId"+count+" #_id").val().toString()+"']").remove();
696 delete policy_ids["#formId" + count + " #_id"]
697 $("#formId" + count).remove();
702 function greatestIdNum() {
704 var s = $(".formId");
705 for (var i = 0; i < s.length; i++) {
706 if (parseInt($(s[i]).attr("id").substring(6)) > greatest) {
707 greatest = parseInt($(s[i]).attr("id").substring(6))
713 //Generate random id for each policy
714 //Also made sure ids couldnt be repeated
715 function makeid(num) {
718 var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
721 for (var i = 0; i < 7; i++)
722 text += possible.charAt(Math.floor(Math.random()
724 var hasValue = false;
725 for (k in policy_ids) {
726 if (text === policy_ids[k])
735 var ParentPolicy = function(id, name) {
740 //Policy table search filter
741 function searchPolicyList() {
742 var search = document.getElementById("policySearch");
743 var row = document.getElementsByTagName("td");
744 for (var i = 0; i < row.length; i++) {
745 if (row[i].innerHTML.toUpperCase().indexOf(
746 search.value.toUpperCase()) > -1) {
747 row[i].style.display = "";
749 row[i].style.display = "none";
754 function saveLastPolicyLocally(lastPolicyId) {
757 var properties = $(".saveProps").not("#formSpan .saveProps");
758 var timeoutForm = $("#Timeoutform").serializeArray();
760 for (var i = 0; i < timeoutForm.length; i++) {
761 polForm.push(timeoutForm[i]);
765 d["policyConfigurations"] = [];
766 for (var i = 0; i < properties.length; i++) {
767 var ser = $(properties[i]).serializeArray();
768 var s = noRepeats(ser)
769 d["policyConfigurations"].push(s);
772 allPolicies[lastPolicyId] = polForm;
775 function getNextId(){
778 if ((Math.min.apply(Math, allPolIds) == 0)
779 && (allPolIds.length > 0)) {
781 for (var i = 1; i < allPolIds.length; i++) {
782 if ((allPolIds[i] - allPolIds[i - 1]) != 1) {
783 newPolId = (allPolIds[i - 1] + 1);
788 newPolId = (Math.max.apply(Math, allPolIds)) + 1;
793 allPolIds.push(newPolId);
794 $("#pid").val(newPolId);
797 $("#deletePolicy").on('click', function() {
798 $(".idError").hide();
800 allPolIds.splice((allPolIds.indexOf(parseInt($("#pid").val()))),1);
803 var deleteId = $("#policyTable .highlight td").html();
804 delete allPolicies[deleteId];
805 $("#policyTable .highlight").remove();
810 $('#policyTable').on('click', 'tr', function(event) {
811 $(".idError").hide();
813 if ($("#policyTable .highlight td").html() !== $("#pname").val()){
815 if ($.inArray($("#pname").val(), Object.keys(allPolicies)) > -1){
816 $("#repeatIdError").show();
818 } else { //not repeated
819 $("#repeatIdError").hide();
820 delete allPolicies[$("#policyTable .highlight td").html()];
823 //if (parseInt($("#pname").val()) == 0){
824 if ($("#pname").val().trim() == "New_Policy"){
825 $("#newIdError").show();
831 if ($("#policyTable .highlight").length == 0){
835 $(this).addClass('highlight').siblings().removeClass('highlight');
836 disperseConfig(allPolicies, $(this).find("td").html());
839 $('#createNewPolicy').on('click', function(){
840 $(".idError").hide();
842 if ($("#policyTable .highlight td").html() !== $("#pname").val()){
844 if ($.inArray($("#pname").val(), Object.keys(allPolicies)) > -1){
845 $("#repeatIdError").show();
847 } else { //not repeated
848 $("#repeatIdError").hide();
849 delete allPolicies[$("#policyTable .highlight td").html()];
852 //if (parseInt($("#pname").val()) == 0){
853 if ($("#pname").val().trim() == "New_Policy"){
854 $("#newIdError").show();
859 if (("#policyTable .highlight").length > 0){
860 $('#policyTable tr.highlight').removeClass('highlight');
862 $("#policyTable").prepend("<tr class='highlight'><td>New_Policy</td></tr>");
867 $('#pname').on('keypress', function(e){
868 /* var newVal = $(this).val() + String.fromCharCode(e.which);
869 if ((newVal>99) || (($(this).val().length>2) && e.keyCode != 46 && e.keyCode !=8)){
872 if (e.keyCode == 32){
873 $("#spaceError").show();
878 function isNumberKey(event){
879 var charCode = (event.which) ? event.which : event.keyCode
880 if (charCode > 31 && (charCode < 48 || charCode > 57)){
886 function startNextItem() {
887 //save last item before transitioning
888 var lastItem = $("#policyTable .highlight");
889 if (lastItem.length > 0) {
890 saveLastPolicyLocally($("#pname").val());
891 //lastItem.attr("id", $("#pname").val());
892 lastItem.find("td").html($("#pname").val());
898 if ($("#deletePolicy").prop("disabled")) {
899 $("#deletePolicy").prop("disabled", false);
904 initTargetResourceId();
906 //load metrics dropdown
907 if (elementMap["global"]){
908 for (var i = 0; i < (elementMap["global"].length); i++){
909 if ((elementMap["global"][i]["name"]) == "actionSet"){
910 var asSel = elementMap["global"][i]["value"];
911 if (asSel == "vnfRecipe"){
912 if (vf_Services["policy"][asSel]){
913 $.each((vf_Services["policy"][asSel]), function(val, text) {
915 $('<option></option>').val(val).html(text)
924 //Show table panel only
925 function expandTable() {
926 $(".policyPanel").css("display", "none");
927 $(".leftPolicyPanel").removeClass("col-sm-3");
928 $(".modelSearchBox").css("padding", "25px 12px");
929 if (!($("#deletePolicy").prop("disabled"))) {
930 $("#deletePolicy").prop("disabled", true);
935 function collapseTable() {
936 $(".leftPolicyPanel").addClass("col-sm-3");
937 $(".modelSearchBox").css("padding", "10px 12px");
938 $(".policyPanel").css("display", "unset");