mirror of https://github.com/rancher/ui.git
Embedding; Hide system project notice when embedded
This commit is contained in:
parent
32e6b2a095
commit
cbb88bee09
|
|
@ -1,7 +1,7 @@
|
||||||
|
import Controller from '@ember/controller';
|
||||||
|
import { computed, observer } from '@ember/object';
|
||||||
import { alias } from '@ember/object/computed';
|
import { alias } from '@ember/object/computed';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import { computed, observer } from '@ember/object';
|
|
||||||
import Controller from '@ember/controller';
|
|
||||||
import C from 'ui/utils/constants';
|
import C from 'ui/utils/constants';
|
||||||
|
|
||||||
// const NONE = 'none';
|
// const NONE = 'none';
|
||||||
|
|
@ -19,12 +19,20 @@ export default Controller.extend({
|
||||||
group: NAMESPACE,
|
group: NAMESPACE,
|
||||||
nodes: null,
|
nodes: null,
|
||||||
expandedInstances: null,
|
expandedInstances: null,
|
||||||
|
notEmbedded: true,
|
||||||
|
|
||||||
namespaces: alias('scope.currentProject.namespaces'),
|
namespaces: alias('scope.currentProject.namespaces'),
|
||||||
|
|
||||||
|
showSystemProjectWarning: computed.and('model.project.isSystemProject', 'notEmbedded'),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.set('nodes', this.get('store').all('node'));
|
this.set('nodes', this.get('store').all('node'));
|
||||||
this.set('expandedInstances', []);
|
this.set('expandedInstances', []);
|
||||||
|
|
||||||
|
const notEmbedded = window.top === window;
|
||||||
|
|
||||||
|
this.set('notEmbedded', notEmbedded);
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{#if model.project.isSystemProject}}
|
{{#if showSystemProjectWarning}}
|
||||||
{{#banner-message color='bg-warning m-0'}}
|
{{#banner-message color='bg-warning m-0'}}
|
||||||
<p>{{t 'clusterDashboard.systemProject' appName=settings.appName}}</p>
|
<p>{{t 'clusterDashboard.systemProject' appName=settings.appName}}</p>
|
||||||
{{/banner-message}}
|
{{/banner-message}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue