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/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/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/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/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/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 c8f8e4b56..000000000 Binary files a/public/assets/images/providers/7825FC4925C678DE.jpg and /dev/null differ 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