@@ -306,7 +306,7 @@ export function Switch() {
306
306
if ( active < 0 || active >= __state . model . ports . length ) {
307
307
$ ( "switch-active-port" ) . innerText = "N/A" ;
308
308
} else {
309
- $ ( "switch-active-port" ) . innerText = "p" + __formatPort ( __state . model , active ) ;
309
+ $ ( "switch-active-port" ) . innerText = "p" + summary . active_id ;
310
310
}
311
311
for ( let port = 0 ; port < __state . model . ports . length ; ++ port ) {
312
312
__setLedState ( $ ( `__switch-port-led-p${ port } ` ) , "green" , ( port === active ) ) ;
@@ -361,7 +361,7 @@ export function Switch() {
361
361
content += `
362
362
<tr>
363
363
<td>Port:</td>
364
- <td class="value">${ __formatPort ( model , port ) } </td>
364
+ <td class="value">${ pa . id } </td>
365
365
<td> </td>
366
366
<td>
367
367
<div class="buttons-row">
@@ -541,7 +541,7 @@ export function Switch() {
541
541
}
542
542
} ;
543
543
544
- wm . modal ( `Port ${ __formatPort ( __state . model , port ) } settings` , create_content , true , true ) . then ( function ( ok ) {
544
+ wm . modal ( `Port ${ __state . model . ports [ port ] . id } settings` , create_content , true , true ) . then ( function ( ok ) {
545
545
if ( ok ) {
546
546
let params = {
547
547
"port" : port ,
@@ -557,14 +557,6 @@ export function Switch() {
557
557
} ) ;
558
558
} ;
559
559
560
- var __formatPort = function ( model , port ) {
561
- if ( model . units . length > 1 ) {
562
- return `${ model . ports [ port ] . unit + 1 } .${ model . ports [ port ] . channel + 1 } ` ;
563
- } else {
564
- return `${ port + 1 } ` ;
565
- }
566
- } ;
567
-
568
560
var __setLedState = function ( el , color , on ) {
569
561
el . classList . toggle ( `led-${ color } ` , on ) ;
570
562
el . classList . toggle ( "led-gray" , ! on ) ;
0 commit comments