mirror of https://github.com/rancher/dashboard.git
Add manual refresh + incremental loading to all list views (#6908)
* removing check for restriction of types on incremental+manual + update masthead to incorportate directly the ResourceLoadingIndicator so that it can used by list views with custom mastheads + move catalog.clusterrepo typedescription to its rightful component and delete custom list view + updating custom list views to use resource-fetch mixin * continue updating custom list views to use resource-fetch mixin * finish updating custom list views to use resource-fetch mixin + prevent error on loadAdd mutation where type is not set in store yet + code cleanup * address PR comments * update all custom list views to use loading prop on ResourceTable rather than Loading component + use getter to get incremental updates propagated from the store into the table itself + other minor fixes * revert changes to mutation loadAdd as check is not needed * revert all changes to shell/list/harvesterhci.io.management.cluster.vue * revert deletion of clusterrepo due to CI/CD validation of plugin * add manual + refresh to namespaces list + fix issue where switching between workspaces results in the manual refresh button continually spinning * move rows and loading flag to resource-fetch and do necessary changes to custom lists to minimize code changes for the future * Minor fixes - Match existing loading check in projectnamespace list (had a check for currentCluster, probably not needed but added just in case) - Fixed masthead loading indicator for management users and features Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local> Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan> Co-authored-by: Richard Cox <richard.cox@suse.com>
This commit is contained in:
parent
90790787f9
commit
866f4d8032
|
|
@ -6174,7 +6174,7 @@ performance:
|
||||||
label: Incremental Loading
|
label: Incremental Loading
|
||||||
setting: You can configure the threshold above which incremental loading will be used.
|
setting: You can configure the threshold above which incremental loading will be used.
|
||||||
description: |-
|
description: |-
|
||||||
When enabled, resources will appear more quickly, but it may take slightly longer to load the entire set of resources. This setting only applies to the following resources: Pods, Deployments, Cron Jobs, Daemon Sets, Jobs, Stateful Sets, Replica Sets, Replication Controllers, Workloads and Secrets.
|
When enabled, resources will appear more quickly, but it may take slightly longer to load the entire set of resources. This setting only applies to resources that come from the Kubernetes API
|
||||||
checkboxLabel: Enable incremental loading
|
checkboxLabel: Enable incremental loading
|
||||||
inputLabel: Resource Threshold
|
inputLabel: Resource Threshold
|
||||||
manualRefresh:
|
manualRefresh:
|
||||||
|
|
@ -6183,7 +6183,7 @@ performance:
|
||||||
setting: You can configure a threshold above which manual refresh will be enabled.
|
setting: You can configure a threshold above which manual refresh will be enabled.
|
||||||
buttonTooltip: Refresh list
|
buttonTooltip: Refresh list
|
||||||
description: |-
|
description: |-
|
||||||
When enabled, list data will not auto-update but instead the user must manually trigger a list-view refresh. This setting only applies to the following resources: Pods, Deployments, Cron Jobs, Daemon Sets, Jobs, Stateful Sets, Replica Sets, Replication Controllers, Workloads and Secrets.
|
When enabled, list data will not auto-update but instead the user must manually trigger a list-view refresh. This setting only applies to resources that come from the Kubernetes API
|
||||||
checkboxLabel: Enable manual refresh of data for lists
|
checkboxLabel: Enable manual refresh of data for lists
|
||||||
inputLabel: Resource Threshold
|
inputLabel: Resource Threshold
|
||||||
websocketNotification:
|
websocketNotification:
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,14 @@ import { mapPref, GROUP_RESOURCES, ALL_NAMESPACES } from '@shell/store/prefs';
|
||||||
import MoveModal from '@shell/components/MoveModal';
|
import MoveModal from '@shell/components/MoveModal';
|
||||||
import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vue';
|
import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vue';
|
||||||
import { NAMESPACE_FILTER_ALL_ORPHANS } from '@shell/utils/namespace-filter';
|
import { NAMESPACE_FILTER_ALL_ORPHANS } from '@shell/utils/namespace-filter';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListProjectNamespace',
|
name: 'ListProjectNamespace',
|
||||||
components: {
|
components: {
|
||||||
Masthead, MoveModal, ResourceTable
|
Masthead, MoveModal, ResourceTable
|
||||||
},
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
createProjectLocationOverride: {
|
createProjectLocationOverride: {
|
||||||
|
|
@ -42,14 +44,15 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.namespaces = await this.$store.dispatch(`${ inStore }/findAll`, { type: NAMESPACE });
|
await this.$fetchType(NAMESPACE);
|
||||||
this.projects = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PROJECT, opt: { force: true } });
|
this.projects = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PROJECT, opt: { force: true } });
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loadResources: [NAMESPACE],
|
||||||
|
loadIndeterminate: true,
|
||||||
schema: null,
|
schema: null,
|
||||||
namespaces: [],
|
|
||||||
projects: [],
|
projects: [],
|
||||||
projectSchema: null,
|
projectSchema: null,
|
||||||
MANAGEMENT,
|
MANAGEMENT,
|
||||||
|
|
@ -66,6 +69,17 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['currentCluster', 'currentProduct']),
|
...mapGetters(['currentCluster', 'currentProduct']),
|
||||||
|
namespaces() {
|
||||||
|
const inStore = this.$store.getters['currentStore'](NAMESPACE);
|
||||||
|
|
||||||
|
return this.$store.getters[`${ inStore }/all`](NAMESPACE);
|
||||||
|
},
|
||||||
|
loading() {
|
||||||
|
return !this.currentCluster || this.namespaces.length ? false : this.$fetchState.pending;
|
||||||
|
},
|
||||||
|
showIncrementalLoadingIndicator() {
|
||||||
|
return this.perfConfig?.incrementalLoading?.enabled;
|
||||||
|
},
|
||||||
isNamespaceCreatable() {
|
isNamespaceCreatable() {
|
||||||
return (this.schema?.collectionMethods || []).includes('POST');
|
return (this.schema?.collectionMethods || []).includes('POST');
|
||||||
},
|
},
|
||||||
|
|
@ -309,6 +323,9 @@ export default {
|
||||||
:favorite-resource="VIRTUAL_TYPES.PROJECT_NAMESPACES"
|
:favorite-resource="VIRTUAL_TYPES.PROJECT_NAMESPACES"
|
||||||
:create-location="createProjectLocation"
|
:create-location="createProjectLocation"
|
||||||
:create-button-label="t('projectNamespaces.createProject')"
|
:create-button-label="t('projectNamespaces.createProject')"
|
||||||
|
:show-incremental-loading-indicator="showIncrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
/>
|
/>
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
ref="table"
|
ref="table"
|
||||||
|
|
@ -319,7 +336,7 @@ export default {
|
||||||
:rows="filteredRows"
|
:rows="filteredRows"
|
||||||
:groupable="true"
|
:groupable="true"
|
||||||
:sort-generation-fn="sortGenerationFn"
|
:sort-generation-fn="sortGenerationFn"
|
||||||
:loading="$fetchState.pending || !currentCluster"
|
:loading="loading"
|
||||||
group-tooltip="resourceTable.groupBy.project"
|
group-tooltip="resourceTable.groupBy.project"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import Favorite from '@shell/components/nav/Favorite';
|
||||||
import TypeDescription from '@shell/components/TypeDescription';
|
import TypeDescription from '@shell/components/TypeDescription';
|
||||||
import { get } from '@shell/utils/object';
|
import { get } from '@shell/utils/object';
|
||||||
import { AS, _YAML } from '@shell/config/query-params';
|
import { AS, _YAML } from '@shell/config/query-params';
|
||||||
|
import ResourceLoadingIndicator from './ResourceLoadingIndicator';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource List Masthead component.
|
* Resource List Masthead component.
|
||||||
|
|
@ -15,6 +16,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
Favorite,
|
Favorite,
|
||||||
TypeDescription,
|
TypeDescription,
|
||||||
|
ResourceLoadingIndicator,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
|
|
@ -53,6 +55,20 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
loadResources: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
loadIndeterminate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
showIncrementalLoadingIndicator: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inherited global identifier prefix for tests
|
* Inherited global identifier prefix for tests
|
||||||
|
|
@ -155,7 +171,11 @@ export default {
|
||||||
<h1 class="m-0">
|
<h1 class="m-0">
|
||||||
{{ _typeDisplay }} <Favorite v-if="isExplorer" :resource="favoriteResource || resource" />
|
{{ _typeDisplay }} <Favorite v-if="isExplorer" :resource="favoriteResource || resource" />
|
||||||
</h1>
|
</h1>
|
||||||
<slot name="header"></slot>
|
<ResourceLoadingIndicator
|
||||||
|
v-if="showIncrementalLoadingIndicator"
|
||||||
|
:resources="loadResources"
|
||||||
|
:indeterminate="loadIndeterminate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-container">
|
<div class="actions-container">
|
||||||
<slot name="actions">
|
<slot name="actions">
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,6 @@ export default {
|
||||||
indeterminate: {
|
indeterminate: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
|
||||||
rows: {
|
|
||||||
type: Array,
|
|
||||||
default: undefined,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -32,10 +28,6 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
// Count of rows - either from the data provided or from the rows for the first resource
|
// Count of rows - either from the data provided or from the rows for the first resource
|
||||||
rowsCount() {
|
rowsCount() {
|
||||||
if (this.rows) {
|
|
||||||
return this.rows.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.resources.length > 0) {
|
if (this.resources.length > 0) {
|
||||||
const existingData = this.$store.getters[`${ this.inStore }/all`](this.resources[0]) || [];
|
const existingData = this.$store.getters[`${ this.inStore }/all`](this.resources[0]) || [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
import Loading from '@shell/components/Loading';
|
||||||
import Masthead from './Masthead';
|
import Masthead from './Masthead';
|
||||||
import ResourceLoadingIndicator from './ResourceLoadingIndicator';
|
import ResourceLoadingIndicator from './ResourceLoadingIndicator';
|
||||||
import ResourceFetch, { TYPES_RESTRICTED } from '@shell/mixins/resource-fetch';
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -43,8 +43,8 @@ export default {
|
||||||
if (component?.$loadingResources) {
|
if (component?.$loadingResources) {
|
||||||
const { loadResources, loadIndeterminate } = component?.$loadingResources(this.$route, this.$store);
|
const { loadResources, loadIndeterminate } = component?.$loadingResources(this.$route, this.$store);
|
||||||
|
|
||||||
this.loadResources = loadResources;
|
this.loadResources = loadResources || [resource];
|
||||||
this.loadIndeterminate = loadIndeterminate;
|
this.loadIndeterminate = loadIndeterminate || false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,11 +55,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TYPES_RESTRICTED.includes(resource)) {
|
await this.$fetchType(resource);
|
||||||
this.rows = await this.$fetchType(resource);
|
|
||||||
} else {
|
|
||||||
this.rows = await store.dispatch(`${ inStore }/findAll`, { type: resource });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -75,13 +71,10 @@ export default {
|
||||||
|
|
||||||
const showMasthead = getters[`type-map/optionsFor`](resource).showListMasthead;
|
const showMasthead = getters[`type-map/optionsFor`](resource).showListMasthead;
|
||||||
|
|
||||||
const existingData = getters[`${ inStore }/all`](resource) || [];
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
inStore,
|
inStore,
|
||||||
schema,
|
schema,
|
||||||
hasListComponent,
|
hasListComponent,
|
||||||
hasData: existingData.length > 0,
|
|
||||||
showMasthead: showMasthead === undefined ? true : showMasthead,
|
showMasthead: showMasthead === undefined ? true : showMasthead,
|
||||||
resource,
|
resource,
|
||||||
// manual refresh
|
// manual refresh
|
||||||
|
|
@ -89,7 +82,6 @@ export default {
|
||||||
watch: false,
|
watch: false,
|
||||||
force: false,
|
force: false,
|
||||||
// Provided by fetch later
|
// Provided by fetch later
|
||||||
rows: [],
|
|
||||||
customTypeDisplay: null,
|
customTypeDisplay: null,
|
||||||
// incremental loading
|
// incremental loading
|
||||||
loadResources: [resource],
|
loadResources: [resource],
|
||||||
|
|
@ -111,10 +103,6 @@ export default {
|
||||||
return this.$store.getters['type-map/groupByFor'](this.schema);
|
return this.$store.getters['type-map/groupByFor'](this.schema);
|
||||||
},
|
},
|
||||||
|
|
||||||
loading() {
|
|
||||||
return this.hasData ? false : this.$fetchState.pending;
|
|
||||||
},
|
|
||||||
|
|
||||||
showIncrementalLoadingIndicator() {
|
showIncrementalLoadingIndicator() {
|
||||||
return this.perfConfig?.incrementalLoading?.enabled;
|
return this.perfConfig?.incrementalLoading?.enabled;
|
||||||
}
|
}
|
||||||
|
|
@ -142,18 +130,16 @@ export default {
|
||||||
:type-display="customTypeDisplay"
|
:type-display="customTypeDisplay"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:resource="resource"
|
:resource="resource"
|
||||||
|
:show-incremental-loading-indicator="showIncrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
>
|
>
|
||||||
<template v-slot:header>
|
|
||||||
<ResourceLoadingIndicator
|
|
||||||
v-if="showIncrementalLoadingIndicator"
|
|
||||||
:resources="loadResources"
|
|
||||||
:indeterminate="loadIndeterminate"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</Masthead>
|
</Masthead>
|
||||||
<div v-if="hasListComponent">
|
<div v-if="hasListComponent">
|
||||||
<component
|
<component
|
||||||
:is="listComponent"
|
:is="listComponent"
|
||||||
|
:incremental-loading-indicator="showIncrementalLoadingIndicator"
|
||||||
|
:rows="rows"
|
||||||
v-bind="$data"
|
v-bind="$data"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -368,16 +368,19 @@ export default {
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isManualRefreshLoading(neu, old) {
|
isManualRefreshLoading: {
|
||||||
this.currentPhase = neu ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION;
|
handler(neu, old) {
|
||||||
|
this.currentPhase = neu ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION;
|
||||||
|
|
||||||
// setTimeout is needed so that this is pushed further back on the JS computing queue
|
// setTimeout is needed so that this is pushed further back on the JS computing queue
|
||||||
// because nextTick isn't enough to capture the DOM update for the manual refresh only scenario
|
// because nextTick isn't enough to capture the DOM update for the manual refresh only scenario
|
||||||
if (old && !neu) {
|
if (old && !neu) {
|
||||||
this.manualRefreshTimer = setTimeout(() => {
|
this.manualRefreshTimer = setTimeout(() => {
|
||||||
this.watcherUpdateLiveAndDelayed(neu, old);
|
this.watcherUpdateLiveAndDelayed(neu, old);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import { HIDE_DESC, mapPref } from '@shell/store/prefs';
|
import { HIDE_DESC, mapPref } from '@shell/store/prefs';
|
||||||
import { addObject } from '@shell/utils/array';
|
import { addObject } from '@shell/utils/array';
|
||||||
|
import { CATALOG } from '@shell/config/types';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Banner },
|
components: { Banner },
|
||||||
|
|
@ -14,10 +16,17 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['currentCluster']),
|
||||||
hideDescriptions: mapPref(HIDE_DESC),
|
hideDescriptions: mapPref(HIDE_DESC),
|
||||||
|
|
||||||
typeDescriptionKey() {
|
typeDescriptionKey() {
|
||||||
const key = `typeDescription."${ this.resource }"`;
|
let key;
|
||||||
|
|
||||||
|
if (this.resource === CATALOG.CLUSTER_REPO) {
|
||||||
|
key = !this.currentCluster || this.currentCluster.isLocal ? 'typeDescription."catalog.cattle.io.clusterrepo.local"' : 'typeDescription."catalog.cattle.io.clusterrepo"';
|
||||||
|
} else {
|
||||||
|
key = `typeDescription."${ this.resource }"`;
|
||||||
|
}
|
||||||
|
|
||||||
if ( this.hideDescriptions.includes(this.resource) || this.hideDescriptions.includes('ALL') ) {
|
if ( this.hideDescriptions.includes(this.resource) || this.hideDescriptions.includes('ALL') ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -80,6 +85,7 @@ export default {
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,11 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -89,13 +94,14 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<FleetIntro v-if="noRows" />
|
<FleetIntro v-if="noRows && !loading" />
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
v-if="!noRows"
|
v-if="!noRows"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,6 @@ export function init(store) {
|
||||||
weightType(CAPI.MACHINE, 1, true);
|
weightType(CAPI.MACHINE, 1, true);
|
||||||
weightType(CATALOG.CLUSTER_REPO, 0, true);
|
weightType(CATALOG.CLUSTER_REPO, 0, true);
|
||||||
|
|
||||||
configureType(CATALOG.CLUSTER_REPO, { showListMasthead: false });
|
|
||||||
|
|
||||||
basicType([
|
basicType([
|
||||||
CAPI.MACHINE_DEPLOYMENT,
|
CAPI.MACHINE_DEPLOYMENT,
|
||||||
CAPI.MACHINE_SET,
|
CAPI.MACHINE_SET,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListApps',
|
name: 'ListApps',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
|
|
@ -21,18 +22,18 @@ export default {
|
||||||
async fetch() {
|
async fetch() {
|
||||||
await this.$store.dispatch('catalog/load');
|
await this.$store.dispatch('catalog/load');
|
||||||
|
|
||||||
this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: null };
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable
|
||||||
<ResourceTable v-else class="apps" :schema="schema" :rows="rows">
|
class="apps"
|
||||||
|
:schema="schema"
|
||||||
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
|
>
|
||||||
<template #cell:upgrade="{row}">
|
<template #cell:upgrade="{row}">
|
||||||
<span v-if="row.upgradeAvailable" class="badge-state bg-warning hand" @click="row.goToUpgrade(row.upgradeAvailable)">
|
<span v-if="row.upgradeAvailable" class="badge-state bg-warning hand" @click="row.goToUpgrade(row.upgradeAvailable)">
|
||||||
{{ row.upgradeAvailable }}
|
{{ row.upgradeAvailable }}
|
||||||
|
|
|
||||||
|
|
@ -1,64 +1,24 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Masthead from '@shell/components/ResourceList/Masthead';
|
|
||||||
import { Banner } from '@components/Banner';
|
|
||||||
import { HIDE_DESC, mapPref } from '@shell/store/prefs';
|
|
||||||
import { addObject } from '@shell/utils/array';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListClusterReposApps',
|
name: 'ListClusterReposApps',
|
||||||
components: {
|
components: { ResourceTable },
|
||||||
Banner,
|
props: {
|
||||||
Masthead,
|
|
||||||
ResourceTable
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
rows: {
|
rows: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
computed: {
|
required: false,
|
||||||
...mapGetters(['currentCluster']),
|
|
||||||
hideDescriptions: mapPref(HIDE_DESC),
|
|
||||||
|
|
||||||
typeDescriptionKey() {
|
|
||||||
// Show a different message to cover support for RKE templates in the local cluster
|
|
||||||
// (no current cluster means catalog requests default to local)
|
|
||||||
const key = !this.currentCluster || this.currentCluster.isLocal ? 'typeDescription."catalog.cattle.io.clusterrepo.local"' : 'typeDescription."catalog.cattle.io.clusterrepo"';
|
|
||||||
|
|
||||||
if ( this.hideDescriptions.includes(this.resource) || this.hideDescriptions.includes('ALL') ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( this.$store.getters['i18n/exists'](key) ) {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
hideTypeDescription() {
|
|
||||||
const neu = this.hideDescriptions.slice();
|
|
||||||
|
|
||||||
addObject(neu, this.resource);
|
|
||||||
|
|
||||||
this.hideDescriptions = neu;
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -66,25 +26,10 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Masthead
|
|
||||||
:schema="schema"
|
|
||||||
:resource="resource"
|
|
||||||
>
|
|
||||||
<template #typeDescription>
|
|
||||||
<Banner
|
|
||||||
v-if="typeDescriptionKey"
|
|
||||||
class="type-banner mb-20 mt-0"
|
|
||||||
color="info"
|
|
||||||
:closable="true"
|
|
||||||
:label-key="typeDescriptionKey"
|
|
||||||
@close="hideTypeDescription"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</Masthead>
|
|
||||||
|
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { get } from '@shell/utils/object';
|
import { get } from '@shell/utils/object';
|
||||||
import { AGE } from '@shell/config/table-headers';
|
import { AGE } from '@shell/config/table-headers';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -20,11 +20,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: null };
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -53,12 +49,16 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
return headersFromSchema;
|
return headersFromSchema;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable
|
||||||
<ResourceTable v-else :schema="schema" :rows="rows" :headers="headers" />
|
:schema="schema"
|
||||||
|
:rows="rows"
|
||||||
|
:headers="headers"
|
||||||
|
:loading="loading"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { FLEET } from '@shell/config/types';
|
import { FLEET } from '@shell/config/types';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
import {
|
import {
|
||||||
AGE,
|
AGE,
|
||||||
STATE,
|
STATE,
|
||||||
|
|
@ -12,11 +12,13 @@ import { isHarvesterCluster } from '@shell/utils/cluster';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListBundle',
|
name: 'ListBundle',
|
||||||
components: {
|
components: { Banner, ResourceTable },
|
||||||
Banner, Loading, ResourceTable
|
mixins: [ResourceFetch],
|
||||||
},
|
props: {
|
||||||
|
resource: {
|
||||||
props: {
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -24,15 +26,12 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
this.allBundles = await this.$store.dispatch('management/findAll', { type: FLEET.BUNDLE });
|
await this.$fetchType(FLEET.BUNDLE);
|
||||||
this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { allFleet: [] };
|
||||||
allFleet: [],
|
|
||||||
allBundles: [],
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -51,7 +50,7 @@ export default {
|
||||||
bundles() {
|
bundles() {
|
||||||
const harvester = this.harvesterClusters;
|
const harvester = this.harvesterClusters;
|
||||||
|
|
||||||
return this.allBundles.filter((bundle) => {
|
return this.rows.filter((bundle) => {
|
||||||
const targets = bundle.spec?.targets || [];
|
const targets = bundle.spec?.targets || [];
|
||||||
|
|
||||||
// Filter out any bundle that has one target whose cluster is a harvester cluster
|
// Filter out any bundle that has one target whose cluster is a harvester cluster
|
||||||
|
|
@ -64,7 +63,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
hidden() {
|
hidden() {
|
||||||
return this.allBundles.length - this.bundles.length;
|
return this.rows.length - this.bundles.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
headers() {
|
headers() {
|
||||||
|
|
@ -84,25 +83,31 @@ export default {
|
||||||
return out;
|
return out;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// override with relevant info for the loading indicator since this doesn't use it's own masthead
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [FLEET.BUNDLE],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<Banner v-if="hidden" color="info" :label="t('fleet.bundles.harvester', {count: hidden} )" />
|
||||||
<div v-else>
|
<ResourceTable
|
||||||
<Banner v-if="hidden" color="info" :label="t('fleet.bundles.harvester', {count: hidden} )" />
|
:schema="schema"
|
||||||
<ResourceTable
|
:headers="headers"
|
||||||
:schema="schema"
|
:rows="bundles"
|
||||||
:headers="headers"
|
:loading="loading"
|
||||||
:rows="bundles"
|
>
|
||||||
>
|
<template #cell:deploymentsReady="{row}">
|
||||||
<template #cell:deploymentsReady="{row}">
|
<span v-if="row.status.summary.desiredReady != row.status.summary.ready" class="text-warning">
|
||||||
<span v-if="row.status.summary.desiredReady != row.status.summary.ready" class="text-warning">
|
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
|
||||||
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
|
<span v-else>{{ row.status.summary.desiredReady }}</span>
|
||||||
<span v-else>{{ row.status.summary.desiredReady }}</span>
|
</template>
|
||||||
</template>
|
</ResourceTable>
|
||||||
</ResourceTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
<script>
|
<script>
|
||||||
import FleetClusters from '@shell/components/fleet/FleetClusters';
|
import FleetClusters from '@shell/components/fleet/FleetClusters';
|
||||||
import { FLEET, MANAGEMENT } from '@shell/config/types';
|
import { FLEET, MANAGEMENT } from '@shell/config/types';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { isHarvesterCluster } from '@shell/utils/cluster';
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListCluster',
|
name: 'ListCluster',
|
||||||
components: {
|
components: { Banner, FleetClusters },
|
||||||
Banner, FleetClusters, Loading
|
mixins: [ResourceFetch],
|
||||||
},
|
props: {
|
||||||
|
resource: {
|
||||||
props: {
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -21,19 +23,16 @@ export default {
|
||||||
async fetch() {
|
async fetch() {
|
||||||
await this.$store.dispatch('management/findAll', { type: FLEET.WORKSPACE });
|
await this.$store.dispatch('management/findAll', { type: FLEET.WORKSPACE });
|
||||||
this.allMgmt = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
|
this.allMgmt = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
|
||||||
this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
await this.$fetchType(FLEET.CLUSTER);
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { allMgmt: [] };
|
||||||
allMgmt: null,
|
|
||||||
allFleet: null,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
allClusters() {
|
allClusters() {
|
||||||
const out = this.allFleet.slice();
|
const out = this.rows.slice();
|
||||||
|
|
||||||
const known = {};
|
const known = {};
|
||||||
|
|
||||||
|
|
@ -50,7 +49,7 @@ export default {
|
||||||
return out;
|
return out;
|
||||||
},
|
},
|
||||||
|
|
||||||
rows() {
|
filteredRows() {
|
||||||
return this.fleetClusters.filter(c => !isHarvesterCluster(c));
|
return this.fleetClusters.filter(c => !isHarvesterCluster(c));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -59,21 +58,26 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
hiddenHarvesterCount() {
|
hiddenHarvesterCount() {
|
||||||
return this.fleetClusters.length - this.rows.length;
|
return this.fleetClusters.length - this.filteredRows.length;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// override with relevant info for the loading indicator since this doesn't use it's own masthead
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [FLEET.CLUSTER],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<Banner v-if="hiddenHarvesterCount" color="info" :label="t('fleet.clusters.harvester', {count: hiddenHarvesterCount} )" />
|
||||||
<div v-else>
|
<FleetClusters
|
||||||
<Banner v-if="hiddenHarvesterCount" color="info" :label="t('fleet.clusters.harvester', {count: hiddenHarvesterCount} )" />
|
:rows="filteredRows"
|
||||||
<FleetClusters
|
:schema="schema"
|
||||||
:rows="rows"
|
:loading="loading"
|
||||||
:schema="schema"
|
/>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -57,6 +62,7 @@ export default {
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
<script>
|
<script>
|
||||||
import { FLEET } from '@shell/config/types';
|
import { FLEET } from '@shell/config/types';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import { isHarvesterCluster } from '@shell/utils/cluster';
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListClusterGroup',
|
name: 'ListClusterGroup',
|
||||||
components: {
|
components: { Banner, ResourceTable },
|
||||||
Banner, Loading, ResourceTable
|
mixins: [ResourceFetch],
|
||||||
},
|
props: {
|
||||||
|
resource: {
|
||||||
props: {
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -19,15 +21,12 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
this.allTokens = await this.$store.dispatch('management/findAll', { type: FLEET.TOKEN });
|
await this.$fetchType(FLEET.TOKEN);
|
||||||
this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { allFleet: [] };
|
||||||
allFleet: null,
|
|
||||||
allTokens: null,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -45,7 +44,7 @@ export default {
|
||||||
tokens() {
|
tokens() {
|
||||||
const harvester = this.harvesterClusters;
|
const harvester = this.harvesterClusters;
|
||||||
|
|
||||||
return this.allTokens.filter((token) => {
|
return this.rows.filter((token) => {
|
||||||
const refs = token.metadata?.ownerReferences || [];
|
const refs = token.metadata?.ownerReferences || [];
|
||||||
|
|
||||||
for (const owner of refs) {
|
for (const owner of refs) {
|
||||||
|
|
@ -59,23 +58,28 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
hidden() {
|
hidden() {
|
||||||
return this.allTokens.length - this.tokens.length;
|
return this.rows.length - this.tokens.length;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
// override with relevant info for the loading indicator since this doesn't use it's own masthead
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [FLEET.TOKEN],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<Banner v-if="hidden" color="info" :label="t('fleet.tokens.harvester', {count: hidden} )" />
|
||||||
<div v-else>
|
<ResourceTable
|
||||||
<Banner v-if="hidden" color="info" :label="t('fleet.tokens.harvester', {count: hidden} )" />
|
v-bind="$attrs"
|
||||||
<ResourceTable
|
:schema="schema"
|
||||||
v-bind="$attrs"
|
:rows="tokens"
|
||||||
:schema="schema"
|
:loading="loading"
|
||||||
:rows="tokens"
|
>
|
||||||
>
|
</ResourceTable>
|
||||||
</ResourceTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import FleetRepos from '@shell/components/fleet/FleetRepos';
|
import FleetRepos from '@shell/components/fleet/FleetRepos';
|
||||||
import Masthead from '@shell/components/ResourceList/Masthead';
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { FLEET } from '@shell/config/types';
|
import { FLEET } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListGitRepo',
|
name: 'ListGitRepo',
|
||||||
components: {
|
components: {
|
||||||
Loading,
|
|
||||||
FleetRepos,
|
FleetRepos,
|
||||||
Masthead,
|
Masthead,
|
||||||
},
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -22,6 +21,21 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadResources: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
loadIndeterminate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
incrementalLoadingIndicator: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
|
|
@ -30,28 +44,25 @@ export default {
|
||||||
await store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
await store.dispatch('management/findAll', { type: FLEET.CLUSTER });
|
||||||
await store.dispatch('management/findAll', { type: FLEET.CLUSTER_GROUP });
|
await store.dispatch('management/findAll', { type: FLEET.CLUSTER_GROUP });
|
||||||
|
|
||||||
const inStore = store.getters['currentStore'](this.resource);
|
await this.$fetchType(this.resource);
|
||||||
|
}
|
||||||
this.rows = await store.dispatch(`${ inStore }/findAll`, { type: this.resource });
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: null };
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<div>
|
||||||
<div v-else>
|
|
||||||
<Masthead
|
<Masthead
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:resource="resource"
|
:resource="resource"
|
||||||
|
:show-incremental-loading-indicator="incrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
:create-button-label="t('fleet.gitRepo.repo.addRepo')"
|
:create-button-label="t('fleet.gitRepo.repo.addRepo')"
|
||||||
/>
|
/>
|
||||||
<FleetRepos
|
<FleetRepos
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
|
:loading="loading"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,40 @@
|
||||||
<script>
|
<script>
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Masthead from '@shell/components/ResourceList/Masthead';
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import { HELM } from '@shell/config/types';
|
import { HELM } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Loading, ResourceTable, Masthead, Banner
|
ResourceTable, Masthead, Banner
|
||||||
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
loadResources: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
loadIndeterminate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
incrementalLoadingIndicator: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async fetch() {
|
async fetch() {
|
||||||
this.projectHelmChartSchema = this.$store.getters['cluster/schemaFor'](HELM.PROJECTHELMCHART);
|
this.projectHelmChartSchema = this.$store.getters['cluster/schemaFor'](HELM.PROJECTHELMCHART);
|
||||||
|
await this.$fetchType(HELM.PROJECTHELMCHART);
|
||||||
|
|
||||||
this.projectHelmCharts = await this.$store.dispatch('cluster/findAll', { type: HELM.PROJECTHELMCHART } );
|
|
||||||
this.pending = false;
|
|
||||||
this.$store.dispatch('type-map/configureType', { match: HELM.PROJECTHELMCHART, isCreatable: true });
|
this.$store.dispatch('type-map/configureType', { match: HELM.PROJECTHELMCHART, isCreatable: true });
|
||||||
this.headers = this.$store.getters['type-map/headersFor'](this.projectHelmChartSchema).map((header) => {
|
this.headers = this.$store.getters['type-map/headersFor'](this.projectHelmChartSchema).map((header) => {
|
||||||
if (header.name === 'name') {
|
if (header.name === 'name') {
|
||||||
|
|
@ -30,11 +51,8 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
resource: HELM.PROJECTHELMCHART,
|
projectHelmChartSchema: null,
|
||||||
projectHelmChartSchema: null,
|
headers: null,
|
||||||
projectHelmCharts: [],
|
|
||||||
pending: true,
|
|
||||||
headers: null
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -51,35 +69,36 @@ export default {
|
||||||
<Masthead
|
<Masthead
|
||||||
:schema="projectHelmChartSchema"
|
:schema="projectHelmChartSchema"
|
||||||
:resource="resource"
|
:resource="resource"
|
||||||
|
:show-incremental-loading-indicator="incrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
is-creatable
|
is-creatable
|
||||||
/>
|
/>
|
||||||
<Banner color="info" :label="t('monitoring.projectMonitoring.list.banner')" />
|
<Banner color="info" :label="t('monitoring.projectMonitoring.list.banner')" />
|
||||||
<Loading v-if="pending" />
|
<!-- ToDo: figure out how to get this centered in the empty space -->
|
||||||
<div v-else>
|
<div v-if="rows.length === 0 && !loading" class="empty-list">
|
||||||
<!-- ToDo: figure out how to get this centered in the empty space -->
|
<div class="message">
|
||||||
<div v-if="projectHelmCharts.length === 0" class="empty-list">
|
<i class="icon icon-monitoring icon-10x icon-grey"></i>
|
||||||
<div class="message">
|
<div class="text-large">
|
||||||
<i class="icon icon-monitoring icon-10x icon-grey"></i>
|
{{ t('monitoring.projectMonitoring.list.empty.message') }}
|
||||||
<div class="text-large">
|
</div>
|
||||||
{{ t('monitoring.projectMonitoring.list.empty.message') }}
|
<div v-if="canCreateProjectHelmChart" class="text-large">
|
||||||
</div>
|
{{ t('monitoring.projectMonitoring.list.empty.canCreate') }}
|
||||||
<div v-if="canCreateProjectHelmChart" class="text-large">
|
</div>
|
||||||
{{ t('monitoring.projectMonitoring.list.empty.canCreate') }}
|
<div v-else class="text-large">
|
||||||
</div>
|
{{ t('monitoring.projectMonitoring.list.empty.cannotCreate') }}
|
||||||
<div v-else class="text-large">
|
|
||||||
{{ t('monitoring.projectMonitoring.list.empty.cannotCreate') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
</div>
|
||||||
<ResourceTable
|
<div v-else>
|
||||||
:rows="projectHelmCharts"
|
<ResourceTable
|
||||||
:headers="headers"
|
:rows="rows"
|
||||||
:schema="projectHelmChartSchema"
|
:headers="headers"
|
||||||
key-field="_key"
|
:schema="projectHelmChartSchema"
|
||||||
:groupable="false"
|
:loading="loading"
|
||||||
/>
|
key-field="_key"
|
||||||
</div>
|
:groupable="false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { LOGGING } from '@shell/config/types';
|
import { LOGGING } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListApps',
|
name: 'ListApps',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -21,16 +21,11 @@ export default {
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
|
await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
|
||||||
this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
},
|
}
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: null };
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable :schema="schema" :rows="rows" :loading="loading" />
|
||||||
<ResourceTable v-else-if="rows" :schema="schema" :rows="rows" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { LOGGING } from '@shell/config/types';
|
import { LOGGING } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
export default {
|
export default {
|
||||||
name: 'ListApps',
|
name: 'ListApps',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -24,18 +23,12 @@ export default {
|
||||||
await this.$store.dispatch('cluster/findAll', { type: LOGGING.OUTPUT });
|
await this.$store.dispatch('cluster/findAll', { type: LOGGING.OUTPUT });
|
||||||
await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
|
await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
const rows = await this.$store.dispatch('cluster/findAll', { type: LOGGING.FLOW });
|
|
||||||
|
|
||||||
this.rows = rows;
|
await this.$fetchType(LOGGING.FLOW);
|
||||||
},
|
}
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: [] };
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable :schema="schema" :rows="rows" :loading="loading" />
|
||||||
<ResourceTable v-else :schema="schema" :rows="rows" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,42 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { MANAGEMENT } from '@shell/config/types';
|
import { MANAGEMENT } from '@shell/config/types';
|
||||||
import { filterOnlyKubernetesClusters } from '@shell/utils/cluster';
|
import { filterOnlyKubernetesClusters } from '@shell/utils/cluster';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
export default {
|
export default {
|
||||||
name: 'ListMgmtClusters',
|
name: 'ListMgmtClusters',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
|
||||||
async fetch() {
|
props: {
|
||||||
await this.$store.dispatch(`${ this.inStore }/findAll`, { type: this.$attrs.resource });
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
schema: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async fetch() {
|
||||||
|
await this.$fetchType(this.resource);
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
inStore() {
|
filteredRows() {
|
||||||
return this.$store.getters['currentProduct'].inStore;
|
return filterOnlyKubernetesClusters(this.rows);
|
||||||
},
|
|
||||||
rows() {
|
|
||||||
const all = this.$store.getters[`${ this.inStore }/all`](MANAGEMENT.CLUSTER);
|
|
||||||
|
|
||||||
return filterOnlyKubernetesClusters(all);
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
// override with relevant info for the loading indicator since this doesn't use it's own masthead
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [MANAGEMENT.CLUSTER],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable :schema="schema" :rows="filteredRows" :headers="$attrs.headers" :group-by="$attrs.groupBy" :loading="loading" />
|
||||||
<ResourceTable v-else :schema="$attrs.schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,22 @@ import { mapState, mapGetters } from 'vuex';
|
||||||
import AsyncButton from '@shell/components/AsyncButton';
|
import AsyncButton from '@shell/components/AsyncButton';
|
||||||
import { Card } from '@components/Card';
|
import { Card } from '@components/Card';
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import { LabeledInput } from '@components/Form/LabeledInput';
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
||||||
import { MANAGEMENT } from '@shell/config/types';
|
import { MANAGEMENT } from '@shell/config/types';
|
||||||
import { SETTING } from '@shell/config/settings';
|
import { SETTING } from '@shell/config/settings';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AsyncButton,
|
AsyncButton,
|
||||||
Banner,
|
Banner,
|
||||||
Card,
|
Card,
|
||||||
Loading,
|
|
||||||
ResourceTable,
|
ResourceTable,
|
||||||
LabeledInput
|
LabeledInput
|
||||||
},
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -32,7 +31,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
this.rows = await this.$store.dispatch('management/findAll', { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
|
|
||||||
this.serverUrlSetting = this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SERVER_URL);
|
this.serverUrlSetting = this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SERVER_URL);
|
||||||
|
|
||||||
|
|
@ -52,7 +51,6 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rows: null,
|
|
||||||
update: [],
|
update: [],
|
||||||
updateMode: 'activate',
|
updateMode: 'activate',
|
||||||
error: null,
|
error: null,
|
||||||
|
|
@ -85,6 +83,13 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [MANAGEMENT.FEATURE],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
showPromptUpdate(show) {
|
showPromptUpdate(show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
|
|
@ -184,12 +189,12 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<div>
|
||||||
<div v-else>
|
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:rows="filteredRows"
|
:rows="filteredRows"
|
||||||
:row-actions="enableRowActions"
|
:row-actions="enableRowActions"
|
||||||
|
:loading="loading"
|
||||||
>
|
>
|
||||||
<template slot="cell:name" slot-scope="scope">
|
<template slot="cell:name" slot-scope="scope">
|
||||||
<div class="feature-name">
|
<div class="feature-name">
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,45 @@
|
||||||
<script>
|
<script>
|
||||||
import AsyncButton from '@shell/components/AsyncButton';
|
import AsyncButton from '@shell/components/AsyncButton';
|
||||||
import { NORMAN } from '@shell/config/types';
|
import { MANAGEMENT, NORMAN } from '@shell/config/types';
|
||||||
import { NAME } from '@shell/config/product/auth';
|
import { NAME } from '@shell/config/product/auth';
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import Masthead from '@shell/components/ResourceList/Masthead';
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AsyncButton,
|
AsyncButton,
|
||||||
Loading,
|
|
||||||
ResourceTable,
|
ResourceTable,
|
||||||
Masthead
|
Masthead
|
||||||
},
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
loadResources: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
loadIndeterminate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
incrementalLoadingIndicator: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
},
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const store = this.$store;
|
const store = this.$store;
|
||||||
const resource = this.resource;
|
|
||||||
|
|
||||||
await store.dispatch(`rancher/findAll`, { type: NORMAN.USER });
|
await store.dispatch(`rancher/findAll`, { type: NORMAN.USER });
|
||||||
|
|
||||||
this.allUsers = await store.dispatch(`management/findAll`, { type: resource });
|
await this.$fetchType(this.resource);
|
||||||
|
|
||||||
this.canRefreshAccess = await this.$store.dispatch('rancher/request', { url: '/v3/users?limit=0' })
|
this.canRefreshAccess = await this.$store.dispatch('rancher/request', { url: '/v3/users?limit=0' })
|
||||||
.then(res => !!res?.actions?.refreshauthprovideraccess);
|
.then(res => !!res?.actions?.refreshauthprovideraccess);
|
||||||
|
|
@ -28,21 +47,19 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
const getters = this.$store.getters;
|
const getters = this.$store.getters;
|
||||||
const params = { ...this.$route.params };
|
|
||||||
|
|
||||||
const resource = params.resource;
|
const schema = getters[`management/schemaFor`](this.resource);
|
||||||
|
|
||||||
const schema = getters[`management/schemaFor`](resource);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
schema,
|
schema,
|
||||||
resource,
|
|
||||||
|
|
||||||
// Provided by fetch later
|
|
||||||
rows: null,
|
|
||||||
canRefreshAccess: false,
|
canRefreshAccess: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
allUsers: null,
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [MANAGEMENT.USER],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -56,7 +73,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
users() {
|
users() {
|
||||||
if ( !this.allUsers ) {
|
if ( !this.rows ) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +81,7 @@ export default {
|
||||||
// 1) Only show system users in explorer/users and not in auth/users
|
// 1) Only show system users in explorer/users and not in auth/users
|
||||||
// 2) Supplement user with info to enable/disable the refresh group membership action (this is not persisted on save)
|
// 2) Supplement user with info to enable/disable the refresh group membership action (this is not persisted on save)
|
||||||
const params = { ...this.$route.params };
|
const params = { ...this.$route.params };
|
||||||
const requiredUsers = params.product === NAME ? this.allUsers.filter(a => !a.isSystem) : this.allUsers;
|
const requiredUsers = params.product === NAME ? this.rows.filter(a => !a.isSystem) : this.rows;
|
||||||
|
|
||||||
requiredUsers.forEach((r) => {
|
requiredUsers.forEach((r) => {
|
||||||
r.canRefreshAccess = this.canRefreshAccess;
|
r.canRefreshAccess = this.canRefreshAccess;
|
||||||
|
|
@ -94,11 +111,13 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<div>
|
||||||
<div v-else>
|
|
||||||
<Masthead
|
<Masthead
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:resource="resource"
|
:resource="resource"
|
||||||
|
:show-incremental-loading-indicator="incrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
>
|
>
|
||||||
<template slot="extraActions">
|
<template slot="extraActions">
|
||||||
<AsyncButton
|
<AsyncButton
|
||||||
|
|
@ -113,7 +132,7 @@ export default {
|
||||||
</template>
|
</template>
|
||||||
</Masthead>
|
</Masthead>
|
||||||
|
|
||||||
<ResourceTable :schema="schema" :rows="users" :group-by="groupBy" />
|
<ResourceTable :schema="schema" :rows="users" :group-by="groupBy" :loading="loading" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import { MONITORING } from '@shell/config/types';
|
import { MONITORING } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
export default {
|
export default {
|
||||||
name: 'ListApps',
|
name: 'ListApps',
|
||||||
components: {
|
components: { Banner, ResourceTable },
|
||||||
Banner, Loading, ResourceTable
|
mixins: [ResourceFetch],
|
||||||
},
|
props: {
|
||||||
|
|
||||||
props: {
|
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -25,27 +22,23 @@ export default {
|
||||||
async fetch() {
|
async fetch() {
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('cluster/findAll', { type: MONITORING.ALERTMANAGERCONFIG });
|
await this.$store.dispatch('cluster/findAll', { type: MONITORING.ALERTMANAGERCONFIG });
|
||||||
this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: null };
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<div v-if="rows.length || loading">
|
||||||
<div v-else-if="rows.length > 0">
|
|
||||||
<Banner color="info">
|
<Banner color="info">
|
||||||
{{ t('monitoring.alertmanagerConfig.description') }}
|
{{ t('monitoring.alertmanagerConfig.description') }}
|
||||||
</Banner>
|
</Banner>
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ export default {
|
||||||
name: 'ListNamespace',
|
name: 'ListNamespace',
|
||||||
components: { ResourceTable },
|
components: { ResourceTable },
|
||||||
props: {
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -14,6 +18,10 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -28,7 +36,11 @@ export default {
|
||||||
return this.rows;
|
return this.rows;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
|
$loadingResources() {
|
||||||
|
return { loadIndeterminate: true };
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -39,6 +51,7 @@ export default {
|
||||||
:groupable="false"
|
:groupable="false"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
key-field="_key"
|
key-field="_key"
|
||||||
|
:loading="loading"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import Tag from '@shell/components/Tag';
|
import Tag from '@shell/components/Tag';
|
||||||
import { Banner } from '@components/Banner';
|
import { Banner } from '@components/Banner';
|
||||||
import {
|
import {
|
||||||
|
|
@ -16,18 +15,21 @@ import { allHash } from '@shell/utils/promise';
|
||||||
import { get } from '@shell/utils/object';
|
import { get } from '@shell/utils/object';
|
||||||
import { GROUP_RESOURCES, mapPref } from '@shell/store/prefs';
|
import { GROUP_RESOURCES, mapPref } from '@shell/store/prefs';
|
||||||
import { COLUMN_BREAKPOINTS } from '@shell/components/SortableTable/index.vue';
|
import { COLUMN_BREAKPOINTS } from '@shell/components/SortableTable/index.vue';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
export default {
|
export default {
|
||||||
name: 'ListNode',
|
name: 'ListNode',
|
||||||
components: {
|
components: {
|
||||||
Loading,
|
|
||||||
ResourceTable,
|
ResourceTable,
|
||||||
Tag,
|
Tag,
|
||||||
Banner
|
Banner
|
||||||
},
|
},
|
||||||
mixins: [metricPoller],
|
mixins: [metricPoller, ResourceFetch],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -35,7 +37,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const hash = { kubeNodes: this.$store.dispatch('cluster/findAll', { type: NODE }) };
|
const hash = { kubeNodes: this.$fetchType(NODE) };
|
||||||
|
|
||||||
this.canViewPods = this.$store.getters[`cluster/schemaFor`](POD);
|
this.canViewPods = this.$store.getters[`cluster/schemaFor`](POD);
|
||||||
|
|
||||||
|
|
@ -58,16 +60,11 @@ export default {
|
||||||
this.$store.dispatch('cluster/findAll', { type: POD });
|
this.$store.dispatch('cluster/findAll', { type: POD });
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await allHash(hash);
|
await allHash(hash);
|
||||||
|
|
||||||
this.kubeNodes = res.kubeNodes;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { canViewPods: false };
|
||||||
kubeNodes: null,
|
|
||||||
canViewPods: false,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|
@ -79,7 +76,7 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
hasWindowsNodes() {
|
hasWindowsNodes() {
|
||||||
return (this.kubeNodes || []).some(node => node.status.nodeInfo.operatingSystem === 'windows');
|
return (this.rows || []).some(node => node.status.nodeInfo.operatingSystem === 'windows');
|
||||||
},
|
},
|
||||||
tableGroup: mapPref(GROUP_RESOURCES),
|
tableGroup: mapPref(GROUP_RESOURCES),
|
||||||
|
|
||||||
|
|
@ -141,8 +138,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<div>
|
||||||
<div v-else>
|
|
||||||
<Banner
|
<Banner
|
||||||
v-if="hasWindowsNodes"
|
v-if="hasWindowsNodes"
|
||||||
color="info"
|
color="info"
|
||||||
|
|
@ -152,8 +148,9 @@ export default {
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:rows="kubeNodes"
|
:rows="rows"
|
||||||
:sub-rows="true"
|
:sub-rows="true"
|
||||||
|
:loading="loading"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
<template #sub-row="{fullColspan, row}">
|
<template #sub-row="{fullColspan, row}">
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,34 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { PVC } from '@shell/config/types';
|
import { PVC } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListPersistentVolume',
|
name: 'ListPersistentVolume',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
schema: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const inStore = this.$store.getters['currentStore']();
|
const inStore = this.$store.getters['currentStore']();
|
||||||
const pvcPromise = this.$store.dispatch(`${ inStore }/findAll`, { type: PVC });
|
const pvcPromise = this.$store.dispatch(`${ inStore }/findAll`, { type: PVC });
|
||||||
|
|
||||||
this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: this.$attrs.resource });
|
await this.$fetchType(this.resource);
|
||||||
await pvcPromise;
|
await pvcPromise;
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: [] };
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable :schema="schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" :loading="loading" />
|
||||||
<ResourceTable v-else :schema="$attrs.schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import { STORAGE_CLASS } from '@shell/config/types';
|
import { STORAGE_CLASS } from '@shell/config/types';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListPersistentVolumeClaim',
|
name: 'ListPersistentVolumeClaim',
|
||||||
components: { ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
props: {
|
props: {
|
||||||
resource: {
|
resource: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -24,18 +25,14 @@ export default {
|
||||||
// Fetch storage classes so we can determine if a PVC can be expanded
|
// Fetch storage classes so we can determine if a PVC can be expanded
|
||||||
this.$store.dispatch(`${ inStore }/findAll`, { type: STORAGE_CLASS });
|
this.$store.dispatch(`${ inStore }/findAll`, { type: STORAGE_CLASS });
|
||||||
|
|
||||||
this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: this.resource });
|
await this.$fetchType(this.resource);
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: [] };
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
:loading="$fetchState.pending"
|
:loading="loading"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -8,17 +8,35 @@ import { MODE, _IMPORT } from '@shell/config/query-params';
|
||||||
import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/utils/cluster';
|
import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/utils/cluster';
|
||||||
import { mapFeature, HARVESTER as HARVESTER_FEATURE } from '@shell/store/features';
|
import { mapFeature, HARVESTER as HARVESTER_FEATURE } from '@shell/store/features';
|
||||||
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Banner, ResourceTable, Masthead
|
Banner, ResourceTable, Masthead
|
||||||
},
|
},
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
props: {
|
||||||
|
loadResources: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
|
||||||
|
loadIndeterminate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
incrementalLoadingIndicator: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const hash = {
|
const hash = {
|
||||||
|
rancherClusters: this.$fetchType(CAPI.RANCHER_CLUSTER),
|
||||||
normanClusters: this.$store.dispatch('rancher/findAll', { type: NORMAN.CLUSTER }),
|
normanClusters: this.$store.dispatch('rancher/findAll', { type: NORMAN.CLUSTER }),
|
||||||
mgmtClusters: this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER }),
|
mgmtClusters: this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER }),
|
||||||
rancherClusters: this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( this.$store.getters['management/canList'](SNAPSHOT) ) {
|
if ( this.$store.getters['management/canList'](SNAPSHOT) ) {
|
||||||
|
|
@ -50,7 +68,6 @@ export default {
|
||||||
const res = await allHash(hash);
|
const res = await allHash(hash);
|
||||||
|
|
||||||
this.mgmtClusters = res.mgmtClusters;
|
this.mgmtClusters = res.mgmtClusters;
|
||||||
this.rancherClusters = res.rancherClusters;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -58,19 +75,18 @@ export default {
|
||||||
resource: CAPI.RANCHER_CLUSTER,
|
resource: CAPI.RANCHER_CLUSTER,
|
||||||
schema: this.$store.getters['management/schemaFor'](CAPI.RANCHER_CLUSTER),
|
schema: this.$store.getters['management/schemaFor'](CAPI.RANCHER_CLUSTER),
|
||||||
mgmtClusters: [],
|
mgmtClusters: [],
|
||||||
rancherClusters: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
rows() {
|
filteredRows() {
|
||||||
// If Harvester feature is enabled, hide Harvester Clusters
|
// If Harvester feature is enabled, hide Harvester Clusters
|
||||||
if (this.harvesterEnabled) {
|
if (this.harvesterEnabled) {
|
||||||
return filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.rancherClusters), this.$store);
|
return filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.rows), this.$store);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, show Harvester clusters - these will be shown with a warning
|
// Otherwise, show Harvester clusters - these will be shown with a warning
|
||||||
return filterHiddenLocalCluster(this.rancherClusters, this.$store);
|
return filterHiddenLocalCluster(this.rows, this.$store);
|
||||||
},
|
},
|
||||||
|
|
||||||
hiddenHarvesterCount() {
|
hiddenHarvesterCount() {
|
||||||
|
|
@ -82,7 +98,7 @@ export default {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.rancherClusters.length - filterOnlyKubernetesClusters(this.rancherClusters).length;
|
return this.rows.length - filterOnlyKubernetesClusters(this.rows).length;
|
||||||
},
|
},
|
||||||
|
|
||||||
createLocation() {
|
createLocation() {
|
||||||
|
|
@ -115,6 +131,13 @@ export default {
|
||||||
harvesterEnabled: mapFeature(HARVESTER_FEATURE),
|
harvesterEnabled: mapFeature(HARVESTER_FEATURE),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
$loadingResources() {
|
||||||
|
return {
|
||||||
|
loadResources: [CAPI.RANCHER_CLUSTER],
|
||||||
|
loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
window.c = this;
|
window.c = this;
|
||||||
},
|
},
|
||||||
|
|
@ -130,6 +153,9 @@ export default {
|
||||||
:resource="resource"
|
:resource="resource"
|
||||||
:create-location="createLocation"
|
:create-location="createLocation"
|
||||||
component-testid="cluster-manager-list"
|
component-testid="cluster-manager-list"
|
||||||
|
:show-incremental-loading-indicator="incrementalLoadingIndicator"
|
||||||
|
:load-resources="loadResources"
|
||||||
|
:load-indeterminate="loadIndeterminate"
|
||||||
>
|
>
|
||||||
<template v-if="canImport" slot="extraActions">
|
<template v-if="canImport" slot="extraActions">
|
||||||
<n-link
|
<n-link
|
||||||
|
|
@ -142,7 +168,7 @@ export default {
|
||||||
</template>
|
</template>
|
||||||
</Masthead>
|
</Masthead>
|
||||||
|
|
||||||
<ResourceTable :schema="schema" :rows="rows" :namespaced="false" :loading="$fetchState.pending">
|
<ResourceTable :schema="schema" :rows="filteredRows" :namespaced="false" :loading="loading">
|
||||||
<template #cell:summary="{row}">
|
<template #cell:summary="{row}">
|
||||||
<span v-if="!row.stateParts.length">{{ row.nodes.length }}</span>
|
<span v-if="!row.stateParts.length">{{ row.nodes.length }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,25 @@
|
||||||
<script>
|
<script>
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import Loading from '@shell/components/Loading';
|
|
||||||
import { NODE } from '@shell/config/types';
|
import { NODE } from '@shell/config/types';
|
||||||
import { allHash } from '@shell/utils/promise';
|
import { allHash } from '@shell/utils/promise';
|
||||||
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListService',
|
name: 'ListService',
|
||||||
components: { Loading, ResourceTable },
|
components: { ResourceTable },
|
||||||
|
mixins: [ResourceFetch],
|
||||||
|
props: {
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
schema: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// fetch nodes before loading this page, as they may be referenced in the Target table column
|
// fetch nodes before loading this page, as they may be referenced in the Target table column
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const store = this.$store;
|
const store = this.$store;
|
||||||
|
|
@ -21,23 +34,22 @@ export default {
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
const hash = { rows: store.dispatch(`${ inStore }/findAll`, { type: this.$attrs.resource }) };
|
const hash = { rows: this.$fetchType(this.resource) };
|
||||||
|
|
||||||
if (hasNodes) {
|
if (hasNodes) {
|
||||||
hash.nodes = store.dispatch(`${ inStore }/findAll`, { type: NODE });
|
hash.nodes = store.dispatch(`${ inStore }/findAll`, { type: NODE });
|
||||||
}
|
}
|
||||||
const res = await allHash(hash);
|
await allHash(hash);
|
||||||
|
|
||||||
this.rows = res.rows;
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { rows: [] };
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Loading v-if="$fetchState.pending" />
|
<ResourceTable
|
||||||
<ResourceTable v-else :schema="$attrs.schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" />
|
:schema="schema"
|
||||||
|
:rows="rows"
|
||||||
|
:headers="$attrs.headers"
|
||||||
|
:group-by="$attrs.groupBy"
|
||||||
|
:loading="loading"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: { ...mapGetters(['clusterId']) }
|
computed: { ...mapGetters(['clusterId']) }
|
||||||
|
|
@ -26,6 +31,7 @@ export default {
|
||||||
<ResourceTable
|
<ResourceTable
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:loading="loading"
|
||||||
>
|
>
|
||||||
<template #cell:to="{row}">
|
<template #cell:to="{row}">
|
||||||
<template v-if="row.spec && row.spec.toService">
|
<template v-if="row.spec && row.spec.toService">
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export default {
|
||||||
return schema;
|
return schema;
|
||||||
},
|
},
|
||||||
|
|
||||||
rows() {
|
filteredRows() {
|
||||||
const out = [];
|
const out = [];
|
||||||
|
|
||||||
for ( const typeRows of this.resources ) {
|
for ( const typeRows of this.resources ) {
|
||||||
|
|
@ -151,5 +151,5 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ResourceTable :loading="$fetchState.pending" :schema="schema" :rows="rows" :overflow-y="true" />
|
<ResourceTable :loading="$fetchState.pending" :schema="schema" :rows="filteredRows" :overflow-y="true" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,10 @@
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import {
|
import { COUNT, MANAGEMENT } from '@shell/config/types';
|
||||||
COUNT, MANAGEMENT, POD, WORKLOAD_TYPES, WORKLOAD, SECRET
|
|
||||||
} from '@shell/config/types';
|
|
||||||
import { SETTING, DEFAULT_PERF_SETTING } from '@shell/config/settings';
|
import { SETTING, DEFAULT_PERF_SETTING } from '@shell/config/settings';
|
||||||
|
|
||||||
// Number of pages to fetch when loading incrementally
|
// Number of pages to fetch when loading incrementally
|
||||||
const PAGES = 4;
|
const PAGES = 4;
|
||||||
|
|
||||||
// restrict advanced features of manual refresh and incremental loading to these resource types
|
|
||||||
export const TYPES_RESTRICTED = [
|
|
||||||
SECRET,
|
|
||||||
POD,
|
|
||||||
WORKLOAD_TYPES.DEPLOYMENT,
|
|
||||||
WORKLOAD_TYPES.CRON_JOB,
|
|
||||||
WORKLOAD_TYPES.DAEMON_SET,
|
|
||||||
WORKLOAD_TYPES.JOB,
|
|
||||||
WORKLOAD_TYPES.STATEFUL_SET,
|
|
||||||
WORKLOAD_TYPES.REPLICA_SET,
|
|
||||||
WORKLOAD_TYPES.REPLICATION_CONTROLLER,
|
|
||||||
WORKLOAD
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
// fetching the settings related to manual refresh from global settings
|
// fetching the settings related to manual refresh from global settings
|
||||||
|
|
@ -66,7 +50,17 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: { ...mapGetters({ refreshFlag: 'resource-fetch/refreshFlag' }) },
|
computed: {
|
||||||
|
...mapGetters({ refreshFlag: 'resource-fetch/refreshFlag' }),
|
||||||
|
rows() {
|
||||||
|
const inStore = this.$store.getters['currentStore'](this.resource);
|
||||||
|
|
||||||
|
return this.$store.getters[`${ inStore }/all`](this.resource);
|
||||||
|
},
|
||||||
|
loading() {
|
||||||
|
return this.rows.length ? false : this.$fetchState.pending;
|
||||||
|
},
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
refreshFlag(neu) {
|
refreshFlag(neu) {
|
||||||
// this is where the data assignment will trigger the update of the list view...
|
// this is where the data assignment will trigger the update of the list view...
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue