mirror of https://github.com/rancher/ui.git
commit
2ab1f7639d
|
|
@ -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'));
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue