mirror of https://github.com/rancher/dashboard.git
Tidy ups
This commit is contained in:
parent
4184260203
commit
9b7e0b74fc
|
|
@ -1,5 +1,5 @@
|
||||||
import { LEGACY } from '@/store/features';
|
import { LEGACY } from '@/store/features';
|
||||||
import { DSL } from '@/store/type-map';
|
import { DSL, IF_HAVE } from '@/store/type-map';
|
||||||
|
|
||||||
export const NAME = 'legacy';
|
export const NAME = 'legacy';
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Project',
|
label: 'Project',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'v1-project',
|
name: 'v1-project',
|
||||||
|
|
@ -62,7 +62,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'no-project',
|
ifHave: IF_HAVE.NO_PROJECT,
|
||||||
label: 'Project',
|
label: 'Project',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'v1-project-overview',
|
name: 'v1-project-overview',
|
||||||
|
|
@ -83,7 +83,7 @@ export function init(store) {
|
||||||
// Project Pages
|
// Project Pages
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Alerts',
|
label: 'Alerts',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'project-alerts',
|
name: 'project-alerts',
|
||||||
|
|
@ -94,7 +94,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Apps',
|
label: 'Apps',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'project-apps',
|
name: 'project-apps',
|
||||||
|
|
@ -105,7 +105,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Catalogs',
|
label: 'Catalogs',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'project-catalogs',
|
name: 'project-catalogs',
|
||||||
|
|
@ -116,7 +116,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Logging',
|
label: 'Logging',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'project-logging',
|
name: 'project-logging',
|
||||||
|
|
@ -127,7 +127,7 @@ export function init(store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: 'project',
|
ifHave: IF_HAVE.PROJECT,
|
||||||
label: 'Monitoring',
|
label: 'Monitoring',
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'project-monitoring',
|
name: 'project-monitoring',
|
||||||
|
|
|
||||||
|
|
@ -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 { 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';
|
export const NAME = 'settings';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,7 @@ export default {
|
||||||
this.showDeprecated = query[DEPRECATED] === _FLAGGED;
|
this.showDeprecated = query[DEPRECATED] === _FLAGGED;
|
||||||
this.showHidden = query[HIDDEN] === _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 legacy feature flag enabled
|
||||||
if (this.legacyEnabled) {
|
if (this.legacyEnabled) {
|
||||||
|
|
@ -114,33 +113,15 @@ export default {
|
||||||
return [
|
return [
|
||||||
this._legacyChart('monitoring'),
|
this._legacyChart('monitoring'),
|
||||||
this._legacyChart('logging'),
|
this._legacyChart('logging'),
|
||||||
// this._legacyChart('istio'),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
window.c = this;
|
window.c = this;
|
||||||
|
|
||||||
// start a timer
|
|
||||||
// this._checkMonitoring();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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) {
|
_legacyChart(id) {
|
||||||
return {
|
return {
|
||||||
certifiedSort: 1,
|
certifiedSort: 1,
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,8 @@ const instanceMethods = {};
|
||||||
export const IF_HAVE = {
|
export const IF_HAVE = {
|
||||||
V1_MONITORING: 'v1-monitoring',
|
V1_MONITORING: 'v1-monitoring',
|
||||||
V2_MONITORING: 'v2-monitoring',
|
V2_MONITORING: 'v2-monitoring',
|
||||||
|
PROJECT: 'project',
|
||||||
|
NO_PROJECT: 'no-project',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function DSL(store, product, module = 'type-map') {
|
export function DSL(store, product, module = 'type-map') {
|
||||||
|
|
@ -1466,10 +1468,10 @@ function ifHave(getters, option) {
|
||||||
case IF_HAVE.V1_MONITORING: {
|
case IF_HAVE.V1_MONITORING: {
|
||||||
return haveV1Monitoring(getters);
|
return haveV1Monitoring(getters);
|
||||||
}
|
}
|
||||||
case 'project': {
|
case IF_HAVE.PROJECT: {
|
||||||
return !!project(getters);
|
return !!project(getters);
|
||||||
}
|
}
|
||||||
case 'no-project': {
|
case IF_HAVE.NO_PROJECT: {
|
||||||
return !project(getters);
|
return !project(getters);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue