@@ -403,31 +403,27 @@ function renderStaticDHCPTable() {
403403 . attr ( "title" , "Add new line after this" )
404404 . attr ( "data-toggle" , "tooltip" ) ;
405405
406- const tr = $ ( "<tr></tr>" )
406+ const tr = $ ( "<tr></tr>" ) ;
407407
408408 if ( parsed === "advanced" ) {
409- tr . addClass ( "table-warning" )
410- . append (
411- '<td colspan="3" class="text-muted"><em>Advanced settings present in line</em> ' +
412- ( idx + 1 ) +
413- "</td>" ,
414- )
409+ tr . addClass ( "table-warning" ) . append (
410+ '<td colspan="3" class="text-muted"><em>Advanced settings present in line</em> ' +
411+ ( idx + 1 ) +
412+ "</td>"
413+ ) ;
415414
416415 // Keep the original data
417416 tr . data ( "original-line" , line ) ;
418417
419418 // Disable the save button on advanced rows
420- saveBtn
421- . addClass ( "disabled" )
422- . prop ( "disabled" , true )
423- . attr ( "title" , "Disabled" ) ;
419+ saveBtn . addClass ( "disabled" ) . prop ( "disabled" , true ) . attr ( "title" , "Disabled" ) ;
424420
425421 } else {
426422 // Append 3 cells containing parsed values, with placeholder for empty hwaddr
427423 tr . append ( $ ( '<td contenteditable="true" class="static-hwaddr"></td>' ) . text ( parsed . hwaddr ) )
428424 . append ( $ ( '<td contenteditable="true" class="static-ipaddr"></td>' ) . text ( parsed . ipaddr ) )
429425 . append (
430- $ ( '<td contenteditable="true" class="static-hostname"></td>' ) . text ( parsed . hostname ) ,
426+ $ ( '<td contenteditable="true" class="static-hostname"></td>' ) . text ( parsed . hostname )
431427 ) ;
432428 }
433429
@@ -529,7 +525,8 @@ $(document).on("input blur paste", "#StaticDHCPTable td.static-ipaddr", function
529525$ ( document ) . on ( "input blur paste" , "#StaticDHCPTable td.static-hostname" , function ( ) {
530526 const val = $ ( this ) . text ( ) . trim ( ) ;
531527 // Hostnames must not contain spaces, commas, or characters invalid in DNS names
532- const hostnameValidator = / ^ [ a - z A - Z 0 - 9 ] ( [ a - z A - Z 0 - 9 \- ] * [ a - z A - Z 0 - 9 ] ) ? ( \. [ a - z A - Z 0 - 9 ] ( [ a - z A - Z 0 - 9 \- ] * [ a - z A - Z 0 - 9 ] ) ? ) * $ / v;
528+ const hostnameValidator =
529+ / ^ [ a - z A - Z 0 - 9 ] ( [ a - z A - Z 0 - 9 \- ] * [ a - z A - Z 0 - 9 ] ) ? ( \. [ a - z A - Z 0 - 9 ] ( [ a - z A - Z 0 - 9 \- ] * [ a - z A - Z 0 - 9 ] ) ? ) * $ / v;
533530 if ( val && ! hostnameValidator . test ( val ) ) {
534531 $ ( this ) . addClass ( "table-danger" ) ;
535532 $ ( this ) . removeClass ( "table-success" ) ;
0 commit comments