mirror of
				https://github.com/Telecominfraproject/oopt-gnpy-web-gui.git
				synced 2025-10-31 10:07:58 +00:00 
			
		
		
		
	Added rule for fiber edit window
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -374,7 +374,21 @@ $(document).ready(function () { | |||||||
|  |  | ||||||
|     $('#cbxLength_Based_Loss').change(function () { |     $('#cbxLength_Based_Loss').change(function () { | ||||||
|         if (this.checked) { |         if (this.checked) { | ||||||
|  |             var span_length = $("#txtSpan_Length").val(); | ||||||
|  |             var spanlen = parseFloat(span_length); | ||||||
|  |             var loss_coeff = $("#txtLoss_Coefficient").val(); | ||||||
|  |             var lossCoeff = parseFloat(loss_coeff); | ||||||
|  |             if (isNaN(span_length) || spanlen <= 0 || span_length == "" || isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") { | ||||||
|  |                 showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered"); | ||||||
|  |                 $("#txtLoss_Coefficient").addClass('input_error'); | ||||||
|  |             } | ||||||
|  |             else { | ||||||
|                 fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss'); |                 fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss'); | ||||||
|  |                 $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|     $('#cbx_FiberALBL').change(function () { |     $('#cbx_FiberALBL').change(function () { | ||||||
| @@ -6237,6 +6251,8 @@ function clearCbxandAccordian() { | |||||||
| } | } | ||||||
|  |  | ||||||
| function singleFiberEdit(fiberID, callback) { | function singleFiberEdit(fiberID, callback) { | ||||||
|  |     $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |     $('#cbxLength_Based_Loss').prop('checked', false); | ||||||
|     document.getElementById("singleFiberMenu").style.display = "none"; |     document.getElementById("singleFiberMenu").style.display = "none"; | ||||||
|     var edgeDetails = network.body.data.edges.get(fiberID); |     var edgeDetails = network.body.data.edges.get(fiberID); | ||||||
|     var connectedNode = network.getConnectedNodes(fiberID); |     var connectedNode = network.getConnectedNodes(fiberID); | ||||||
| @@ -6301,6 +6317,18 @@ function updateSingleFiber(fiberID) { | |||||||
|     else |     else | ||||||
|         $("#txtSpan_Length").removeClass('input_error'); |         $("#txtSpan_Length").removeClass('input_error'); | ||||||
|  |  | ||||||
|  |     if ($('#cbxLength_Based_Loss').is(":checked")) { | ||||||
|  |         var loss_coeff = $("#txtLoss_Coefficient").val(); | ||||||
|  |         var lossCoeff = parseFloat(loss_coeff); | ||||||
|  |         if (isNaN(loss_coeff) || lossCoeff <= 0 || loss_coeff == "") { | ||||||
|  |             showMessage(alertType.Error, "Length based loss requires span length and loss coefficient to be entered"); | ||||||
|  |             $("#txtLoss_Coefficient").addClass('input_error'); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |             $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     var fiberDetails = network.body.data.edges.get(fiberID); |     var fiberDetails = network.body.data.edges.get(fiberID); | ||||||
|  |  | ||||||
|     if (nameLengthValidation("txtSinlgeFiberName")) { |     if (nameLengthValidation("txtSinlgeFiberName")) { | ||||||
| @@ -6343,6 +6371,7 @@ function clearSingleFiber() { | |||||||
|  |  | ||||||
|     $("#ddlSingleFiberType").removeClass('input_error'); |     $("#ddlSingleFiberType").removeClass('input_error'); | ||||||
|     $("#txtSpan_Length").removeClass('input_error'); |     $("#txtSpan_Length").removeClass('input_error'); | ||||||
|  |     $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |  | ||||||
|     $('#cbxLength_Based_Loss').prop('checked', false); |     $('#cbxLength_Based_Loss').prop('checked', false); | ||||||
|     closeDrawer('singlefiber'); |     closeDrawer('singlefiber'); | ||||||
|   | |||||||
| @@ -9,7 +9,38 @@ | |||||||
|         else |         else | ||||||
|             $("#txtSpan_Length").removeClass('input_error'); |             $("#txtSpan_Length").removeClass('input_error'); | ||||||
|  |  | ||||||
|  |         if ($('#cbxLength_Based_Loss').is(":checked")) { | ||||||
|  |             fiberCalc(); | ||||||
|  |                  | ||||||
|  |         } | ||||||
|     }); |     }); | ||||||
|  |     $("#txtLoss_Coefficient").change(function () { | ||||||
|  |         if ($('#cbxLength_Based_Loss').is(":checked")) { | ||||||
|  |             var span_length = $("#txtLoss_Coefficient").val().trim(); | ||||||
|  |             var spanlen = parseFloat(span_length); | ||||||
|  |             if (isNaN(span_length) || spanlen <= 0 || span_length == "") { | ||||||
|  |                 $("#txtLoss_Coefficient").addClass('input_error'); | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |             else | ||||||
|  |                 $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |  | ||||||
|  |             fiberCalc(); | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |             $("#txtLoss_Coefficient").removeClass('input_error'); | ||||||
|  |  | ||||||
|  |          | ||||||
|  |  | ||||||
|  |     }); | ||||||
|  |     function fiberCalc() { | ||||||
|  |         var span_length = $("#txtSpan_Length").val(); | ||||||
|  |         var spanlen = parseFloat(span_length); | ||||||
|  |         var loss_coeff = $("#txtLoss_Coefficient").val(); | ||||||
|  |         var lossCoeff = parseFloat(loss_coeff); | ||||||
|  |         if (!isNaN(span_length) || spanlen >= 0 || span_length != "" || !isNaN(loss_coeff) || lossCoeff >= 0 || loss_coeff != "") | ||||||
|  |             fiberLengthCal('txtSpan_Length', 'txtLoss_Coefficient', 'txtSpan_Loss'); | ||||||
|  |     } | ||||||
|     $("#ddlSingleFiberType").change(function () { |     $("#ddlSingleFiberType").change(function () { | ||||||
|         if ($(this).val()=="") { |         if ($(this).val()=="") { | ||||||
|             $("#ddlSingleFiberType").addClass('input_error'); |             $("#ddlSingleFiberType").addClass('input_error'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sakv2e10204
					sakv2e10204