-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Ensure we clean up javascript based DataSources
DataSources added via javascript require cleaning up by assigning it to an EventSource component in the template, otherwise the blocking query can stick around when its no longer needed. We also took the opportunity here to make this consistent with the rest of the application. 1. Don't use `@model`. 2. Use our <Route /> component. 3. Use extra divs/spans specifically for styling only as a last resort.
- Loading branch information
John Cowen
committed
Sep 22, 2021
1 parent
76c9c5e
commit 234ea57
Showing
3 changed files
with
32 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 24 additions & 19 deletions
43
ui/packages/consul-ui/app/templates/dc/routing-config.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
{{page-title @model.slug}} | ||
<Route | ||
@name={{routeName}} | ||
@title={{slug}} | ||
as |route|> | ||
|
||
<AppView> | ||
<BlockSlot @name="breadcrumbs"> | ||
<ol> | ||
<li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li> | ||
</ol> | ||
</BlockSlot> | ||
<BlockSlot @name="header"> | ||
<h1> | ||
{{@model.slug}} | ||
</h1> | ||
<Consul::Source @source={{t "routes.dc.routing-config.source"}} @withInfo={{true}} /> | ||
</BlockSlot> | ||
<BlockSlot @name="content"> | ||
<div class="container"> | ||
<EventSource @src={{chain}} /> | ||
|
||
<AppView> | ||
<BlockSlot @name="breadcrumbs"> | ||
<ol> | ||
<li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li> | ||
</ol> | ||
</BlockSlot> | ||
<BlockSlot @name="header"> | ||
<h1> | ||
{{slug}} | ||
</h1> | ||
<Consul::Source @source={{t "routes.dc.routing-config.source"}} @withInfo={{true}} /> | ||
</BlockSlot> | ||
<BlockSlot @name="content"> | ||
<Consul::DiscoveryChain | ||
@chain={{@model.chain.Chain}} | ||
@chain={{chain.Chain}} | ||
/> | ||
</div> | ||
</BlockSlot> | ||
</AppView> | ||
</BlockSlot> | ||
</AppView> | ||
|
||
</Route> |