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> <span>{{t 'clustersPage.newCluster'}}</span>
{{/link-to}} {{/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 class="darken"><i class="icon icon-folder"></i></span>
<span>{{t 'clustersPage.newProject'}}</span> <span>{{t 'clustersPage.newProject'}}</span>
{{/link-to}} {{/link-to}}
@ -46,6 +46,7 @@
pagingLabel="pagination.cluster" pagingLabel="pagination.cluster"
headers=headers as |sortable kind inst dt| headers=headers as |sortable kind inst dt|
}} }}
{{#if (eq kind "row")}}
{{cluster-row {{cluster-row
model=inst model=inst
fullColspan=sortable.fullColspan fullColspan=sortable.fullColspan
@ -53,6 +54,11 @@
expanded=(array-includes expandedClusters inst.id) expanded=(array-includes expandedClusters inst.id)
dt=dt 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}} {{/sortable-table}}
{{else}} {{else}}
{{project-table model=model.projects showCluster=true}} {{project-table model=model.projects showCluster=true}}

View File

@ -19,7 +19,9 @@
</div> </div>
{{/if}} {{/if}}
{{#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}} {{#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> </div>
</section> </section>

View File

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

View File

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