Merge pull request #1733 from loganhz/fix

Fix
This commit is contained in:
Vincent Fiduccia 2018-03-13 10:30:31 -07:00 committed by GitHub
commit 2ab1f7639d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 6 deletions

View File

@ -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'));
}),

View File

@ -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({

View File

@ -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);
}
});
},
});

View File

@ -14,13 +14,16 @@
</div>
<hr>
<div class="stack-info-bottom">
<div class="multi-bar">
<div class="multi-bar text-center">
{{progress-bar-multi
labelKey="state"
valueKey="count"
values=model.serviceStates.byColor
tooltipValues=model.serviceStates.byName
values=model.podStates.byColor
tooltipValues=model.podStates.byName
}}
<small class="text-muted">
{{model.pods.length}}
</small>
</div>
{{#upgrade-btn model=model classNames="btn-sm" as |btn|}}
{{model.externalIdInfo.version}}