From 7cedd4fe24965abc6d2e3fe10488647ba2506fe1 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 13 Feb 2018 11:03:46 -0700 Subject: [PATCH 1/2] Import icon --- app/styles/abstracts/_mixins.scss | 4 + app/styles/pages/_host.scss | 47 +--------- .../cluster-driver/driver-rke/template.hbs | 5 +- .../cloud-host-add-or-edit/component.js | 55 ------------ .../cloud-host-add-or-edit/template.hbs | 80 ------------------ .../components/cluster-welcome/component.js | 16 ---- .../components/cluster-welcome/template.hbs | 60 ------------- .../cloud-host-add-or-edit/component.js | 1 - .../images/providers/7825FC4925C678DE.jpg | Bin 2604 -> 0 bytes 9 files changed, 9 insertions(+), 259 deletions(-) delete mode 100644 lib/shared/addon/components/cloud-host-add-or-edit/component.js delete mode 100644 lib/shared/addon/components/cloud-host-add-or-edit/template.hbs delete mode 100644 lib/shared/addon/components/cluster-welcome/component.js delete mode 100644 lib/shared/addon/components/cluster-welcome/template.hbs delete mode 100644 lib/shared/app/components/cloud-host-add-or-edit/component.js delete mode 100644 public/assets/images/providers/7825FC4925C678DE.jpg diff --git a/app/styles/abstracts/_mixins.scss b/app/styles/abstracts/_mixins.scss index 3749a9db1..17e761258 100755 --- a/app/styles/abstracts/_mixins.scss +++ b/app/styles/abstracts/_mixins.scss @@ -119,6 +119,10 @@ background-image: url('images/providers/custom-registry.svg'); } +@mixin import { + background-image: url('images/providers/custom-import.svg'); +} + @mixin generic { background-image: url('images/providers/generic-driver.svg'); } diff --git a/app/styles/pages/_host.scss b/app/styles/pages/_host.scss index 194e42dde..63f57aefb 100644 --- a/app/styles/pages/_host.scss +++ b/app/styles/pages/_host.scss @@ -54,6 +54,7 @@ &.vmwarevsphere { @include vmwarevsphere; } &.other { @include other; } &.custom { @include custom; } + &.import { @include import; } &.aliyunecs { @include aliyunecs; } &.amazoneks { @include amazoneks; } &.azureaks { @include azureaks; } @@ -74,7 +75,7 @@ justify-content: center; & > .nav-box-item { - min-height : 110px; + min-height : 150px; flex : 0 1 auto; position : relative; outline : 0; @@ -196,47 +197,3 @@ ol > li::before { .host-blurb { margin-right: 10px; } - - -.hosts-cloud-add { - .addtl-info { - .nav-boxes { - .nav-box-item { - height: 250px; - width: 250px; - border: none; - } - } - .price { - font-size: 4em; - line-height: 1em; - color:$success; - .addon { - font-size: .3em; - white-space: nowrap; - } - } - } -} - -.hosts-cloud-new { - padding-bottom: 0px; - margin-bottom: 0px; - .tabs { - ul.tab-header { - li.active { - a { - background-color: transparent; - border-bottom: 2px solid $link-color; - } - } - li { - a { - font-size: 18px; - border: 0px; - background-color: transparent; - } - } - } - } -} diff --git a/lib/global-admin/addon/components/cluster-driver/driver-rke/template.hbs b/lib/global-admin/addon/components/cluster-driver/driver-rke/template.hbs index 530394051..17628d3f2 100644 --- a/lib/global-admin/addon/components/cluster-driver/driver-rke/template.hbs +++ b/lib/global-admin/addon/components/cluster-driver/driver-rke/template.hbs @@ -24,17 +24,18 @@
- {{input value=node.prefix}} + {{input class="input-sm" value=node.prefix}}
- {{input type="number" min="1" value=node.count}} + {{input class="input-sm" type="number" min="1" value=node.count}} x
{{new-select + class="input-sm" content=model.nodeTemplates optionLabelPath="displayName" optionValuePath="id" diff --git a/lib/shared/addon/components/cloud-host-add-or-edit/component.js b/lib/shared/addon/components/cloud-host-add-or-edit/component.js deleted file mode 100644 index bef136883..000000000 --- a/lib/shared/addon/components/cloud-host-add-or-edit/component.js +++ /dev/null @@ -1,55 +0,0 @@ -import { alias } from '@ember/object/computed'; -import Component from '@ember/component'; -import Driver from 'shared/mixins/host-driver'; -import layout from './template'; -import { inject as service } from '@ember/service'; -import { get, set, setProperties } from '@ember/object'; - -export default Component.extend(Driver, { - layout, - globalStore: service(), - router: service(), - errors: null, - host: null, - clonedModel: null, - hostOptions: null, - expandAll: null, - canAddOptions: false, - labelResource: alias('primaryResource'), - primaryResource: alias('clonedModel'), - requestedClusterId: alias('clonedModel.requestedClusterId'), - role: alias('clonedModel.role'), - inModal: false, - - didReceiveAttrs() { - this._super(...arguments); - - if (!this.get('expandFn')) { - this.set('expandFn', function(item) { - item.toggleProperty('expanded'); - }); - } - - if (!get(this, 'router.currentRouteName').includes('clusters')) { - set(this, 'canAddOptions', true); - } - - let cm = get(this, 'globalStore').createRecord({type: 'node'}); - - set(cm, 'nodeTemplateId', get(this, 'nodeTemplate.id')); - - setProperties(this, { - hostOptions: get(this, `nodeTemplate.${this.get('nodeTemplate.driver')}Config`), - // @@TODO@@ - 11-28-17 - not sure we should be doing this this way how the heck do we know which host to clone labels from? - // clonedModel: this.get('host').clone(), - clonedModel: cm, - }); - - }, - doneSaving: function(neu) { - if (get(this, 'inModal')){ - set(this, 'clusterNodes', neu); - } - return this._super(...arguments); - }, -}); diff --git a/lib/shared/addon/components/cloud-host-add-or-edit/template.hbs b/lib/shared/addon/components/cloud-host-add-or-edit/template.hbs deleted file mode 100644 index b0ee8e4b0..000000000 --- a/lib/shared/addon/components/cloud-host-add-or-edit/template.hbs +++ /dev/null @@ -1,80 +0,0 @@ -
-
-
-
-

- {{t 'hostsPage.cloudHostsPage.addPage.header'}} -

-
-
-
- -
-
-
-
- -
-
-
- - {{machineTemplate.name}} -
-
- {{#if driver.hasUi}} - {{component (concat 'host-template-' machineTemplate.driver) machineTemplate=model.template hostOptions=hostOptions}} - {{else}} - {{component 'host-template-other' machineTemplate=model.template}} - {{/if}} - -
-
- -
-
- {{form-name-description - name=prefix - nameRequired=true - nameLabel="hostsPage.cloudHostsPage.addPage.name.label" - namePlaceholder="hostsPage.cloudHostsPage.addPage.name.placeholder" - nameHelpText=nameCountLabel - descriptionShown=true - }} -
-
- {{form-count - initialScale=1 - setScale=(action (mut count)) - }} -
-
- -
- - {{#if canAddOptions}} -
- {{form-cluster-select - classNames="mt-20 mb-20" - machine=clonedModel - clusters=clusters - hasCluster=cluster - requestedClusterId=requestedClusterId - role=role - }} -
- {{/if}} - - {{!-- @@TODO@@ - 11-28-17 - not sure we should be doing this this way how the heck do we know which host to clone labels from? --}} - {{form-user-labels initialLabels=clonedModel.labels setLabels=(action 'setLabels') detailKey="formUserLabels.nodeDetail" expandAll=null}} - - {{top-errors errors=errors}} - {{save-cancel save="save" cancel="cancel" createLabel='hostsPage.cloudHostsPage.addPage.launch'}} -
-
-
diff --git a/lib/shared/addon/components/cluster-welcome/component.js b/lib/shared/addon/components/cluster-welcome/component.js deleted file mode 100644 index 73f266f77..000000000 --- a/lib/shared/addon/components/cluster-welcome/component.js +++ /dev/null @@ -1,16 +0,0 @@ -import { alias, notEmpty } from '@ember/object/computed'; -import Component from '@ember/component'; -import layout from './template'; -import { inject as service } from '@ember/service' - -export default Component.extend({ - layout, - scope: service(), - settings: service(), - - cluster: alias('scope.currentCluster'), - canCreate: notEmpty('cluster.registrationToken.hostCommand'), - canImport: notEmpty('cluster.registrationToken.clusterCommand'), - - header: true, -}); diff --git a/lib/shared/addon/components/cluster-welcome/template.hbs b/lib/shared/addon/components/cluster-welcome/template.hbs deleted file mode 100644 index e8a16258e..000000000 --- a/lib/shared/addon/components/cluster-welcome/template.hbs +++ /dev/null @@ -1,60 +0,0 @@ -{{#if header}} -
-

{{t 'clusterWelcome.welcome'}}

-

{{t 'clusterWelcome.noHost'}}

-
-{{/if}} - -
-
-

{{t 'clusterWelcome.addHost'}}

-
- {{t 'clusterWelcome.embeddedDescription' appName=settings.appName htmlSafe=true}} - {{#if canCreate}} - - {{/if}} -
-
-
- - {{!-- Import --}} -
-

{{t 'clusterWelcome.importCluster'}}

-
- {{t 'clusterWelcome.importClusterDescription' appName=settings.appName htmlSafe=true}} -
-
- - - -
-
- -
-
-
-
-
-
- -
-
-
-
- - - -
-
- - {{#if canImport}} - - {{/if}} -
-
-
-
diff --git a/lib/shared/app/components/cloud-host-add-or-edit/component.js b/lib/shared/app/components/cloud-host-add-or-edit/component.js deleted file mode 100644 index c5f5e593d..000000000 --- a/lib/shared/app/components/cloud-host-add-or-edit/component.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'shared/components/cloud-host-add-or-edit/component'; \ No newline at end of file diff --git a/public/assets/images/providers/7825FC4925C678DE.jpg b/public/assets/images/providers/7825FC4925C678DE.jpg deleted file mode 100644 index c8f8e4b56250f16ca2a2736368605cde4b5ef1b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2604 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 NeFuD4RliVY{sSUqZW{mq From 6d42cea5e9ba87f70a5d991fd284faa66715d4c0 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 13 Feb 2018 14:53:09 -0700 Subject: [PATCH 2/2] Stuff --- app/authenticated/project/controller.js | 14 +++----------- app/authenticated/project/route.js | 6 +++++- app/catalog-tab/launch/route.js | 6 ++++-- app/catalog-tab/route.js | 9 ++++----- app/containers/run/route.js | 7 ++++--- app/models/namespace.js | 4 ++-- app/models/project.js | 3 +++ .../addon/clusters/index/controller.js | 2 +- .../components/container/new-edit/component.js | 3 ++- .../addon/components/form-namespace/component.js | 11 ++++++----- translations/en-us.yaml | 15 +++++++-------- 11 files changed, 41 insertions(+), 39 deletions(-) diff --git a/app/authenticated/project/controller.js b/app/authenticated/project/controller.js index 56a6a8a5b..13a3c9b89 100644 --- a/app/authenticated/project/controller.js +++ b/app/authenticated/project/controller.js @@ -1,4 +1,5 @@ import { scheduleOnce } from '@ember/runloop'; +import { alias } from '@ember/object/computed'; import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; import C from 'ui/utils/constants'; @@ -16,13 +17,12 @@ export default Controller.extend({ group: NAMESPACE, queryParams: ['tags','group'], - namespaces: null, + namespaces: alias('scope.currentProject.namespaces'), nodes: null, expandedInstances: null, init() { this._super(...arguments); - this.set('namespaces', this.get('store').all('namespace')); this.set('nodes', this.get('store').all('node')); this.set('expandedInstances',[]); }, @@ -50,15 +50,6 @@ export default Controller.extend({ return this.get('scope.currentCluster.state') === 'inactive' && !this.get('nodes.length'); }.property('scope.currentCluster.state','nodes.[]'), - simpleMode: false, - /* - simpleMode: function() { - let list = this.get('namespaces'); - let bad = list.findBy('isDefault', false); - return !bad; - }.property('namespaces.@each.{system,isDefault}'), - */ - groupTableBy: function() { if ( this.get('group') === NAMESPACE && !this.get('simpleMode') ) { return 'namespace'; @@ -81,6 +72,7 @@ export default Controller.extend({ let out = {}; let ok; + this.get('namespaces').forEach((obj) => { ok = true; diff --git a/app/authenticated/project/route.js b/app/authenticated/project/route.js index ead717bb7..feb792371 100644 --- a/app/authenticated/project/route.js +++ b/app/authenticated/project/route.js @@ -13,8 +13,12 @@ export default Route.extend(Preload,{ model(params, transition) { return get(this, 'globalStore').find('project', params.project_id).then((project) => { return get(this,'scope').startSwitchToProject(project).then(() => { - return this.loadSchemas('store').then(() => { + return PromiseAll([ + this.loadSchemas('clusterStore'), + this.loadSchemas('store'), + ]).then(() => { return PromiseAll([ + this.preload('namespace','clusterStore'), this.preload('pod'), this.preload('workload'), this.preload('dnsRecord'), diff --git a/app/catalog-tab/launch/route.js b/app/catalog-tab/launch/route.js index 33ae74216..da57f4981 100644 --- a/app/catalog-tab/launch/route.js +++ b/app/catalog-tab/launch/route.js @@ -8,6 +8,7 @@ export default Route.extend({ modalService: service('modal'), catalog: service(), scope: service(), + clusterStore: service(), parentRoute: 'catalog-tab', @@ -18,6 +19,7 @@ export default Route.extend({ }, model: function(params/*, transition*/) { var store = get(this, 'store'); + var clusterStore = get(this, 'clusterStore'); var dependencies = { tpl: get(this, 'catalog').fetchTemplate(params.template), @@ -30,13 +32,13 @@ export default Route.extend({ if ( params.namespaceId ) { - dependencies.namespace = store.find('namespace', params.namespaceId); + dependencies.namespace = clusterStore.find('namespace', params.namespaceId); } return hash(dependencies, 'Load dependencies').then((results) => { if ( !results.namespace ) { - results.namespace = store.createRecord({ + results.namespace = clusterStore.createRecord({ type: 'namespace', name: results.tpl.get('defaultName'), answers: {}, diff --git a/app/catalog-tab/route.js b/app/catalog-tab/route.js index e650c1278..ceb78812c 100644 --- a/app/catalog-tab/route.js +++ b/app/catalog-tab/route.js @@ -32,7 +32,6 @@ export default Route.extend({ this._super(...arguments); return hash({ - namespaces: this.get('store').findAll('namespace'), catalogs: this.get('catalog').fetchCatalogs({ headers: { [C.HEADER.PROJECT_ID]: this.get('scope.currentProject.id') @@ -40,21 +39,21 @@ export default Route.extend({ }), }).then((hash) => { this.set('catalogs', hash.catalogs); - this.set('namespaces', hash.namespaces); }); }, model(params) { + const project = this.get('scope.currentProject'); + if (params.launchCluster) { params.plusInfra = true; } else { - params.plusInfra = this.get('scope.currentProject.clusterOwner') === true; + params.plusInfra = project.get('clusterOwner') === true; } - let namespaces = this.get('namespaces'); return this.get('catalog').fetchTemplates(params).then((res) => { res.catalog.forEach((tpl) => { - let exists = namespaces.findBy('externalIdInfo.templateId', tpl.get('id')); + let exists = this.get('project.namespaces').findBy('externalIdInfo.templateId', tpl.get('id')); tpl.set('exists', !!exists); }); res.catalogs = this.get('catalogs'); diff --git a/app/containers/run/route.js b/app/containers/run/route.js index d83dce2e8..3bf60db97 100644 --- a/app/containers/run/route.js +++ b/app/containers/run/route.js @@ -7,6 +7,7 @@ import C from 'ui/utils/constants'; export default Route.extend({ prefs: service(), + clusterStore: service(), queryParams: { containerName: { @@ -125,15 +126,15 @@ export default Route.extend({ }, getNamespaceId(params) { - const store = this.get('store'); + const clusterStore = this.get('clusterStore'); let ns = null; if ( params.namespaceId ) { - ns = store.getById('namespace', params.namespaceId); + ns = clusterStore.getById('namespace', params.namespaceId); } if ( !ns ) { - ns = store.getById('namespace', this.get(`prefs.${C.PREFS.LAST_NAMESPACE}`)); + ns = clusterStore.getById('namespace', this.get(`prefs.${C.PREFS.LAST_NAMESPACE}`)); } let namespaceId = null; diff --git a/app/models/namespace.js b/app/models/namespace.js index 97138d7c4..6c4f3800b 100644 --- a/app/models/namespace.js +++ b/app/models/namespace.js @@ -57,8 +57,8 @@ var Namespace = Resource.extend(StateCounts, { router: service(), globalStore: service(), - pods: hasMany('id', 'pod', 'namespaceId'), - workloads: hasMany('id', 'workload', 'namespaceId'), + pods: hasMany('id', 'pod', 'namespaceId', 'store'), + workloads: hasMany('id', 'workload', 'namespaceId', 'store'), project: reference('projectId', 'project', 'globalStore'), init() { diff --git a/app/models/project.js b/app/models/project.js index 879d9adf0..48b3ce233 100644 --- a/app/models/project.js +++ b/app/models/project.js @@ -13,6 +13,7 @@ export default Resource.extend({ settings: service(), modalService: service('modal'), router: service(), + clusterStore: service(), type: 'project', name: null, @@ -22,6 +23,8 @@ export default Resource.extend({ projectRoleTemplateBindings: hasMany('id', 'projectRoleTemplateBinding', 'projectId'), // 2.0 bug projectId is wrong in the ptrb should be : instead of just roleTemplateBindings: alias('projectRoleTemplateBindings'), + namespaces: hasMany('id', 'namespace', 'projectId', 'clusterStore'), + actions: { edit: function () { get(this,'router').transitionTo('authenticated.cluster.projects.edit', get(this,'id')); diff --git a/lib/global-admin/addon/clusters/index/controller.js b/lib/global-admin/addon/clusters/index/controller.js index ad6d25263..562deec8c 100644 --- a/lib/global-admin/addon/clusters/index/controller.js +++ b/lib/global-admin/addon/clusters/index/controller.js @@ -5,7 +5,7 @@ import { getOwner } from '@ember/application'; const headers = [ { name: 'state', - sort: ['stateSort','name','id'], + sort: ['sortState','name','id'], translationKey: 'generic.state', width: 125, }, diff --git a/lib/shared/addon/components/container/new-edit/component.js b/lib/shared/addon/components/container/new-edit/component.js index 52729eced..e44583234 100644 --- a/lib/shared/addon/components/container/new-edit/component.js +++ b/lib/shared/addon/components/container/new-edit/component.js @@ -12,6 +12,7 @@ import layout from './template'; export default Component.extend(NewOrEdit, { layout, + clusterStore: service(), intl: service(), prefs: service(), settings: service(), @@ -131,7 +132,7 @@ export default Component.extend(NewOrEdit, { } if ( namespaceId ) { - let namespace = this.get('store').getById('namespace', namespaceId); + let namespace = this.get('clusterStore').getById('namespace', namespaceId); if ( namespace ) { this.set('namespace', namespace); } diff --git a/lib/shared/addon/components/form-namespace/component.js b/lib/shared/addon/components/form-namespace/component.js index d25524bff..bbf0f103b 100644 --- a/lib/shared/addon/components/form-namespace/component.js +++ b/lib/shared/addon/components/form-namespace/component.js @@ -1,6 +1,7 @@ import { observer, get } from '@ember/object'; + import { next } from '@ember/runloop'; -import { equal } from '@ember/object/computed'; +import { alias, equal } from '@ember/object/computed'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; import layout from './template'; @@ -11,6 +12,7 @@ const CREATE = 'create'; export default Component.extend({ layout, intl: service(), + scope: service(), // Outputs namespace: null, @@ -25,14 +27,13 @@ export default Component.extend({ isReuse: equal('mode', REUSE), classNames: ['inline-form'], - choices: null, + choices: alias('scope.currentProject.namespaces'), init() { this._super(...arguments); - let all = this.get('store').all('namespace'); - this.set('choices', all); + let all = this.get('choices'); - this.set('createNamespace', this.get('store').createRecord({ + this.set('createNamespace', this.get('clusterStore').createRecord({ type: 'namespace', name: '', })); diff --git a/translations/en-us.yaml b/translations/en-us.yaml index ba0aa259f..336b63f18 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -1905,10 +1905,10 @@ formIngress: workload: Workload service: DNS Record formIngressBackends: - label: Target Backends + label: Target Backend noRules: No Backends - addServiceLabel: Add a DNS Record - addWorkloadLabel: Add a Service + addServiceLabel: Service + addWorkloadLabel: Workload service: label: service workload: @@ -4227,10 +4227,10 @@ schema: inputHost: label: Choose a Host... inputService: - prompt: Choose a Service... + prompt: Choose a Workload... custom: Custom inputDnsRecord: - prompt: Choose a DNS Record... + prompt: Choose a Service... inputSecret: prompt: Choose a Secret... @@ -4454,10 +4454,9 @@ nav: containers: tab: Workloads systemTab: System - balancers: Balancers - ingresses: Ingresses + ingresses: Load Balancing containers: Workloads - dns: DNS + dns: Service Discovery volumes: Volumes k8s: Advanced deploy: Deploy