Skip to content

Commit

Permalink
Update more places where we use the cluster list
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored and richard-cox committed Sep 17, 2021
1 parent 6b4a675 commit 5b91712
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion components/LandingPagePreference.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import RadioGroup from '@/components/form/RadioGroup';
import RadioButton from '@/components/form/RadioButton';
import Select from '@/components/form/Select';
import { MANAGEMENT } from '@/config/types';
import { filterOnlyKubernetesClusters } from '@/utils/cluster';
export default {
components: {
Expand Down Expand Up @@ -71,8 +72,9 @@ export default {
routeDropdownOptions() {
// Drop-down shows list of clusters that can ber set as login landing page
const out = [];
const kubeClusters = filterOnlyKubernetesClusters(this.clusters);
this.clusters.forEach((c) => {
kubeClusters.forEach((c) => {
if (c.isReady) {
out.push({
label: c.nameDisplay,
Expand Down
4 changes: 3 additions & 1 deletion edit/token.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import RadioGroup from '@/components/form/RadioGroup';
import Select from '@/components/form/Select';
import CreateEditView from '@/mixins/create-edit-view';
import { diffFrom } from '@/utils/time';
import { filterOnlyKubernetesClusters } from '@/utils/cluster';
export default {
components: {
Expand Down Expand Up @@ -56,7 +57,8 @@ export default {
...mapGetters({ t: 'i18n/t' }),
scopes() {
const all = this.$store.getters['management/all'](MANAGEMENT.CLUSTER);
let out = all.map(opt => ({ value: opt.id, label: opt.nameDisplay }));
const kubeClusters = filterOnlyKubernetesClusters(all);
let out = kubeClusters.map(opt => ({ value: opt.id, label: opt.nameDisplay }));
out = sortBy(out, ['label']);
out.unshift( { value: '', label: this.t('accountAndKeys.apiKeys.add.noScope') } );
Expand Down
6 changes: 5 additions & 1 deletion list/fleet.cattle.io.cluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import FleetClusters from '@/components/FleetClusters';
import { FLEET, MANAGEMENT } from '@/config/types';
import Loading from '@/components/Loading';
import { filterOnlyKubernetesClusters } from '@/utils/cluster';
export default {
name: 'ListCluster',
Expand All @@ -28,6 +29,9 @@ export default {
},
computed: {
kubeMgmtClusters() {
return filterOnlyKubernetesClusters(this.allMgmt);
},
rows() {
const out = this.allFleet.slice();
Expand All @@ -37,7 +41,7 @@ export default {
known[c.metadata.name] = true;
}
for ( const c of this.allMgmt ) {
for ( const c of this.kubeMgmtClusters ) {
if ( !known[c.metadata.name] ) {
out.push(c);
}
Expand Down

0 comments on commit 5b91712

Please sign in to comment.