Merge pull request #1765 from loganhz/dashboard

Fix dashboard issue
This commit is contained in:
Vincent Fiduccia 2018-03-26 22:19:53 -07:00 committed by GitHub
commit ec34332c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 4 deletions

View File

@ -81,7 +81,7 @@ export default Resource.extend(ResourceUsage, {
}
}),
displayProvider: computed('configName','nodePools.firstObject.displayProvider','intl.locale', function() {
displayProvider: computed('configName','nodePools.@each.displayProvider','intl.locale', function() {
const intl = get(this, 'intl');
const pools = get(this,'nodePools');
const firstPool = (pools||[]).objectAt(0);

View File

@ -64,5 +64,5 @@
{{else if projectController.projects.current.isKubernetes}}
<div class="m-40 text-center text-muted">Coming soon for Kubernetes clusters</div>
{{else}}
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="generic.comingSoon" disabled=true}}
{{empty-table resource="container" newRoute="volumes.new" newTranslationKey="nav.containers.addVolume"}}
{{/if}}

View File

@ -88,7 +88,7 @@ export default Component.extend(ViewNewEdit, ChildHook, {
});
} else {
const errors = [];
errors.push(intl.t('validation.required', {key: intl.t('cruPersistentVolumeClaim.capacity.label')}));
errors.push(intl.t('validation.required', {key: intl.t('cruPersistentVolumeClaim.capacity.label')}));
set(this, 'errors', errors);
return false;
}
@ -96,7 +96,9 @@ export default Component.extend(ViewNewEdit, ChildHook, {
} else {
set(pr, 'storageClassId', null);
set(pr, 'resources', null);
set(pr, 'resources', Object.assign({}, get(pr,'volume.capacity')));
set(pr, 'resources', {
requests: Object.assign({}, get(pr, 'persistentVolume.capacity')),
});
}
if ( !get(this,'actuallySave') ) {

View File

@ -4,6 +4,7 @@ import { alias } from '@ember/object/computed';
import Component from '@ember/component';
import NewOrEdit from 'shared/mixins/new-or-edit';
import ModalBase from 'shared/mixins/modal-base';
import { set } from '@ember/object';
import layout from './template';
export default Component.extend(ModalBase, NewOrEdit, {
@ -16,6 +17,12 @@ export default Component.extend(ModalBase, NewOrEdit, {
primaryResource : alias('originalModel'),
errors : null,
actions: {
updateWhitelist(list) {
set(this, 'primaryResource.whitelistDomains', list);
},
},
init() {
this._super(...arguments);
this.set('clone', this.get('originalModel').clone());

View File

@ -25,4 +25,14 @@
<span class="text-info">{{t 'modalEditDriver.checksum.help'}}</span>
</div>
<div class="inline-form pt-20">
{{form-value-array
initialValues=primaryResource.whitelistDomains
valueLabel="modalEditDriver.whitelist.label"
addActionLabel="modalEditDriver.whitelist.addActionLabel"
noDataLabel="modalEditDriver.whitelist.noData"
changed=(action "updateWhitelist")
}}
</div>
{{save-cancel editing=editing save="save" cancel="cancel"}}

View File

@ -1,4 +1,5 @@
import Component from '@ember/component';
import { observer } from '@ember/object';
import { inject as service } from '@ember/service';
import { formatSi, parseSi } from 'shared/utils/parse-unit';
import layout from './template';
@ -19,6 +20,10 @@ export default Component.extend({
}, 150);
},
updateDashboard: observer('nodes.@each.{allocatable,requested}', function () {
this.setDashboard();
}),
setDashboard() {
const cpuGauge = this.getCpuGauge();
const memoryGauge = this.getMemoryGauge();

View File

@ -4151,6 +4151,11 @@ modalEditDriver:
checksum:
label: Checksum
help: "Optional: Verify that the downloaded driver matches the expected checksum."
whitelist:
label: Whitelist Domains
addActionLabel: Add Domain
noData: No Domains
modalEditSetting:
title: Edit Advanced Setting