mirror of https://github.com/rancher/ui.git
commit
2ab1f7639d
|
|
@ -1,11 +1,20 @@
|
||||||
import Resource from 'ember-api-store/models/resource';
|
import Resource from 'ember-api-store/models/resource';
|
||||||
|
import { hasMany } from 'ember-api-store/utils/denormalize';
|
||||||
import { computed, get } from '@ember/object';
|
import { computed, get } from '@ember/object';
|
||||||
import { parseHelmExternalId } from 'ui/utils/parse-externalid';
|
import { parseHelmExternalId } from 'ui/utils/parse-externalid';
|
||||||
|
import StateCounts from 'ui/mixins/state-counts';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
const App = Resource.extend({
|
const App = Resource.extend(StateCounts, {
|
||||||
catalog: service(),
|
catalog: service(),
|
||||||
router: service(),
|
router: service(),
|
||||||
|
pods: hasMany('installNamespace', 'pod', 'namespaceId'),
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this._super(...arguments);
|
||||||
|
this.defineStateCounts('pods', 'podStates', 'podCountSort');
|
||||||
|
},
|
||||||
|
|
||||||
externalIdInfo: computed('externalId', function() {
|
externalIdInfo: computed('externalId', function() {
|
||||||
return parseHelmExternalId(get(this, 'externalId'));
|
return parseHelmExternalId(get(this, 'externalId'));
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export default Component.extend({
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
const originalPools = (get(this,'cluster.nodePools')||[]).slice();
|
const originalPools = (get(this,'cluster.nodePools')||[]).slice();
|
||||||
set(this, 'originalPools', originalPools);
|
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 ) {
|
if ( get(this, 'mode') === 'new' && get(originalPools, 'length') === 0 ) {
|
||||||
get(this, 'nodePools').pushObject(get(this, 'globalStore').createRecord({
|
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>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="stack-info-bottom">
|
<div class="stack-info-bottom">
|
||||||
<div class="multi-bar">
|
<div class="multi-bar text-center">
|
||||||
{{progress-bar-multi
|
{{progress-bar-multi
|
||||||
labelKey="state"
|
labelKey="state"
|
||||||
valueKey="count"
|
valueKey="count"
|
||||||
values=model.serviceStates.byColor
|
values=model.podStates.byColor
|
||||||
tooltipValues=model.serviceStates.byName
|
tooltipValues=model.podStates.byName
|
||||||
}}
|
}}
|
||||||
|
<small class="text-muted">
|
||||||
|
{{model.pods.length}}
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
{{#upgrade-btn model=model classNames="btn-sm" as |btn|}}
|
{{#upgrade-btn model=model classNames="btn-sm" as |btn|}}
|
||||||
{{model.externalIdInfo.version}}
|
{{model.externalIdInfo.version}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue