-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9733 from hashicorp/b-ui/topo-viz-old-agent
UI: Guard against nodes running an old version of the Nomad agent
- Loading branch information
Showing
6 changed files
with
91 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import Controller from '@ember/controller'; | |
import { computed, action } from '@ember/object'; | ||
import { alias } from '@ember/object/computed'; | ||
import { inject as service } from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import classic from 'ember-classic-decorator'; | ||
import { reduceToLargestUnit } from 'nomad-ui/helpers/format-bytes'; | ||
|
||
|
@@ -13,6 +14,8 @@ export default class TopologyControllers extends Controller { | |
|
||
@alias('userSettings.showTopoVizPollingNotice') showPollingNotice; | ||
|
||
@tracked filteredNodes = null; | ||
|
||
@computed('[email protected]') | ||
get datacenters() { | ||
return Array.from(new Set(this.model.nodes.mapBy('datacenter'))).compact(); | ||
|
@@ -117,4 +120,12 @@ export default class TopologyControllers extends Controller { | |
setNode(node) { | ||
this.set('activeNode', node); | ||
} | ||
|
||
@action | ||
handleTopoVizDataError(errors) { | ||
const filteredNodesError = errors.findBy('type', 'filtered-nodes'); | ||
if (filteredNodesError) { | ||
this.filteredNodes = filteredNodesError.context; | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { create, text, visitable } from 'ember-cli-page-object'; | ||
|
||
import TopoViz from 'nomad-ui/tests/pages/components/topo-viz'; | ||
import notification from 'nomad-ui/tests/pages/components/notification'; | ||
|
||
export default create({ | ||
visit: visitable('/topology'), | ||
|
||
infoPanelTitle: text('[data-test-info-panel-title]'), | ||
filteredNodesWarning: notification('[data-test-filtered-nodes-warning]'), | ||
|
||
viz: TopoViz('[data-test-topo-viz]'), | ||
}); |