ui: Only try and load sessions and coordinates if the node exists (#8305)

This commit is contained in:
John Cowen 2020-07-14 14:50:44 +01:00 committed by GitHub
parent 4b458955c2
commit cda90556e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -12,8 +12,12 @@ export default Route.extend({
const name = params.name;
return hash({
item: this.repo.findBySlug(name, dc, nspace),
sessions: this.sessionRepo.findByNode(name, dc, nspace),
tomography: this.coordinateRepo.findAllByNode(name, dc),
}).then(model => {
return hash({
...model,
sessions: this.sessionRepo.findByNode(name, dc, nspace),
tomography: this.coordinateRepo.findAllByNode(name, dc),
});
});
},
setupController: function(controller, model) {

View File

@ -1,5 +1,7 @@
{{title item.Node}}
<EventSource @src={{item}} @onerror={{action "error"}} />
<EventSource @src={{sessions}} />
<EventSource @src={{tomography}} />
<AppView @class="node show">
<BlockSlot @name="notification" as |status type|>
{{!TODO: Move sessions to its own folder within nodes }}