mirror of
https://github.com/status-im/consul.git
synced 2025-01-21 02:59:48 +00:00
468e82dcf9
* ui: Move tomography length check inside of the partial Previously we checked the length of tomography.distances to decide whether to show the RTT tab or not. Previous to our ember upgrade this would not cause a DOM reload of so many elements (i.e. all of the tab content). Since our ember upgrade, any change to tomography (so not necessarily the length of distances) seems to fire a change to the length (even if the length remains the same). The knock on effect of this is that the array of tab panels seems to be recalculated (but remain the same) and all of the tab panels are completely re-rendered, causing the scroll of the page to be reset. This commit moves the check for tomography.distance.length to the lower down with the loop, which means the array of tab panels always remains the same, which consequently means that the entire array of tab panels is never re-rendered entirely, and therefore fixes the issue.
67 lines
2.5 KiB
Handlebars
67 lines
2.5 KiB
Handlebars
{{title item.Node}}
|
|
{{#app-view class="node show"}}
|
|
{{#block-slot name='notification' as |status type|}}
|
|
{{!TODO: Move sessions to its own folder within nodes }}
|
|
{{partial 'dc/nodes/notifications'}}
|
|
{{/block-slot}}
|
|
{{#block-slot name='breadcrumbs'}}
|
|
<ol>
|
|
<li><a data-test-back href={{href-to 'dc.nodes'}}>All Nodes</a></li>
|
|
</ol>
|
|
{{/block-slot}}
|
|
{{#block-slot name='header'}}
|
|
<h1>
|
|
{{ item.Node }}
|
|
</h1>
|
|
<label for="toolbar-toggle"></label>
|
|
{{tab-nav
|
|
items=(compact
|
|
(array
|
|
'Health Checks'
|
|
'Services'
|
|
(if tomography.distances 'Round Trip Time' '')
|
|
'Lock Sessions'
|
|
'Meta Data'
|
|
)
|
|
)
|
|
selected=selectedTab
|
|
}}
|
|
{{/block-slot}}
|
|
{{#block-slot name='actions'}}
|
|
{{#feedback-dialog type='inline'}}
|
|
{{#block-slot name='action' as |success error|}}
|
|
{{#copy-button success=(action success) error=(action error) clipboardText=item.Address title='copy IP address to clipboard'}}
|
|
{{item.Address}}
|
|
{{/copy-button}}
|
|
{{/block-slot}}
|
|
{{#block-slot name='success' as |transition|}}
|
|
<p class={{transition}}>
|
|
Copied IP Address!
|
|
</p>
|
|
{{/block-slot}}
|
|
{{#block-slot name='error' as |transition|}}
|
|
<p class={{transition}}>
|
|
Sorry, something went wrong!
|
|
</p>
|
|
{{/block-slot}}
|
|
{{/feedback-dialog}}
|
|
{{/block-slot}}
|
|
{{#block-slot name='content'}}
|
|
{{#each
|
|
(array
|
|
(hash id=(slugify 'Health Checks') partial='dc/nodes/healthchecks')
|
|
(hash id=(slugify 'Services') partial='dc/nodes/services')
|
|
(hash id=(slugify 'Round Trip Time') partial='dc/nodes/rtt')
|
|
(hash id=(slugify 'Lock Sessions') partial='dc/nodes/sessions')
|
|
(hash id=(slugify 'Meta Data') partial='dc/nodes/metadata')
|
|
) as |panel|
|
|
}}
|
|
{{#if (or (not-eq panel.id 'round-trip-time') (gt tomography.distances.length 0)) }}
|
|
{{#tab-section id=panel.id selected=(eq (if selectedTab selectedTab '') panel.id) onchange=(action "change")}}
|
|
{{partial panel.partial}}
|
|
{{/tab-section}}
|
|
{{/if}}
|
|
{{/each}}
|
|
{{/block-slot}}
|
|
{{/app-view}}
|