Hide add host for imported cluster

This commit is contained in:
Vincent Fiduccia 2017-09-01 18:01:38 -07:00
parent a818089570
commit a322caa675
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
4 changed files with 23 additions and 10 deletions

View File

@ -16,7 +16,7 @@
<span>{{t 'clustersPage.newCluster'}}</span>
{{/link-to}}
{{#link-to "authenticated.clusters.new-project" class="btn bg-primary btn-sm icon-btn"}}
{{#link-to "authenticated.clusters.new-project" class="btn bg-primary btn-sm icon-btn" disabled=(eq model.clusters.length 0)}}
<span class="darken"><i class="icon icon-folder"></i></span>
<span>{{t 'clustersPage.newProject'}}</span>
{{/link-to}}
@ -46,13 +46,19 @@
pagingLabel="pagination.cluster"
headers=headers as |sortable kind inst dt|
}}
{{cluster-row
model=inst
fullColspan=sortable.fullColspan
toggle=(action "toggleExpand" inst.id)
expanded=(array-includes expandedClusters inst.id)
dt=dt
}}
{{#if (eq kind "row")}}
{{cluster-row
model=inst
fullColspan=sortable.fullColspan
toggle=(action "toggleExpand" inst.id)
expanded=(array-includes expandedClusters inst.id)
dt=dt
}}
{{else if (eq kind "nomatch")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'clusterRow.noClusterMatch'}}</td></tr>
{{else if (eq kind "norows")}}
<tr><td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">{{t 'clusterRow.noClusterData'}}</td></tr>
{{/if}}
{{/sortable-table}}
{{else}}
{{project-table model=model.projects showCluster=true}}

View File

@ -19,7 +19,9 @@
</div>
{{/if}}
{{#link-to "authenticated.clusters.cluster.host-templates.index" projects.currentCluster.id classNames="btn btn-sm bg-primary"}}{{t 'hostsPage.index.addHost'}}{{/link-to}}
{{#if projects.current.canAddHost}}
{{#link-to "authenticated.clusters.cluster.host-templates.index" projects.currentCluster.id classNames="btn btn-sm bg-primary"}}{{t 'hostsPage.index.addHost'}}{{/link-to}}
{{/if}}
</div>
</section>

View File

@ -18,6 +18,9 @@ var Project = Resource.extend(PolledResource, {
cluster: denormalizeId('clusterId'),
canAddHost: Ember.computed.notEmpty('cluster.registrationToken.hostCommand'),
canImport: Ember.computed.notEmpty('cluster.registrationToken.clusterCommand'),
actions: {
edit: function() {
this.get('router').transitionTo('authenticated.clusters.project', this.get('id'));

View File

@ -1310,9 +1310,11 @@ catalogSettings:
placeholder: 'e.g. master'
clusterRow:
noMatch: No environments match the current search
noMatch: No environments match the current search.
noData: This cluster doesn't have any environments yet.
noHosts: External cluster has no hosts
noClusterMatch: No clusters match the current search.
noClusterData: There are no clusters yet.
addHost: Add Hosts
importCluster: Use existing Kubernetes
loginDefault: Login