2020-10-01 19:37:33 +00:00
|
|
|
|
import DS from 'ember-data';
|
2020-10-08 15:23:59 +00:00
|
|
|
|
import { computed } from '@ember/object';
|
2020-10-09 15:14:55 +00:00
|
|
|
|
import attachCapabilities from 'vault/lib/attach-capabilities';
|
2020-10-08 15:23:59 +00:00
|
|
|
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
2020-10-09 15:14:55 +00:00
|
|
|
|
import { apiPath } from 'vault/macros/lazy-capabilities';
|
2020-10-01 19:37:33 +00:00
|
|
|
|
|
|
|
|
|
const { attr } = DS;
|
|
|
|
|
|
2020-10-09 15:14:55 +00:00
|
|
|
|
const M = DS.Model.extend({
|
2020-10-01 19:37:33 +00:00
|
|
|
|
queriesAvailable: attr('boolean'),
|
2020-10-08 15:23:59 +00:00
|
|
|
|
defaultReportMonths: attr('number', {
|
|
|
|
|
label: 'Default display',
|
|
|
|
|
subText: 'The number of months we’ll display in the Vault usage dashboard by default.',
|
|
|
|
|
}),
|
|
|
|
|
retentionMonths: attr('number', {
|
|
|
|
|
label: 'Retention period',
|
|
|
|
|
subText: 'The number of months of activity logs to maintain for client tracking.',
|
|
|
|
|
}),
|
|
|
|
|
enabled: attr('string', {
|
|
|
|
|
editType: 'boolean',
|
|
|
|
|
trueValue: 'On',
|
|
|
|
|
falseValue: 'Off',
|
|
|
|
|
label: 'Enable usage data collection',
|
|
|
|
|
helpText:
|
|
|
|
|
'Enable or disable client tracking. Keep in mind that disabling tracking will delete the data for the current month.',
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
configAttrs: computed(function() {
|
|
|
|
|
let keys = ['enabled', 'defaultReportMonths', 'retentionMonths'];
|
|
|
|
|
return expandAttributeMeta(this, keys);
|
|
|
|
|
}),
|
2020-10-01 19:37:33 +00:00
|
|
|
|
});
|
2020-10-09 15:14:55 +00:00
|
|
|
|
|
|
|
|
|
export default attachCapabilities(M, {
|
|
|
|
|
configPath: apiPath`sys/internal/counters/config`,
|
|
|
|
|
});
|