mirror of https://github.com/rancher/ui.git
35 lines
987 B
JavaScript
35 lines
987 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Component.extend({
|
|
currentPath : null,
|
|
|
|
tagName: '',
|
|
|
|
projects : Ember.inject.service(),
|
|
project : Ember.computed.alias('projects.current'),
|
|
k8s : Ember.inject.service(),
|
|
namespace : Ember.computed.alias('k8s.namespace'),
|
|
|
|
projectChoices: function() {
|
|
return this.get('projects.active').sortBy('name','id');
|
|
}.property('projects.active.@each.{id,displayName,state}'),
|
|
|
|
projectIsMissing: function() {
|
|
return this.get('projectChoices').filterBy('id', this.get('project.id')).get('length') === 0;
|
|
}.property('project.id','projectChoices.@each.id'),
|
|
|
|
isKubernetesTab: function() {
|
|
return this.get('currentPath').indexOf('authenticated.project.k8s-tab') === 0;
|
|
}.property('currentPath'),
|
|
|
|
actions: {
|
|
switchProject(id) {
|
|
this.sendAction('switchProject', id);
|
|
},
|
|
|
|
switchNamespace(id) {
|
|
this.sendAction('switchNamespace', id);
|
|
},
|
|
}
|
|
});
|