diff --git a/app/models/app.js b/app/models/app.js index 0387e33d7..d4bc28fae 100644 --- a/app/models/app.js +++ b/app/models/app.js @@ -1,11 +1,20 @@ import Resource from 'ember-api-store/models/resource'; +import { hasMany } from 'ember-api-store/utils/denormalize'; import { computed, get } from '@ember/object'; import { parseHelmExternalId } from 'ui/utils/parse-externalid'; +import StateCounts from 'ui/mixins/state-counts'; import { inject as service } from '@ember/service'; -const App = Resource.extend({ +const App = Resource.extend(StateCounts, { catalog: service(), router: service(), + pods: hasMany('installNamespace', 'pod', 'namespaceId'), + + init() { + this._super(...arguments); + this.defineStateCounts('pods', 'podStates', 'podCountSort'); + }, + externalIdInfo: computed('externalId', function() { return parseHelmExternalId(get(this, 'externalId')); }), diff --git a/lib/shared/addon/components/cru-node-pools/component.js b/lib/shared/addon/components/cru-node-pools/component.js index 42b4ea49a..2b885ee7d 100644 --- a/lib/shared/addon/components/cru-node-pools/component.js +++ b/lib/shared/addon/components/cru-node-pools/component.js @@ -71,7 +71,7 @@ export default Component.extend({ this._super(...arguments); const originalPools = (get(this,'cluster.nodePools')||[]).slice(); set(this, 'originalPools', originalPools); - set(this, 'nodePools', originalPools.slice()); + set(this, 'nodePools', originalPools.slice().map(p => p.clone())); if ( get(this, 'mode') === 'new' && get(originalPools, 'length') === 0 ) { get(this, 'nodePools').pushObject(get(this, 'globalStore').createRecord({ diff --git a/lib/shared/addon/components/form-scoped-roles/component.js b/lib/shared/addon/components/form-scoped-roles/component.js index 22b7063ae..53cfd38a5 100644 --- a/lib/shared/addon/components/form-scoped-roles/component.js +++ b/lib/shared/addon/components/form-scoped-roles/component.js @@ -229,6 +229,21 @@ export default Component.extend(NewOrEdit,{ }); }, - } + }, + + didInsertElement() { + next(() => { + if ( this.isDestroyed || this.isDestroying ) { + return; + } + + const elem = this.$('INPUT')[0] + if ( elem ) { + setTimeout(()=>{ + elem.focus(); + }, 250); + } + }); + }, }); diff --git a/lib/shared/addon/components/namespace-app/template.hbs b/lib/shared/addon/components/namespace-app/template.hbs index 2bc088a21..f92ae7e70 100644 --- a/lib/shared/addon/components/namespace-app/template.hbs +++ b/lib/shared/addon/components/namespace-app/template.hbs @@ -14,13 +14,16 @@
-
+
{{progress-bar-multi labelKey="state" valueKey="count" - values=model.serviceStates.byColor - tooltipValues=model.serviceStates.byName + values=model.podStates.byColor + tooltipValues=model.podStates.byName }} + + {{model.pods.length}} +
{{#upgrade-btn model=model classNames="btn-sm" as |btn|}} {{model.externalIdInfo.version}}