diff --git a/app/components/page-header/template.hbs b/app/components/page-header/template.hbs index 9cdb3d203..09ed45de3 100644 --- a/app/components/page-header/template.hbs +++ b/app/components/page-header/template.hbs @@ -10,22 +10,22 @@ {{#if item.submenu.length}} {{! Has a submenu }} {{#hover-dropdown - tagName="li" - class="nav-item" - as |dd| + tagName="li" + class="nav-item" + as |dd| }} {{#dd.trigger}} {{#if (or (not item.resource) (rbac-allows resource=item.resource scope=item.resourceScope))}} {{#if item.route}} {{#link-to-as-attrs - ourRoute=item.route - ctx=item.ctx - qp=item.qp - currentWhen=item.currentWhen - activeParent="LI" - role="button" - aria-haspopup="true" - aria-expanded="false" + ourRoute=item.route + ctx=item.ctx + qp=item.qp + currentWhen=item.currentWhen + activeParent="LI" + role="button" + aria-haspopup="true" + aria-expanded="false" }} {{maybe-t item.localizedLabel item.label}} @@ -40,17 +40,17 @@ {{/dd.trigger}} {{#dd.content - tagName="ul" + tagName="ul" }} {{#each item.submenu as |subitem|}} {{#if subitem.route}} {{#if (or (not subitem.resource) (rbac-allows resource=subitem.resource scope=subitem.resourceScope))}}
  • {{#link-to-as-attrs - ourRoute=subitem.route - ctx=subitem.ctx - qp=subitem.qp - activeParent="LI" + ourRoute=subitem.route + ctx=subitem.ctx + qp=subitem.qp + activeParent="LI" }} {{maybe-t subitem.localizedLabel subitem.label}} @@ -80,12 +80,12 @@ {{! No submenu }}
  • {{#link-to "authenticated.apikeys"}} - {{t "nav.api.link"}} - {{/link-to}} + {{t "nav.api.link"}} + {{/link-to}}
  • {{#link-to "global-admin.security.cloud-keys"}} {{t "nav.admin.security.cloudKeys"}} - {{/link-to}} + + {{/link-to}}
  • {{#link-to "nodes.node-templates"}} - {{t "nav.nodeTemplates.link"}} - {{/link-to}} + {{t "nav.nodeTemplates.link"}} + + {{/link-to}}
  • {{#link-to "authenticated.prefs"}} - {{t "nav.userPreferences.link"}} - {{/link-to}} + {{t "nav.userPreferences.link"}} + + {{/link-to}}
  • {{#link-to "logout" class="user-logout"}} - {{t "nav.user.logout"}} - {{/link-to}} + {{t "nav.user.logout"}} + + {{/link-to}}
  • {{/dd.content}} {{!-- --}} diff --git a/lib/global-admin/addon/components/cru-cloud-credential/component.js b/lib/global-admin/addon/components/cru-cloud-credential/component.js index 5e9e68fbf..c85905463 100644 --- a/lib/global-admin/addon/components/cru-cloud-credential/component.js +++ b/lib/global-admin/addon/components/cru-cloud-credential/component.js @@ -49,6 +49,7 @@ export default Component.extend(NewOrEdit, { errors: null, region: null, regionChoices: REGIONS, + sinlgeCloudKeyChoice: null, didReceiveAttrs() { set(this, 'model', this.globalStore.createRecord({ type: 'cloudCredential' })); @@ -79,9 +80,11 @@ export default Component.extend(NewOrEdit, { let match = CRED_CONFIG_CHOICES.findBy('driver', driverName); - next(() => { - set(this, 'cloudKeyType', get(match, 'name')); + setProperties(this, { + cloudKeyType: get(match, 'name'), + singleCloudKeyChoice: get(match, 'displayName'), + }); this.initCloudCredentialConfig(); }) diff --git a/lib/global-admin/addon/components/cru-cloud-credential/template.hbs b/lib/global-admin/addon/components/cru-cloud-credential/template.hbs index 3e48ac843..8da626c1e 100644 --- a/lib/global-admin/addon/components/cru-cloud-credential/template.hbs +++ b/lib/global-admin/addon/components/cru-cloud-credential/template.hbs @@ -18,24 +18,30 @@ {{t "modalAddCloudKey.type"}} - + {{#if singleCloudKeyChoice}} +
    + {{singleCloudKeyChoice}} +
    + {{else}} + + {{/if}} diff --git a/lib/nodes/addon/components/driver-digitalocean/component.js b/lib/nodes/addon/components/driver-digitalocean/component.js index e32ab447f..8e654983e 100644 --- a/lib/nodes/addon/components/driver-digitalocean/component.js +++ b/lib/nodes/addon/components/driver-digitalocean/component.js @@ -5,8 +5,6 @@ import { import { alias } from '@ember/object/computed'; import Component from '@ember/component'; import NodeDriver, { registerDisplayLocation, registerDisplaySize } from 'shared/mixins/node-driver'; -import fetch from '@rancher/ember-api-store/utils/fetch'; -import { addQueryParam, addQueryParams } from 'shared/utils/util'; import layout from './template'; import { inject as service } from '@ember/service'; @@ -14,7 +12,6 @@ registerDisplayLocation(DRIVER, 'config.region'); registerDisplaySize(DRIVER, 'config.size'); const DRIVER = 'digitalocean'; -const DIGITALOCEAN_API = 'api.digitalocean.com/v2'; const VALID_IMAGES = [ 'rancheros', 'centos-7-x64', @@ -167,45 +164,4 @@ export default Component.extend(NodeDriver, { set(primaryResource, 'digitaloceanConfig', config); }, - - apiRequest(command, opt, out) { - opt = opt || {}; - - let url = `${ get(this, 'app.proxyEndpoint') }/`; - let cloudCredentialId = get(this, 'primaryResource.cloudCredentialId'); - - if ( opt.url ) { - url += opt.url.replace(/^http[s]?\/\//, ''); - } else { - url += `${ DIGITALOCEAN_API }/${ command }`; - url = addQueryParam(url, 'per_page', opt.per_page || 100); - url = addQueryParams(url, opt.params || {}); - } - - return fetch(url, { - headers: { - 'Accept': 'application/json', - 'x-api-cattleauth-header': `Bearer credID=${ cloudCredentialId } passwordField=accessToken`, - }, - }).then((res) => { - let body = res.body; - - if ( out ) { - out[command].pushObjects(body[command]); - } else { - out = body; - } - - // De-paging - if ( body && body.links && body.links.pages && body.links.pages.next ) { - opt.url = body.links.pages.next; - - return this.apiRequest(command, opt, out).then(() => { - return out; - }); - } else { - return out; - } - }); - } });