mirror of https://github.com/rancher/ui.git
Merge pull request #4201 from westlywright/bug.project.mon.link
Monitoring Enabled Warning to Project Monitoring
This commit is contained in:
commit
9d7df49809
|
|
@ -2,18 +2,18 @@ import Route from '@ember/routing/route';
|
|||
import { get, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { on } from '@ember/object/evented';
|
||||
import { hash } from 'rsvp';
|
||||
import C from 'ui/utils/constants';
|
||||
|
||||
export default Route.extend({
|
||||
session: service(),
|
||||
store: service(),
|
||||
clusterStore: service(),
|
||||
|
||||
model() {
|
||||
async model() {
|
||||
const store = get(this, 'store');
|
||||
|
||||
return hash({
|
||||
apps: store.find('app', null, { forceReload: true }).then((apps) => {
|
||||
const namespaces = await this.clusterStore.findAll('namespace');
|
||||
const cattleMonitoringNamespaceExists = namespaces.any((ns) => ns.id === 'cattle-monitoring-system');
|
||||
const apps = await store.find('app', null, { forceReload: true });
|
||||
const out = [];
|
||||
const projectApp = apps.findBy('name', 'project-monitoring');
|
||||
|
||||
|
|
@ -21,9 +21,10 @@ export default Route.extend({
|
|||
out.push(projectApp);
|
||||
}
|
||||
|
||||
return out;
|
||||
})
|
||||
});
|
||||
return {
|
||||
apps: out,
|
||||
cattleMonitoringNamespaceExists,
|
||||
};
|
||||
},
|
||||
|
||||
setDefaultRoute: on('activate', function() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{{enable-monitoring
|
||||
apps=model.apps
|
||||
level="project"
|
||||
showMonitoringV2Warning=model.cattleMonitoringNamespaceExists
|
||||
}}
|
||||
Loading…
Reference in New Issue