This commit is contained in:
Neil MacDougall 2021-05-23 20:22:17 +01:00
parent 4184260203
commit 9b7e0b74fc
4 changed files with 20 additions and 32 deletions

View File

@ -1,5 +1,5 @@
import { LEGACY } from '@/store/features';
import { DSL } from '@/store/type-map';
import { DSL, IF_HAVE } from '@/store/type-map';
export const NAME = 'legacy';
@ -50,7 +50,7 @@ export function init(store) {
});
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Project',
namespaced: true,
name: 'v1-project',
@ -62,7 +62,7 @@ export function init(store) {
});
virtualType({
ifHave: 'no-project',
ifHave: IF_HAVE.NO_PROJECT,
label: 'Project',
namespaced: true,
name: 'v1-project-overview',
@ -83,7 +83,7 @@ export function init(store) {
// Project Pages
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Alerts',
namespaced: true,
name: 'project-alerts',
@ -94,7 +94,7 @@ export function init(store) {
});
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Apps',
namespaced: true,
name: 'project-apps',
@ -105,7 +105,7 @@ export function init(store) {
});
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Catalogs',
namespaced: true,
name: 'project-catalogs',
@ -116,7 +116,7 @@ export function init(store) {
});
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Logging',
namespaced: true,
name: 'project-logging',
@ -127,7 +127,7 @@ export function init(store) {
});
virtualType({
ifHave: 'project',
ifHave: IF_HAVE.PROJECT,
label: 'Monitoring',
namespaced: true,
name: 'project-monitoring',

View File

@ -1,6 +1,11 @@
import { FEATURE_DESCRIPTION, RESTART, SIMPLE_NAME, STATE } from '@/config/table-headers';
import { MANAGEMENT } from '@/config/types';
import { DSL } from '@/store/type-map';
import { MANAGEMENT } from '@/config/types';
import {
STATE,
SIMPLE_NAME,
FEATURE_DESCRIPTION,
RESTART,
} from '@/config/table-headers';
export const NAME = 'settings';

View File

@ -22,8 +22,7 @@ export default {
this.showDeprecated = query[DEPRECATED] === _FLAGGED;
this.showHidden = query[HIDDEN] === _FLAGGED;
this.allInstalled = await this.$store.dispatch('cluster/findAll', { type: CATALOG.APP, opt: { force: true } });
// this.allInstalled = await this.$store.dispatch('cluster/findAll', { type: CATALOG.APP });
this.allInstalled = await this.$store.dispatch('cluster/findAll', { type: CATALOG.APP });
// If legacy feature flag enabled
if (this.legacyEnabled) {
@ -114,33 +113,15 @@ export default {
return [
this._legacyChart('monitoring'),
this._legacyChart('logging'),
// this._legacyChart('istio'),
];
}
},
mounted() {
window.c = this;
// start a timer
// this._checkMonitoring();
},
methods: {
// _checkMonitoring() {
// setTimeout(() => {
// console.log('>> V1 Monitoring >>>>>>>>>>>>>>>>>>');
// const s = this.currentCluster?.status;
// if (s) {
// console.log(JSON.parse(JSON.stringify(s)));
// } else {
// console.log('Monitoring not installed');
// }
// console.log(this.installedApps);
// this._checkMonitoring();
// }, 5000);
// },
_legacyChart(id) {
return {
certifiedSort: 1,

View File

@ -140,6 +140,8 @@ const instanceMethods = {};
export const IF_HAVE = {
V1_MONITORING: 'v1-monitoring',
V2_MONITORING: 'v2-monitoring',
PROJECT: 'project',
NO_PROJECT: 'no-project',
};
export function DSL(store, product, module = 'type-map') {
@ -1466,10 +1468,10 @@ function ifHave(getters, option) {
case IF_HAVE.V1_MONITORING: {
return haveV1Monitoring(getters);
}
case 'project': {
case IF_HAVE.PROJECT: {
return !!project(getters);
}
case 'no-project': {
case IF_HAVE.NO_PROJECT: {
return !project(getters);
}
default: