7305fd91a9d790de747bba4c5b9b6b6122da22a3
[clamp.git] / src / main / resources / META-INF / resources / designer / partials / portfolios / tca_properties.html
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP CLAMP
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property. All rights
6                               reserved.
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
11   
12   http://www.apache.org/licenses/LICENSE-2.0
13   
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   ===================================================================
21   ECOMP is a trademark and service mark of AT&T Intellectual Property.
22   -->
23
24 <style>
25 #createNewThresh{
26         height:34px;
27         width:120px; /*84*/
28         background-color:#f2bfab;
29 }
30
31 #deleteThresh{
32         height:34px;
33         background-color:#dddd;
34 }
35
36 .fileUpload {
37         position: relative;
38         overflow: hidden;
39         margin: 10px;
40 }
41
42 .fileUpload input.upload {
43         position: absolute;
44         top: 0;
45         right: 0;
46         margin: 0;
47         padding: 0;
48         font-size: 20px;
49         cursor: pointer;
50         opacity: 0;
51         filter: alpha(opacity = 0);
52         float: left;
53 }
54
55 .fileDisplay {
56         display: inline-block;
57         overflow: hidden;
58         float: right;
59         margin-left: 0px;
60         z-index: initial;
61         text-align: center;
62         margin-top: 17px;
63 }
64
65 .form-group {
66         margin-bottom:15px;
67         display:-webkit-flex; 
68         display: flex; 
69         align-items: center;
70 }
71
72 #tcaEditHolder{
73         height:260px; 
74         background-color: #f5f5f5; 
75         padding:10px 0px; 
76         margin: 15px 15px 0 0; 
77         float: right;
78 }
79 .tcaErr{
80         display:none; 
81         text-align:center; 
82         margin-bottom:20px; 
83         color:red;"
84 }
85
86 .tcaParentItems {
87         padding-left: 20px;
88 }
89
90 .tcaParentItems label{
91         margin-bottom: 0px;
92 }
93
94 #tcaTable{
95         cursor: pointer;
96         width:100%;
97 }
98
99 #tcaTable tr{
100         border-bottom: 1px solid #ddd;
101         border-collapse: collapse;
102         text-align: center;
103         font-size: 12px;
104         font-weight: normal;
105 }
106
107 #tcaTable td{
108         padding: 8px 10px;
109 }
110
111 #tcaTable tr.highlight{
112         background-color: #f5f5f5;
113         font-weight: bold;
114         font-size: 13px;
115 }
116
117 #tcaTableHolder{
118         height:160px; 
119         width: 100%; 
120         overflow:auto;
121 }
122
123 </style>
124
125 <script type="text/javascript">
126         function disablefile() {
127
128                 document.getElementById("fileUpload").disabled = true;
129
130         }
131
132         function disableSVN() {
133                 var selectLength =  document.querySelectorAll(".disabled-block-container .tab-close-popup");
134                 if(selectLength && selectLength.length>0){
135                         for(var i = 0; i< selectLength.length ; i++){
136                                 selectLength[i].disabled = true;
137                         }       
138                 }
139         
140                 document.getElementById("schemaLocation").disabled = true;
141                 document.getElementById("userID").disabled = true;
142                 document.getElementById("password").disabled = true;
143
144         }
145 </script>
146
147
148 <div id="configure-widgets" class="disabled-block-container">
149         <div class="modal-header">
150                 <button type="button" class="close" ng-click="close(false)"
151                         aria-hidden="true" style="margin-top: -3px">&times;</button>
152                 <h4>TCA Micro Services</h4>
153         </div>
154         <div class="modal-body">
155                 <div style="height: 10px"></div>
156                 <div class="panel panel-default" id="panelHolder">
157                         
158                         <div class="panel-heading">
159                                 <ul id="nav_Tabs" class="nav nav-tabs">
160                                         <li class><a id="add_one_more" href="#desc_tab"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></li>
161                                 </ul>
162                         </div>
163                         
164                         <span id="formSpan" style="display:none;">
165                         <div class="panel-body">
166                         
167                                 <form class="tcaParentItems">
168                                         <div class="row">
169                                                 <div class="col-sm-8 form-group">
170                                                         <label class="col-sm-3"> Name </label>
171                                                         <div class="col-sm-9" style="padding:0px;">
172                                                                 <input class="form-control" type="text" maxlength="48" id="tname" name="tname"></input>
173                                                         </div>
174                                                 </div>
175                                                 
176                                                 <div class="col-sm-8 form-group" style="display:none;">
177                                                         <label class="col-sm-3"> UUID </label>
178                                                         <div class="col-sm-9" style="padding:0px;">
179                                                                 <input class="form-control" onkeydown="return false;" type="text" id="tuuid" name="tuuid"></input>
180                                                         </div>
181                                                 </div>
182                                                 
183                                                 <div class="col-sm-8 form-group" style="display:none;">
184                                                         <label class="col-sm-3"> NF Code </label>
185                                                         <div class="col-sm-9" style="padding:0px;">
186                                                                 <input class="form-control" onkeydown="return false;" type="text" id="tnfc" name="tnfc"></input>
187                                                         </div>
188                                                 </div>
189                                                 
190                                                 <div class="col-sm-3 form-group"> 
191                                                         <label class="col-sm-8"> Enable </label>
192                                                         <input class="col-sm-4" type="checkbox" style="height:21px; 
193                                                                 width:21px; margin:6px;" checked="checked" id="tcaEnab" name="tcaEnab"></input>
194                                                 </div>
195                                         </div>
196                                         <div class="row">
197                                                 <div class="col-sm-8 form-group">
198                                                         <label class="col-sm-3"> Policy </label>
199                                                         <div class="col-sm-9" style="padding:0px;">
200                                                                 <select name="tcaPol" id="tcaPol" enableFilter="true"></select>
201                                                         </div>
202                                                 </div>
203                                                 
204                                                 <div class="col-sm-8 form-group" style="display:none;">
205                                                         <label class="col-sm-3"> Policy ID </label>
206                                                         <div class="col-sm-9" style="padding:0px;">
207                                                                 <input class="form-control" onkeydown="return false;" type="text" id="tcaPolId" name="tcaPolId"></input>
208                                                         </div>
209                                                 </div>
210                                                 
211                                                 <div class="col-sm-3 form-group"> 
212                                                         <label class="col-sm-8">Max Intervals</label>
213                                                         <input class="col-sm-4 form-control" style="width:80%" type="text" maxlength="3" 
214                                                         id="tcaInt" onkeypress="return isNumberKey(event)" name="tcaInt"></input>
215                                                 </div>
216                                         </div>
217                                         <div class="row">
218                                                 <div class="col-sm-8 form-group">
219                                                         <label class="col-sm-3"> Severity </label>
220                                                         <div class="col-sm-9" style="padding:0px;">
221                                                                 <select name="tcaSev" id="tcaSev" enableFilter="false">
222                                                                 </select>
223                                                         </div>
224                                                 </div>
225                                                 
226                                                 <div class="col-sm-3 form-group"> 
227                                                         <label class="col-sm-8">Min Violations</label>
228                                                         <input class="col-sm-4 form-control" style="width:80%" type="text" maxlength="3" 
229                                                         id="tcaVio" onkeypress="return isNumberKey(event)" name="tcaVio"></input>
230                                                 </div>
231                                         </div>
232                                 </form>
233                                 
234                                 <div class="tcaBody row">
235                                         <div class="col-sm-5" style="padding:0px 5px; margin: 15px;">
236                                                 <div class="panel panel-default" id="tcaTableHolder">
237                                                         <table id="tcaTable">
238                                                         </table>
239                                                 </div>
240                                                 <div id="tcaError" class="tcaErr">Error: Please define/delete this new threshold</div>
241                                                 <div id="tcaUnique" class="tcaErr">Error: Duplicate Set Name Found</div>
242                                                 <div style="float:left">
243                                                         <button type="button" id="createNewThresh" class="btn btn-sm">New Threshold</button>
244                                                 </div>
245                                                 <div style="float:right">
246                                                         <button type="button" id="deleteThresh" class="btn btn-sm glyphicon glyphicon-trash" disabled></button>
247                                                 </div>
248                                                 
249                                         </div>
250                                         
251                                         <div id="tcaEditHolder" class="panel panel-default col-sm-6">
252                                                 <div class="tab-content">
253                                                         <div id="properties_tab" style="padding:10px;" class="form-horizontal">
254                                                                 <div style="margin-bottom:20px;">
255                                                                         <label class="control-label">Metric</label>
256                                                                         <div>
257                                                                                 <select id="fieldPathM" name="fieldPathM"></select>
258                                                                         </div>
259                                                                 </div>
260                                                                 <div style="margin-bottom:20px;">
261                                                                         <label class="control-label">Operator</label>
262                                                                         <div>
263                                                                                 <select id="operator" name="operator"></select>
264                                                                         </div>
265                                                                 </div>
266                                                                 <div style="margin-bottom:20px;">
267                                                                         <label class="control-label">Threshold</label>
268                                                                         <div>
269                                                                                 <input type="text" maxlength="10" class="form-control" name="threshold" 
270                                                                                 onkeypress="return isNumberKey(event)" id="threshold"></input>
271                                                                         </div>
272                                                                 </div>
273                                                         </div>
274                                                 </div>
275                                         </div>
276                                 </div>
277                                 
278                         </div>          
279                         </span>
280                                 
281                 </div>
282         </div>
283 </div>
284
285         <div class="modal-footer">
286                 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
287                 <button id="savePropsBtn" class="btn btn-primary">Close</button>
288                 <button ng-click="close(true)" id="close_button"
289                         class="btn btn-primary">Cancel</button>
290         </div>
291         
292         <script>
293                 var generateTUUID = function(count){
294                         var d = new Date().getTime();
295                         var tuuid = 'xxxxxxxx-xxxx-txxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function(c){
296                                 var r = (d + Math.random()*16)%16 | 0;
297                                 d = Math.floor(d/16);
298                                 return (c == 'x' ? r : (r*0x3|0*8)).toString(16);
299                         });
300                         $("#formId" + count + " #tuuid").val(tuuid);
301                 }
302                 
303                 $("#add_one_more").click(function(event) {
304                         event.preventDefault();
305                         if ($("#nav_Tabs li.active").length>0){
306                                 var oldCount = $("#nav_Tabs li.active").find("a").attr("id").slice(-1);
307                                 if (($('#formId'+oldCount+' #tcaTable .highlight').length > 0 ) &&
308                                                 (!($('#formId'+oldCount+' #threshold').val()) || !($('#formId'+oldCount+' #fieldPathM').val())) ) {
309                                         $('#formId'+oldCount+' #tcaError').show();
310                                         return;
311                                 } else {
312                                         $('#formId'+oldCount+' .tcaErr').hide();
313                                         if ($('#formId'+oldCount+' #tcaTable .highlight').length > 0){
314                                                 $('#formId'+oldCount+' #tcaTable .highlight td').text(
315                                                                 $('#formId'+oldCount+' #fieldPathM').val() + ' ' +
316                                                                 $('#formId'+oldCount+' #operator').val() + ' ' +
317                                                                 $('#formId'+oldCount+' #threshold').val());
318                                         }
319                                         $("#formId"+oldCount+" #tcaTable .highlight").removeClass("highlight")
320                                 }
321                         }
322                         var count = add_one_more();     
323                         generateTUUID(count);
324                 })
325                 loadPropertyWindow("tca");
326                 
327                 //load dropdown with policy options
328                 if (typeof allPolicies !== "undefined"){
329                 $.each(Object.keys(allPolicies), function(val, text) {
330                         $('#tcaPol').append($('<option></option>').val(text).html(text));
331                 });  
332                 } else if (typeof elementMap !== "undefined"){
333                         for (key in elementMap){
334                                 if (key.indexOf("Policy")>-1){
335                                         $.each(Object.keys(elementMap[key]), function(val, text){
336                                                 $('#tcaPol').append(
337                                                         $('<option></option>').val(text).html(text)
338                                                 );
339                                         });
340                                 }
341                         }
342                 }
343                 
344                 setASDCFields();
345                 
346                 //load metrics dropdown
347                 if (elementMap["global"]){
348                         for (var i = 0; i < (elementMap["global"].length); i++){
349                                 if ((elementMap["global"][i]["name"]) == "vf"){
350                                         var vfSel = elementMap["global"][i]["value"];   
351                                         if (vf_Services["shared"]["byVf"][vfSel]["kpi"]){
352                                                 $.each((vf_Services["shared"]["byVf"][vfSel]["kpi"]), function(val, text) {
353                                         $('#fieldPathM').append(
354                                             $('<option></option>').val(val).html(text)
355                                         );
356                                     });
357                                         }
358                                         break;
359                                 };
360                         };
361                 };
362                 
363                 var arr = elementMap[lastElementSelected];
364                 
365                 if (arr !== undefined) {
366                         for (var x in arr){
367                                 var num = add_one_more();
368                                 var setCheck = true;
369                                 for (var i=0; i< arr[x].length; i++){
370                                         if (arr[x][i].name=='tcaEnab'){
371                                                 $("#formId" + num + " #tcaEnab").prop("checked","true");
372                                                 setCheck = false;
373                                         }
374                                         
375                                         if (arr[x][i].hasOwnProperty('serviceConfigurations')){
376                                                 for (var j=0; j<arr[x][i]["serviceConfigurations"].length; j++){
377                                                         $("#formId" + num + " #tcaTable").prepend("<tr><td>"
378                                                                         +arr[x][i]["serviceConfigurations"][j][0]+" "
379                                                                         //+(defaults_props['tca']['operator']).getKey(arr[x][i]["serviceConfigurations"][j][1])+" "
380                                                                         +(Object.keys(defaults_props['tca']['operator']).find(key => defaults_props['tca']['operator'][key] == (arr[x][i]["serviceConfigurations"][j][1])))+ " " 
381                                                                         +arr[x][i]["serviceConfigurations"][j][2]+"</td></tr>");
382                                                 }
383                                         } else {
384                                                 $("#formId" + num + " #"+arr[x][i].name).val(arr[x][i].value);
385                                         }
386                                 }
387                                 if (setCheck){
388                                         $("#formId" + num + " #tcaEnab").prop("checked",false);
389                                 }
390                                 $('#go_properties_tab'+num).text($('#formId' +num+ ' #tname').val());
391                                 $("#formId"+num + " #properties_tab").hide();
392                         }
393                 } 
394         
395                 $("#savePropsBtn").click(function(event) {
396                         var num = $('#nav_Tabs .active a').attr('id').slice(-1);
397                         var tabs = [];
398                         $('#nav_Tabs li:not(:last)').each(function(){
399                                 tabs.push($(this).text());
400                         });
401                         var nonunique = uniquet(tabs);
402                         if (($('#formId'+num+' #tcaTable .highlight').length > 0 ) &&
403                                         (!($('#formId'+num+' #threshold').val()) || !($('#formId'+num+' #fieldPathM').val())) ) {
404                                 $('#formId'+num+' #tcaError').show();
405                                 return;
406                         } else if (nonunique){
407                                 $('#formId'+num+' #tcaUnique').show();
408                                 return;
409                         } else {
410                                 $('#formId'+num+' .tcaErr').hide();
411                                 if ($('#formId'+num+' #tcaTable .highlight').length > 0){
412                                         $('#formId'+num+' #tcaTable .highlight td').text(
413                                                         $('#formId'+num+' #fieldPathM').val() + ' ' +
414                                                         $('#formId'+num+' #operator').val() + ' ' +
415                                                         $('#formId'+num+' #threshold').val());
416                                 }
417                                 var saveP = {};
418                                 $('.formId').each(function(){
419                                         var count = $(this).attr('id').slice(-1);
420                                         var header = $(this).find('.tcaParentItems').serializeArray();
421                                         var sconf = {};
422                                         var sconfa = [];
423                                         var checkNF = true;
424                                         $('#formId' +count+' #tcaTable tr').each(function(){
425                                                 $('td', this).each(function(){
426                                                         var splitTd = $(this).text().split(' ');
427                                                         splitTd[1]=defaults_props['tca']['operator'][splitTd[1]];
428                                                         var checkByKpi = vf_Services["shared"]["byKpi"][splitTd[0].replace(/\s/g, "")];
429                                                         if (checkByKpi["fieldPath"]){
430                                                                 splitTd.push(Object.keys(vf_Services["shared"]["byKpi"][splitTd[0].replace(/\s/g, "")]["fieldPath"])[0]);
431                                                         };
432                                                         if ((checkByKpi["nfNamingCode"]) && (checkNF)){
433                                                                 $.grep(header, function(e,i){ 
434                                                                         if (e.name == "tnfc"){
435                                                                                 header[i]["value"] = (Object.keys(checkByKpi["nfNamingCode"])[0]);
436                                                                         }
437                                                                 });
438                                                                 checkNF = false;
439                                                         }
440                                                         sconfa.push(splitTd);
441                                                 });
442                                                 
443                                         });
444                                         var polSel = $(this).find('.tcaParentItems #tcaPol').val();
445                                         $.grep(header, function(e,i){
446                                                 if (e.name == "tcaPolId"){
447                                                         if (polSel){
448                                                                 if (typeof allPolicies !== "undefined"){
449                                                                         header[i]["value"] = allPolicies[polSel][1]["value"];
450                                                                 } else if (typeof elementMap !== "undefined"){
451                                                                         for (key in elementMap){
452                                                                                 if (key.indexOf("Policy")>-1){
453                                                                                         header[i]["value"] = elementMap[key][polSel][1]["value"];
454                                                                                 }
455                                                                         }
456                                                                 }
457                                                         } else {
458                                                                 header[i]["value"]="";
459                                                         }
460                                                 }
461                                         });
462                                         
463                                         sconf["serviceConfigurations"]=sconfa;
464                                         header.push(sconf);
465                                         saveP[$(this).find('.tcaParentItems #tname').val()] = header;
466                                 });                     
467                                 
468                                 saveProperties(saveP);
469                                 $("#close_button").click();
470                         }
471                 })
472                 
473                 function uniquet(arr) {
474                     var a = [];
475                     for (var i=0, l=arr.length; i<l; i++){
476                         if (a.indexOf(arr[i]) === -1 && arr[i] !== ''){ 
477                                  a.push(arr[i]);
478                         }
479                     }
480                     if (a.length==arr.length){
481                         return false;
482                     } else {
483                         return true;
484                     }
485                 }
486                 
487                 function add_one_more(){
488                         $("#nav_Tabs li").removeClass("active");
489                         var form=$($("#formSpan").children()[0]).clone();
490                         var count=0;
491                         if($(".formId").length>0){
492                                 var greatest=0;
493                                 var s=$(".formId");
494                                 for(var i=0;i<s.length; i++){
495                                         if(parseInt($(s[i]).attr("id").substring(6))>greatest){
496                                                 greatest=parseInt($(s[i]).attr("id").substring(6))
497                                         }
498                                 }
499                                 count=greatest+1;
500                                 $("#panelHolder").append(('<span class="formId" id="formId'+count+'"></span>'));
501                         }else{
502                                 count++;
503                                 $("#panelHolder").append('<span class="formId" id="formId1"></span>');
504                         }
505                         
506                         $("#add_one_more").parent().before(' <li class="active"><a id="go_properties_tab'+count+'">New_Set</a><button id="tab_close'+count+'" type="button" class="close tab-close-popup" aria-hidden="true" style="margin-top: -30px;margin-right: 5px">&times;</button></li>');
507                         $("#formId"+count).append(form);
508                         $('#formId'+count+ ' #properties_tab').hide();
509                         $(".formId").not($("#formId"+count)).css("display","none");
510                         addCustListen(count);
511                         setMultiSelect();
512                         return count;
513                 }
514                 
515                 function isNumberKey(event){
516                         var charCode = (event.which) ? event.which : event.keyCode
517                         if (charCode > 31 && (charCode < 48 || charCode > 57)){
518                                 return false;
519                         }
520                         return true;
521                 };
522                 
523                 function addCustListen(count) {                 
524                         $('#go_properties_tab' + count).click(function(event) {
525                                 if ($("#nav_Tabs li.active").length>0){
526                                         var oldCount = $("#nav_Tabs li.active").find("a").attr("id").slice(-1);
527                                         if (($('#formId'+oldCount+' #tcaTable .highlight').length > 0 ) &&
528                                                         (!($('#formId'+oldCount+' #threshold').val()) || !($('#formId'+oldCount+' #fieldPathM').val())) ) {
529                                                 $('#formId'+oldCount+' #tcaError').show();
530                                                 return;
531                                         } else {
532                                                 $('#formId'+oldCount+' .tcaErr').hide();
533                                                 if ($('#formId'+oldCount+' #tcaTable .highlight').length > 0){
534                                                         $('#formId'+oldCount+' #tcaTable .highlight td').text(
535                                                                         $('#formId'+oldCount+' #fieldPathM').val() + ' ' +
536                                                                         $('#formId'+oldCount+' #operator').val() + ' ' +
537                                                                         $('#formId'+oldCount+' #threshold').val());
538                                                 }
539                                                 $("#formId"+oldCount+" #tcaTable .highlight").removeClass("highlight")
540                                         }
541                                 }
542                                 
543                                 $("#nav_Tabs li").removeClass("active");
544                                 $(this).parent().addClass("active");
545                                 $("#formId"+count).css("display","");
546                                 $(".formId").not($("#formId"+count)).css("display","none");
547                         });
548                         
549                         $('#tab_close'+count).click(function(event){
550                                 $(this).parent().remove();
551                                 $("#formId"+count).remove();
552                         });
553                         
554                         $('#formId'+count+' #tcaTable').on('click', 'tr', function(event){
555                                 if (($('#formId'+count+' #tcaTable .highlight').length > 0 ) &&
556                                                 (!($('#formId'+count+' #threshold').val()) || !($('#formId'+count+' #fieldPathM').val())) ) {
557                                         $('#formId'+count+' #tcaError').show();
558                                         return;
559                                 } else {
560                                         $('#formId'+count+' .tcaErr').hide();
561                                         if ($('#formId'+count+' #tcaTable .highlight').length > 0){
562                                                 $('#formId'+count+' #tcaTable .highlight td').text(
563                                                                 $('#formId'+count+' #fieldPathM').val() + ' ' +
564                                                                 $('#formId'+count+' #operator').val() + ' ' +
565                                                                 $('#formId'+count+' #threshold').val());
566                                         }
567                                         //$('#formId'+count+' #tcaTable .highlight').text();
568                                         $(this).addClass('highlight').siblings().removeClass('highlight');
569                                         var str = $(this).text().split(' ');
570                                         $('#formId'+count + ' #properties_tab').show();
571                                         if (str.length == 3){
572                                                 $('#formId'+count+' #fieldPathM').val(str[0]).multiselect('refresh');
573                                                 $('#formId'+count+' #operator').val(str[1]).multiselect('refresh');
574                                                 $('#formId'+count+' #threshold').val(str[2]);
575                                         }
576                                         
577                                         if ((!(readOnly||readMOnly)) && ($('#formId'+count + ' #deleteThresh').prop('disabled'))) {
578                                                 $('#formId'+count + ' #deleteThresh').prop('disabled', false);
579                                         }
580                                 }
581                         });
582                         
583                         $('#formId'+count+' #deleteThresh').on('click', function(){
584                                 $('#formId'+num+' .tcaErr').hide();
585                                 $('#formId'+count+ ' #properties_tab').hide();
586                                 $('#formId'+count+ ' #tcaTable .highlight').remove();
587                                 $('#formId'+count+ ' #deleteThresh').prop('disabled', true);
588                         });
589                         
590                         $('#formId'+count+' #createNewThresh').on('click', function(){
591                                 if (($('#formId'+count+' #tcaTable .highlight').length > 0 ) &&
592                                                 (!($('#formId'+count+' #threshold').val()) || !($('#formId'+count+' #fieldPathM').val())) ){
593                                         $('#formId'+count+' #tcaError').show();
594                                         return;
595                                 } else {
596                                         $('#formId'+count+' .tcaErr').hide();
597                                         if ($('#formId'+count+' #tcaTable .highlight').length > 0){
598                                                 $('#formId'+count+' #tcaTable .highlight td').text(
599                                                                 $('#formId'+count+' #fieldPathM').val() + ' ' +
600                                                                 $('#formId'+count+' #operator').val() + ' ' +
601                                                                 $('#formId'+count+' #threshold').val());
602                                         }
603                                         $('#formId'+count+ ' #properties_tab').show();
604                                         if (('#formId'+count+' #tcaTable .highlight').length > 0 ){
605                                                 $('#formId'+count+' #tcaTable tr.highlight').removeClass('highlight');
606                                         }
607                                         $('#formId'+count+' #tcaTable').prepend('<tr class="highlight"><td>New Threshold</td></tr>');
608                                         $('#formId'+count+' #fieldPathM').prop("selectedIndex", 0).multiselect('refresh');
609                                         $('#formId'+count+' #operator').prop("selectedIndex", 0).multiselect('refresh');
610                                         $('#formId'+count+' #threshold').val("");
611                                         
612                                         if ($('#formId'+count + ' #deleteThresh').prop('disabled')) {
613                                                 $('#formId'+count + ' #deleteThresh').prop('disabled', false);
614                                         }
615                                 }
616                         });
617                         
618                         $('#formId'+count+' #tname').on('change',function(){
619                                 $('#go_properties_tab'+count).text($('#formId'+count+' #tname').val())
620                         });
621                 }
622         </script>
623 </div>