open-vault/ui/app/models/clients/config.js
Angel Garbarino 687469552c
Client count: remove default period and extra controllers (#14050)
* remove controllerS

* remove default report months

* remove default months from the config page

* fix tests

* clean up edit config
2022-02-14 11:30:48 -07:00

31 lines
1 KiB
JavaScript

import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object';
import attachCapabilities from 'vault/lib/attach-capabilities';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import { apiPath } from 'vault/macros/lazy-capabilities';
const M = Model.extend({
queriesAvailable: attr('boolean'),
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', 'retentionMonths'];
return expandAttributeMeta(this, keys);
}),
});
export default attachCapabilities(M, {
configPath: apiPath`sys/internal/counters/config`,
});