2018-10-12 19:03:01 +00:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import { allFeatures } from 'vault/helpers/all-features';
|
|
|
|
import { computed } from '@ember/object';
|
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
expirationTime: '',
|
|
|
|
startTime: '',
|
|
|
|
licenseId: '',
|
|
|
|
features: null,
|
2018-12-18 17:01:12 +00:00
|
|
|
model: null,
|
2018-10-12 19:03:01 +00:00
|
|
|
text: '',
|
|
|
|
showForm: false,
|
|
|
|
isTemporary: computed('licenseId', function() {
|
|
|
|
return this.licenseId === 'temporary';
|
|
|
|
}),
|
2018-12-18 17:01:12 +00:00
|
|
|
featuresInfo: computed('model', 'features', function() {
|
|
|
|
return allFeatures().map(feature => {
|
|
|
|
let active = this.features.includes(feature);
|
|
|
|
if (active && feature === 'Performance Standby') {
|
|
|
|
let count = this.model.performanceStandbyCount;
|
|
|
|
return {
|
|
|
|
name: feature,
|
|
|
|
active: count ? active : false,
|
|
|
|
count,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return { name: feature, active };
|
2018-10-12 19:03:01 +00:00
|
|
|
});
|
|
|
|
}),
|
|
|
|
saveModel() {},
|
|
|
|
actions: {
|
|
|
|
saveModel(text) {
|
|
|
|
this.saveModel(text);
|
|
|
|
},
|
|
|
|
toggleForm() {
|
|
|
|
this.toggleProperty('showForm');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|