Update more places where we use the cluster list

This commit is contained in:
Neil MacDougall 2021-09-08 13:06:52 +01:00 committed by Richard Cox
parent 6b4a675038
commit 5b91712270
3 changed files with 11 additions and 3 deletions

View File

@ -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: {
@ -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,

View File

@ -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: {
@ -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') } );

View File

@ -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',
@ -28,6 +29,9 @@ export default {
},
computed: {
kubeMgmtClusters() {
return filterOnlyKubernetesClusters(this.allMgmt);
},
rows() {
const out = this.allFleet.slice();
@ -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);
}