diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts new file mode 100644 index 000000000..2c5dc57eb --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form-data.ts @@ -0,0 +1,37 @@ +import { Validators } from '@angular/forms'; + +import { SelectMessages } from '~/app/shared/components/select/select-messages.model'; +import { Pool } from '../pool'; + +export class PoolFormData { + poolTypes: string[]; + erasureInfo = false; + crushInfo = false; + applications: any; + + constructor() { + this.poolTypes = ['erasure', 'replicated']; + this.applications = { + selected: [], + default: ['cephfs', 'rbd', 'rgw'], + available: [], // Filled during runtime + validators: [Validators.pattern('[A-Za-z0-9_]+'), Validators.maxLength(128)], + messages: new SelectMessages({ + empty: $localize`No applications added`, + selectionLimit: { + text: $localize`Applications limit reached`, + tooltip: $localize`A pool can only have up to four applications definitions.` + }, + customValidations: { + pattern: $localize`Allowed characters '_a-zA-Z0-9'`, + maxlength: $localize`Maximum length is 128 characters` + }, + filter: $localize`Filter or add applications'`, + add: $localize`Add application` + }) + }; + } + + pgs = 1; + pool: Pool; // Only available during edit mode +} |