K8S tweaks

This commit is contained in:
Vincent Fiduccia 2015-11-24 18:54:15 -07:00
parent 933ff52548
commit c3a12e380d
4 changed files with 18 additions and 21 deletions

View File

@ -112,8 +112,11 @@
{{#link-to "certificates"}}<i class="icon icon-certificate"></i>Certificates{{/link-to}}
{{/if}}
{{#if isApplicationsTab}}
{{#link-to "environments"}}<i class="icon icon-globe"></i> Stacks{{/link-to}}
{{#link-to "environments" (query-params which="user")}}<i class="icon icon-globe"></i> Stacks{{/link-to}}
{{#link-to "applications-tab.catalog"}}<i class="icon icon-database"></i> Catalog{{/link-to}}
{{#if hasKubernetes}}
{{#link-to "environments" (query-params which="kubernetes")}}<i class="icon icon-kubernetes"></i>Kubernetes{{/link-to}}
{{/if}}
<div class="compose-download">
<a class="dropdown-toggle hand" data-toggle="dropdown" aria-expanded="false">

View File

@ -28,12 +28,8 @@ export default Ember.Controller.extend(Sortable, {
}
},
supportsKubernetes: function() {
return this.get('projects.current.kubernetes') === true;
}.property('projects.current.kubernetes'),
showTabs: function() {
return this.get('which') !== 'user' || this.get('model.hasKubernetes') || this.get('model.hasSystem');
return this.get('which') !== 'kubernetes' && (this.get('which') !== 'user' || this.get('model.hasKubernetes') || this.get('model.hasSystem'));
}.property('which','model.{hasKubernetes,hasSystem}'),
setup: function() {

View File

@ -1,10 +1,10 @@
<section class="header">
<ol class="breadcrumb right-divider">
<li class="active">Stacks</li>
<ol class="breadcrumb {{unless (eq which 'kubernetes') 'right-divider'}}">
<li class="active">{{if (eq which "kubernetes") "Kubernetes" "Stacks"}}</li>
</ol>
{{#unless single}}
{{#link-to "environments.new" classNames="btn btn-sm btn-primary"}}Add Stack{{/link-to}}
{{#unless (or (eq which "kubernetes") single)}}
{{#link-to "environments.new" classNames="btn btn-sm btn-primary"}}Add Stack{{/link-to}}
{{/unless}}
<div class="pull-right">
@ -17,16 +17,6 @@
</section>
<section>
{{#if showTabs}}
<ul class="nav nav-tabs nav-tabs-well">
{{#link-to (query-params which="all") tagName="li" href=false}}<a>All</a>{{/link-to}}
{{#link-to (query-params which="user") tagName="li" href=false}}<a>User</a>{{/link-to}}
{{#link-to (query-params which="system") tagName="li" href=false}}<a>System</a>{{/link-to}}
{{#if supportsKubernetes}}
{{#link-to (query-params which="kubernetes") tagName="li" href=false}}<a>Kubernetes</a>{{/link-to}}
{{/if}}
</ul>
{{/if}}
<div class="well {{if showTabs 'nav-well'}} r-pl0 r-pr0">
{{#each arranged as |stack|}}
{{stack-section model=stack showAddtlInfo='showAddtlInfo'}}

View File

@ -3,6 +3,7 @@ import Util from 'ui/utils/util';
import Resource from 'ember-api-store/models/resource';
import UnremovedArrayProxy from 'ui/utils/unremoved-array-proxy';
import { parseExternalId } from 'ui/utils/parse-externalid';
import C from 'ui/utils/constants';
var Environment = Resource.extend({
type: 'environment',
@ -81,6 +82,13 @@ var Environment = Resource.extend({
availableActions: function() {
var a = this.get('actionLinks');
var isK8s = this.get('externalIdInfo.kind') === C.EXTERNALID.KIND_KUBERNETES;
if ( this.get('externalIdInfo.kind') === C.EXTERNALID.KIND_KUBERNETES )
{
return [];
}
var out = [
{ label: 'Finish Upgrade', icon: 'icon icon-success', action: 'finishUpgrade', enabled: !!a.finishupgrade },
@ -101,7 +109,7 @@ var Environment = Resource.extend({
];
return out;
}.property('actionLinks.{remove,purge,exportconfig,finishupgrade,cancelupgrade,rollback,cancelrollback}','canActivate','canDeactivate'),
}.property('actionLinks.{remove,purge,exportconfig,finishupgrade,cancelupgrade,rollback,cancelrollback}','canActivate','canDeactivate','externalIdInfo.kind'),
healthState: function() {
// Get the state of each instance