File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
packages/pico-engine/public Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -569,7 +569,7 @@ <h2>{{ui.name}}</h2>
569
569
</td >
570
570
< / tr > </ table >
571
571
< / f o r m >
572
- < h3 > Inbound router: { { #if ui . routerUI} } < span title = "{{ui.routerUI.routerHost}} {{ui.routerUI.routerRequestECI}}" > { { ui. routerUI . routerName } } </ span > { { else} } < a href = "#" onclick = "$(this).parent().next('form').toggle()" style = "font-size:75%" > not configured</ a > { { / i f } } < / h3 >
572
+ < h3 > Inbound router: { { #if ui . routerUI} } < span title = "{{ui.routerUI.routerHost}} {{ui.routerUI.routerRequestECI}}" > { { ui. routerUI . routerName } } </ span > { { #if ui . routerUI . unused } } < a class = "js-ajax-link" href = "/sky/event/{{eci}}/remove-router/edge/router_removal_requested" > del </ a > { { / i f } } { { e l s e } } < a h r e f = " # " o n c l i c k = " $ ( t h i s ) .p a r e n t ( ) .n e x t ( ' f o r m ' ) .t o g g l e ( ) " s t y l e = " f o n t - s i z e : 7 5 % " > n o t c o n f i g u r e d < / a> { { / i f } } < / h3 >
573
573
{ { #unless ui . routerUI . routerName} }
574
574
< form class = "js-ajax-form" action = "/sky/event/{{eci}}/add-ruleset/wrangler/install_rulesets_requested?rids=org.sovrin.edge" style = "display:none" >
575
575
< input name = "host" placeholder = "router host" >
Original file line number Diff line number Diff line change @@ -515,14 +515,19 @@ $(document).ready(function () {
515
515
d = theDB . pico_id + '-Policies'
516
516
location . hash = d
517
517
} else if ( tabName === 'agent' ) {
518
- if ( theDB . ui && theDB . ui . routerUI && theDB . ui . routerUI . routerName && theDB . ui . connections ) {
519
- var toSuffix = " to " + theDB . ui . name
520
- for ( var ic = 0 ; ic < theDB . ui . connections . length ; ++ ic ) {
521
- var rConnName = theDB . ui . connections [ ic ] . label + toSuffix
522
- if ( theDB . ui . routerUI . routerConnections && theDB . ui . routerUI . routerConnections [ rConnName ] ) {
523
- theDB . ui . connections [ ic ] . routerName = theDB . ui . routerUI . routerName
518
+ var routerUsedCount = 0
519
+ if ( theDB . ui && theDB . ui . routerUI ) {
520
+ if ( theDB . ui . routerUI . routerName && theDB . ui . connections ) {
521
+ var toSuffix = " to " + theDB . ui . name
522
+ for ( var ic = 0 ; ic < theDB . ui . connections . length ; ++ ic ) {
523
+ var rConnName = theDB . ui . connections [ ic ] . label + toSuffix
524
+ if ( theDB . ui . routerUI . routerConnections && theDB . ui . routerUI . routerConnections [ rConnName ] ) {
525
+ theDB . ui . connections [ ic ] . routerName = theDB . ui . routerUI . routerName
526
+ ++ routerUsedCount
527
+ }
524
528
}
525
529
}
530
+ theDB . ui . routerUI . unused = routerUsedCount == 0
526
531
}
527
532
theDB . text = JSON . stringify ( theDB . ui , undefined , 2 )
528
533
$theSection . html ( agentTemplate ( theDB ) )
You can’t perform that action at this time.
0 commit comments