@flusys/ng-storage 5.4.1 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{flusys-ng-storage-file-manager-form.component-DnE4Whts.mjs → flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs} +135 -153
- package/fesm2022/flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-file-manager-list.component-Go5Gqptd.mjs → flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs} +126 -97
- package/fesm2022/flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-form.component-BYOD0A_5.mjs → flusys-ng-storage-folder-form.component-Up9luV7j.mjs} +51 -35
- package/fesm2022/flusys-ng-storage-folder-form.component-Up9luV7j.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-list.component-N6RjQQwv.mjs → flusys-ng-storage-folder-list.component-B52N1JaK.mjs} +60 -51
- package/fesm2022/flusys-ng-storage-folder-list.component-B52N1JaK.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-form.component-BdpCYR3c.mjs → flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs} +99 -87
- package/fesm2022/flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-list.component-CtsIrKSq.mjs → flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs} +62 -54
- package/fesm2022/flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs.map +1 -0
- package/fesm2022/flusys-ng-storage.mjs +95 -94
- package/fesm2022/flusys-ng-storage.mjs.map +1 -1
- package/package.json +10 -11
- package/types/flusys-ng-storage.d.ts +5 -11
- package/fesm2022/flusys-ng-storage-file-manager-form.component-DnE4Whts.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-file-manager-list.component-Go5Gqptd.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-form.component-BYOD0A_5.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-list.component-N6RjQQwv.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-form.component-BdpCYR3c.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-list.component-CtsIrKSq.mjs.map +0 -1
|
@@ -3,12 +3,11 @@ import { inject, signal, computed, effect, Component } from '@angular/core';
|
|
|
3
3
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { form, required, FormField } from '@angular/forms/signals';
|
|
5
5
|
import { ActivatedRoute } from '@angular/router';
|
|
6
|
-
import { TranslateService, AngularModule,
|
|
6
|
+
import { TranslateService, AngularModule, TranslatePipe } from '@flusys/ng-shared';
|
|
7
7
|
import { FileLocationEnum, BaseStoragePage, StorageConfigApiService, STORAGE_PROVIDER_OPTIONS } from './flusys-ng-storage.mjs';
|
|
8
|
+
import * as i1$1 from '@flusys/ng-ui';
|
|
9
|
+
import { UiModule } from '@flusys/ng-ui';
|
|
8
10
|
import * as i1 from '@angular/forms';
|
|
9
|
-
import * as i1$1 from 'primeng/button';
|
|
10
|
-
import * as i3 from 'primeng/inputtext';
|
|
11
|
-
import * as i4 from 'primeng/toggleswitch';
|
|
12
11
|
|
|
13
12
|
const DEFAULT_FORM_MODEL = {
|
|
14
13
|
id: '',
|
|
@@ -39,18 +38,23 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
39
38
|
initialized = false;
|
|
40
39
|
fileLocationEnum = FileLocationEnum;
|
|
41
40
|
storageProviderOptions = STORAGE_PROVIDER_OPTIONS;
|
|
42
|
-
existingConfig = signal(null,
|
|
43
|
-
|
|
41
|
+
existingConfig = signal(null, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "existingConfig" }] : /* istanbul ignore next */ []));
|
|
43
|
+
isEditMode = computed(() => !!this.existingConfig(), /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
44
45
|
formModel = signal({
|
|
45
46
|
...DEFAULT_FORM_MODEL,
|
|
46
|
-
},
|
|
47
|
+
}, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []));
|
|
47
49
|
configForm = form(this.formModel, (f) => {
|
|
48
50
|
required(f.name, {
|
|
49
51
|
message: this.translateService.translate('storage.validation.config.name.required'),
|
|
50
52
|
});
|
|
51
53
|
});
|
|
52
|
-
selectedProvider = computed(() => this.formModel().storage,
|
|
53
|
-
|
|
54
|
+
selectedProvider = computed(() => this.formModel().storage, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "selectedProvider" }] : /* istanbul ignore next */ []));
|
|
56
|
+
isFormValid = computed(() => this.formModel().name.trim().length > 0, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "isFormValid" }] : /* istanbul ignore next */ []));
|
|
54
58
|
constructor() {
|
|
55
59
|
super();
|
|
56
60
|
effect(() => {
|
|
@@ -187,8 +191,8 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
187
191
|
return {};
|
|
188
192
|
}
|
|
189
193
|
}
|
|
190
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
191
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: StorageConfigFormComponent, isStandalone: true, selector: "lib-storage-config-form", usesInheritance: true, ngImport: i0, template: `
|
|
192
196
|
<div class="card">
|
|
193
197
|
<h3 class="text-lg sm:text-xl font-semibold mb-4">
|
|
194
198
|
{{
|
|
@@ -213,7 +217,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
213
217
|
>{{ 'storage.config.config.name.required' | translate }}</label
|
|
214
218
|
>
|
|
215
219
|
<input
|
|
216
|
-
|
|
220
|
+
fInputText
|
|
217
221
|
id="name"
|
|
218
222
|
[formField]="configForm.name"
|
|
219
223
|
[placeholder]="
|
|
@@ -229,28 +233,26 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
229
233
|
class="block font-medium mb-2 text-sm sm:text-base"
|
|
230
234
|
>{{ 'storage.config.provider.required' | translate }}</label
|
|
231
235
|
>
|
|
232
|
-
<select
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
<f-select
|
|
237
|
+
inputId="storage"
|
|
238
|
+
[options]="[...storageProviderOptions]"
|
|
239
|
+
optionValue="value"
|
|
235
240
|
[formField]="configForm.storage"
|
|
236
241
|
>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</option>
|
|
241
|
-
}
|
|
242
|
-
</select>
|
|
242
|
+
<ng-template #item let-provider>{{ provider.labelKey | translate }}</ng-template>
|
|
243
|
+
<ng-template #selectedItem let-provider>{{ provider.labelKey | translate }}</ng-template>
|
|
244
|
+
</f-select>
|
|
243
245
|
</div>
|
|
244
246
|
|
|
245
247
|
<div class="field flex items-center gap-2">
|
|
246
|
-
<
|
|
248
|
+
<f-toggleswitch [formField]="configForm.isActive" />
|
|
247
249
|
<label class="text-sm sm:text-base">{{
|
|
248
250
|
'shared.active' | translate
|
|
249
251
|
}}</label>
|
|
250
252
|
</div>
|
|
251
253
|
|
|
252
254
|
<div class="field flex items-center gap-2">
|
|
253
|
-
<
|
|
255
|
+
<f-toggleswitch [formField]="configForm.isDefault" />
|
|
254
256
|
<label class="text-sm sm:text-base">{{
|
|
255
257
|
'storage.set.as.default' | translate
|
|
256
258
|
}}</label>
|
|
@@ -274,7 +276,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
274
276
|
>{{ 'storage.config.region.required' | translate }}</label
|
|
275
277
|
>
|
|
276
278
|
<input
|
|
277
|
-
|
|
279
|
+
fInputText
|
|
278
280
|
id="awsRegion"
|
|
279
281
|
[formField]="configForm.awsRegion"
|
|
280
282
|
[placeholder]="'storage.aws.region.placeholder' | translate"
|
|
@@ -288,7 +290,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
288
290
|
>{{ 'storage.config.bucket.required' | translate }}</label
|
|
289
291
|
>
|
|
290
292
|
<input
|
|
291
|
-
|
|
293
|
+
fInputText
|
|
292
294
|
id="awsBucket"
|
|
293
295
|
[formField]="configForm.awsBucket"
|
|
294
296
|
[placeholder]="'storage.aws.bucket.placeholder' | translate"
|
|
@@ -302,7 +304,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
302
304
|
>{{ 'storage.config.access.key.required' | translate }}</label
|
|
303
305
|
>
|
|
304
306
|
<input
|
|
305
|
-
|
|
307
|
+
fInputText
|
|
306
308
|
id="awsAccessKeyId"
|
|
307
309
|
[formField]="configForm.awsAccessKeyId"
|
|
308
310
|
class="w-full"
|
|
@@ -316,7 +318,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
316
318
|
>
|
|
317
319
|
<input
|
|
318
320
|
type="password"
|
|
319
|
-
|
|
321
|
+
fInputText
|
|
320
322
|
id="awsSecretAccessKey"
|
|
321
323
|
[formField]="configForm.awsSecretAccessKey"
|
|
322
324
|
class="w-full"
|
|
@@ -329,7 +331,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
329
331
|
>{{ 'storage.config.endpoint.optional' | translate }}</label
|
|
330
332
|
>
|
|
331
333
|
<input
|
|
332
|
-
|
|
334
|
+
fInputText
|
|
333
335
|
id="awsEndpoint"
|
|
334
336
|
[formField]="configForm.awsEndpoint"
|
|
335
337
|
[placeholder]="
|
|
@@ -358,7 +360,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
358
360
|
>{{ 'storage.azure.account.name.required' | translate }}</label
|
|
359
361
|
>
|
|
360
362
|
<input
|
|
361
|
-
|
|
363
|
+
fInputText
|
|
362
364
|
id="azureAccountName"
|
|
363
365
|
[formField]="configForm.azureAccountName"
|
|
364
366
|
class="w-full"
|
|
@@ -373,7 +375,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
373
375
|
}}</label
|
|
374
376
|
>
|
|
375
377
|
<input
|
|
376
|
-
|
|
378
|
+
fInputText
|
|
377
379
|
id="azureContainerName"
|
|
378
380
|
[formField]="configForm.azureContainerName"
|
|
379
381
|
class="w-full"
|
|
@@ -387,7 +389,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
387
389
|
>
|
|
388
390
|
<input
|
|
389
391
|
type="password"
|
|
390
|
-
|
|
392
|
+
fInputText
|
|
391
393
|
id="azureAccountKey"
|
|
392
394
|
[formField]="configForm.azureAccountKey"
|
|
393
395
|
class="w-full"
|
|
@@ -413,7 +415,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
413
415
|
>{{ 'storage.sftp.host.required' | translate }}</label
|
|
414
416
|
>
|
|
415
417
|
<input
|
|
416
|
-
|
|
418
|
+
fInputText
|
|
417
419
|
id="sftpHost"
|
|
418
420
|
[formField]="configForm.sftpHost"
|
|
419
421
|
[placeholder]="'storage.sftp.host.placeholder' | translate"
|
|
@@ -428,7 +430,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
428
430
|
>
|
|
429
431
|
<input
|
|
430
432
|
type="number"
|
|
431
|
-
|
|
433
|
+
fInputText
|
|
432
434
|
id="sftpPort"
|
|
433
435
|
[formField]="configForm.sftpPort"
|
|
434
436
|
[placeholder]="'storage.sftp.port.placeholder' | translate"
|
|
@@ -442,7 +444,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
442
444
|
>{{ 'storage.sftp.username.required' | translate }}</label
|
|
443
445
|
>
|
|
444
446
|
<input
|
|
445
|
-
|
|
447
|
+
fInputText
|
|
446
448
|
id="sftpUsername"
|
|
447
449
|
[formField]="configForm.sftpUsername"
|
|
448
450
|
class="w-full"
|
|
@@ -456,7 +458,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
456
458
|
>
|
|
457
459
|
<input
|
|
458
460
|
type="password"
|
|
459
|
-
|
|
461
|
+
fInputText
|
|
460
462
|
id="sftpPassword"
|
|
461
463
|
[formField]="configForm.sftpPassword"
|
|
462
464
|
class="w-full"
|
|
@@ -469,7 +471,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
469
471
|
>{{ 'storage.sftp.base.path.required' | translate }}</label
|
|
470
472
|
>
|
|
471
473
|
<input
|
|
472
|
-
|
|
474
|
+
fInputText
|
|
473
475
|
id="sftpBasePath"
|
|
474
476
|
[formField]="configForm.sftpBasePath"
|
|
475
477
|
[placeholder]="'storage.sftp.base.path.placeholder' | translate"
|
|
@@ -496,7 +498,7 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
496
498
|
>{{ 'storage.local.base.path.required' | translate }}</label
|
|
497
499
|
>
|
|
498
500
|
<input
|
|
499
|
-
|
|
501
|
+
fInputText
|
|
500
502
|
id="localBasePath"
|
|
501
503
|
[formField]="configForm.localBasePath"
|
|
502
504
|
[placeholder]="
|
|
@@ -509,30 +511,36 @@ class StorageConfigFormComponent extends BaseStoragePage {
|
|
|
509
511
|
}
|
|
510
512
|
|
|
511
513
|
<div class="flex justify-end gap-2 mt-4">
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
+
<button
|
|
515
|
+
fButton
|
|
514
516
|
severity="secondary"
|
|
515
517
|
[outlined]="true"
|
|
516
|
-
(
|
|
517
|
-
|
|
518
|
-
|
|
518
|
+
(click)="onCancel()"
|
|
519
|
+
>
|
|
520
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
521
|
+
</button>
|
|
522
|
+
<button
|
|
523
|
+
fButton
|
|
519
524
|
type="submit"
|
|
520
|
-
[label]="
|
|
521
|
-
(isEditMode() ? 'shared.update' : 'shared.create') | translate
|
|
522
|
-
"
|
|
523
|
-
[loading]="isLoading()"
|
|
524
525
|
[disabled]="!isFormValid() || isLoading()"
|
|
525
|
-
|
|
526
|
+
>
|
|
527
|
+
@if (isLoading()) {
|
|
528
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
529
|
+
}
|
|
530
|
+
<span pButtonLabel>{{
|
|
531
|
+
(isEditMode() ? 'shared.update' : 'shared.create') | translate
|
|
532
|
+
}}</span>
|
|
533
|
+
</button>
|
|
526
534
|
</div>
|
|
527
535
|
</form>
|
|
528
536
|
</div>
|
|
529
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.
|
|
537
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i1$1.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "directive", type: i1$1.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i1$1.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "component", type: i1$1.ToggleSwitchComponent, selector: "f-toggleswitch", inputs: ["disabled", "readonly", "invalid", "ariaLabel", "trueValue", "falseValue", "inputId"] }, { kind: "component", type: i1$1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
530
538
|
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigFormComponent, decorators: [{
|
|
532
540
|
type: Component,
|
|
533
541
|
args: [{
|
|
534
542
|
selector: 'lib-storage-config-form',
|
|
535
|
-
imports: [AngularModule,
|
|
543
|
+
imports: [AngularModule, UiModule, FormField, TranslatePipe],
|
|
536
544
|
template: `
|
|
537
545
|
<div class="card">
|
|
538
546
|
<h3 class="text-lg sm:text-xl font-semibold mb-4">
|
|
@@ -558,7 +566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
558
566
|
>{{ 'storage.config.config.name.required' | translate }}</label
|
|
559
567
|
>
|
|
560
568
|
<input
|
|
561
|
-
|
|
569
|
+
fInputText
|
|
562
570
|
id="name"
|
|
563
571
|
[formField]="configForm.name"
|
|
564
572
|
[placeholder]="
|
|
@@ -574,28 +582,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
574
582
|
class="block font-medium mb-2 text-sm sm:text-base"
|
|
575
583
|
>{{ 'storage.config.provider.required' | translate }}</label
|
|
576
584
|
>
|
|
577
|
-
<select
|
|
578
|
-
|
|
579
|
-
|
|
585
|
+
<f-select
|
|
586
|
+
inputId="storage"
|
|
587
|
+
[options]="[...storageProviderOptions]"
|
|
588
|
+
optionValue="value"
|
|
580
589
|
[formField]="configForm.storage"
|
|
581
590
|
>
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
</option>
|
|
586
|
-
}
|
|
587
|
-
</select>
|
|
591
|
+
<ng-template #item let-provider>{{ provider.labelKey | translate }}</ng-template>
|
|
592
|
+
<ng-template #selectedItem let-provider>{{ provider.labelKey | translate }}</ng-template>
|
|
593
|
+
</f-select>
|
|
588
594
|
</div>
|
|
589
595
|
|
|
590
596
|
<div class="field flex items-center gap-2">
|
|
591
|
-
<
|
|
597
|
+
<f-toggleswitch [formField]="configForm.isActive" />
|
|
592
598
|
<label class="text-sm sm:text-base">{{
|
|
593
599
|
'shared.active' | translate
|
|
594
600
|
}}</label>
|
|
595
601
|
</div>
|
|
596
602
|
|
|
597
603
|
<div class="field flex items-center gap-2">
|
|
598
|
-
<
|
|
604
|
+
<f-toggleswitch [formField]="configForm.isDefault" />
|
|
599
605
|
<label class="text-sm sm:text-base">{{
|
|
600
606
|
'storage.set.as.default' | translate
|
|
601
607
|
}}</label>
|
|
@@ -619,7 +625,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
619
625
|
>{{ 'storage.config.region.required' | translate }}</label
|
|
620
626
|
>
|
|
621
627
|
<input
|
|
622
|
-
|
|
628
|
+
fInputText
|
|
623
629
|
id="awsRegion"
|
|
624
630
|
[formField]="configForm.awsRegion"
|
|
625
631
|
[placeholder]="'storage.aws.region.placeholder' | translate"
|
|
@@ -633,7 +639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
633
639
|
>{{ 'storage.config.bucket.required' | translate }}</label
|
|
634
640
|
>
|
|
635
641
|
<input
|
|
636
|
-
|
|
642
|
+
fInputText
|
|
637
643
|
id="awsBucket"
|
|
638
644
|
[formField]="configForm.awsBucket"
|
|
639
645
|
[placeholder]="'storage.aws.bucket.placeholder' | translate"
|
|
@@ -647,7 +653,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
647
653
|
>{{ 'storage.config.access.key.required' | translate }}</label
|
|
648
654
|
>
|
|
649
655
|
<input
|
|
650
|
-
|
|
656
|
+
fInputText
|
|
651
657
|
id="awsAccessKeyId"
|
|
652
658
|
[formField]="configForm.awsAccessKeyId"
|
|
653
659
|
class="w-full"
|
|
@@ -661,7 +667,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
661
667
|
>
|
|
662
668
|
<input
|
|
663
669
|
type="password"
|
|
664
|
-
|
|
670
|
+
fInputText
|
|
665
671
|
id="awsSecretAccessKey"
|
|
666
672
|
[formField]="configForm.awsSecretAccessKey"
|
|
667
673
|
class="w-full"
|
|
@@ -674,7 +680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
674
680
|
>{{ 'storage.config.endpoint.optional' | translate }}</label
|
|
675
681
|
>
|
|
676
682
|
<input
|
|
677
|
-
|
|
683
|
+
fInputText
|
|
678
684
|
id="awsEndpoint"
|
|
679
685
|
[formField]="configForm.awsEndpoint"
|
|
680
686
|
[placeholder]="
|
|
@@ -703,7 +709,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
703
709
|
>{{ 'storage.azure.account.name.required' | translate }}</label
|
|
704
710
|
>
|
|
705
711
|
<input
|
|
706
|
-
|
|
712
|
+
fInputText
|
|
707
713
|
id="azureAccountName"
|
|
708
714
|
[formField]="configForm.azureAccountName"
|
|
709
715
|
class="w-full"
|
|
@@ -718,7 +724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
718
724
|
}}</label
|
|
719
725
|
>
|
|
720
726
|
<input
|
|
721
|
-
|
|
727
|
+
fInputText
|
|
722
728
|
id="azureContainerName"
|
|
723
729
|
[formField]="configForm.azureContainerName"
|
|
724
730
|
class="w-full"
|
|
@@ -732,7 +738,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
732
738
|
>
|
|
733
739
|
<input
|
|
734
740
|
type="password"
|
|
735
|
-
|
|
741
|
+
fInputText
|
|
736
742
|
id="azureAccountKey"
|
|
737
743
|
[formField]="configForm.azureAccountKey"
|
|
738
744
|
class="w-full"
|
|
@@ -758,7 +764,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
758
764
|
>{{ 'storage.sftp.host.required' | translate }}</label
|
|
759
765
|
>
|
|
760
766
|
<input
|
|
761
|
-
|
|
767
|
+
fInputText
|
|
762
768
|
id="sftpHost"
|
|
763
769
|
[formField]="configForm.sftpHost"
|
|
764
770
|
[placeholder]="'storage.sftp.host.placeholder' | translate"
|
|
@@ -773,7 +779,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
773
779
|
>
|
|
774
780
|
<input
|
|
775
781
|
type="number"
|
|
776
|
-
|
|
782
|
+
fInputText
|
|
777
783
|
id="sftpPort"
|
|
778
784
|
[formField]="configForm.sftpPort"
|
|
779
785
|
[placeholder]="'storage.sftp.port.placeholder' | translate"
|
|
@@ -787,7 +793,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
787
793
|
>{{ 'storage.sftp.username.required' | translate }}</label
|
|
788
794
|
>
|
|
789
795
|
<input
|
|
790
|
-
|
|
796
|
+
fInputText
|
|
791
797
|
id="sftpUsername"
|
|
792
798
|
[formField]="configForm.sftpUsername"
|
|
793
799
|
class="w-full"
|
|
@@ -801,7 +807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
801
807
|
>
|
|
802
808
|
<input
|
|
803
809
|
type="password"
|
|
804
|
-
|
|
810
|
+
fInputText
|
|
805
811
|
id="sftpPassword"
|
|
806
812
|
[formField]="configForm.sftpPassword"
|
|
807
813
|
class="w-full"
|
|
@@ -814,7 +820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
814
820
|
>{{ 'storage.sftp.base.path.required' | translate }}</label
|
|
815
821
|
>
|
|
816
822
|
<input
|
|
817
|
-
|
|
823
|
+
fInputText
|
|
818
824
|
id="sftpBasePath"
|
|
819
825
|
[formField]="configForm.sftpBasePath"
|
|
820
826
|
[placeholder]="'storage.sftp.base.path.placeholder' | translate"
|
|
@@ -841,7 +847,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
841
847
|
>{{ 'storage.local.base.path.required' | translate }}</label
|
|
842
848
|
>
|
|
843
849
|
<input
|
|
844
|
-
|
|
850
|
+
fInputText
|
|
845
851
|
id="localBasePath"
|
|
846
852
|
[formField]="configForm.localBasePath"
|
|
847
853
|
[placeholder]="
|
|
@@ -854,20 +860,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
854
860
|
}
|
|
855
861
|
|
|
856
862
|
<div class="flex justify-end gap-2 mt-4">
|
|
857
|
-
<
|
|
858
|
-
|
|
863
|
+
<button
|
|
864
|
+
fButton
|
|
859
865
|
severity="secondary"
|
|
860
866
|
[outlined]="true"
|
|
861
|
-
(
|
|
862
|
-
|
|
863
|
-
|
|
867
|
+
(click)="onCancel()"
|
|
868
|
+
>
|
|
869
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
870
|
+
</button>
|
|
871
|
+
<button
|
|
872
|
+
fButton
|
|
864
873
|
type="submit"
|
|
865
|
-
[label]="
|
|
866
|
-
(isEditMode() ? 'shared.update' : 'shared.create') | translate
|
|
867
|
-
"
|
|
868
|
-
[loading]="isLoading()"
|
|
869
874
|
[disabled]="!isFormValid() || isLoading()"
|
|
870
|
-
|
|
875
|
+
>
|
|
876
|
+
@if (isLoading()) {
|
|
877
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
878
|
+
}
|
|
879
|
+
<span pButtonLabel>{{
|
|
880
|
+
(isEditMode() ? 'shared.update' : 'shared.create') | translate
|
|
881
|
+
}}</span>
|
|
882
|
+
</button>
|
|
871
883
|
</div>
|
|
872
884
|
</form>
|
|
873
885
|
</div>
|
|
@@ -876,4 +888,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
876
888
|
}], ctorParameters: () => [] });
|
|
877
889
|
|
|
878
890
|
export { StorageConfigFormComponent };
|
|
879
|
-
//# sourceMappingURL=flusys-ng-storage-storage-config-form.component-
|
|
891
|
+
//# sourceMappingURL=flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs","sources":["../../../projects/ng-storage/pages/storage-config/storage-config-form.component.ts"],"sourcesContent":["import { Component, computed, effect, inject, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { form, FormField, required } from '@angular/forms/signals';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n AngularModule,\n TranslatePipe,\n TranslateService,\n} from '@flusys/ng-shared';\nimport { FileLocationEnum } from '../../enums/file-location.enum';\nimport { IStorageConfig } from '../../interfaces/storage-config.interface';\nimport { StorageConfigApiService } from '../../services/storage-config-api.service';\nimport { BaseStoragePage } from '../../utils/base-storage-page';\nimport { STORAGE_PROVIDER_OPTIONS } from '../../utils/storage-utils';\nimport { UiModule } from '@flusys/ng-ui';\n\ninterface IStorageConfigFormModel {\n id: string;\n name: string;\n storage: FileLocationEnum;\n isActive: boolean;\n isDefault: boolean;\n awsRegion: string;\n awsBucket: string;\n awsAccessKeyId: string;\n awsSecretAccessKey: string;\n awsEndpoint: string;\n azureAccountName: string;\n azureAccountKey: string;\n azureContainerName: string;\n sftpHost: string;\n sftpPort: string;\n sftpUsername: string;\n sftpPassword: string;\n sftpBasePath: string;\n localBasePath: string;\n}\n\nconst DEFAULT_FORM_MODEL: IStorageConfigFormModel = {\n id: '',\n name: '',\n storage: FileLocationEnum.AWS,\n isActive: true,\n isDefault: false,\n awsRegion: '',\n awsBucket: '',\n awsAccessKeyId: '',\n awsSecretAccessKey: '',\n awsEndpoint: '',\n azureAccountName: '',\n azureAccountKey: '',\n azureContainerName: '',\n sftpHost: '',\n sftpPort: '22',\n sftpUsername: '',\n sftpPassword: '',\n sftpBasePath: '',\n localBasePath: '',\n};\n\n@Component({\n selector: 'lib-storage-config-form',\n imports: [AngularModule, UiModule, FormField, TranslatePipe],\n template: `\n <div class=\"card\">\n <h3 class=\"text-lg sm:text-xl font-semibold mb-4\">\n {{\n (isEditMode()\n ? 'storage.config.edit.config'\n : 'storage.config.new.config'\n ) | translate\n }}\n </h3>\n @if (showCompanyInfo()) {\n <p class=\"text-sm text-muted-color mb-4\">\n {{ 'shared.company' | translate }}: {{ currentCompanyName() }}\n </p>\n }\n\n <form (ngSubmit)=\"onSubmit()\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div class=\"field\">\n <label\n for=\"name\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.config.name.required' | translate }}</label\n >\n <input\n fInputText\n id=\"name\"\n [formField]=\"configForm.name\"\n [placeholder]=\"\n 'storage.config.config.name.placeholder' | translate\n \"\n class=\"w-full\"\n />\n </div>\n\n <div class=\"field\">\n <label\n for=\"storage\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.provider.required' | translate }}</label\n >\n <f-select\n inputId=\"storage\"\n [options]=\"[...storageProviderOptions]\"\n optionValue=\"value\"\n [formField]=\"configForm.storage\"\n >\n <ng-template #item let-provider>{{ provider.labelKey | translate }}</ng-template>\n <ng-template #selectedItem let-provider>{{ provider.labelKey | translate }}</ng-template>\n </f-select>\n </div>\n\n <div class=\"field flex items-center gap-2\">\n <f-toggleswitch [formField]=\"configForm.isActive\" />\n <label class=\"text-sm sm:text-base\">{{\n 'shared.active' | translate\n }}</label>\n </div>\n\n <div class=\"field flex items-center gap-2\">\n <f-toggleswitch [formField]=\"configForm.isDefault\" />\n <label class=\"text-sm sm:text-base\">{{\n 'storage.set.as.default' | translate\n }}</label>\n </div>\n </div>\n\n @if (selectedProvider() === fileLocationEnum.AWS) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4 p-4 bg-surface-ground rounded-lg border border-surface\"\n >\n <div class=\"md:col-span-2 mb-2\">\n <span\n class=\"text-sm font-semibold text-muted-color uppercase tracking-wide\"\n >{{ 'storage.aws.title' | translate }}</span\n >\n </div>\n <div class=\"field\">\n <label\n for=\"awsRegion\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.region.required' | translate }}</label\n >\n <input\n fInputText\n id=\"awsRegion\"\n [formField]=\"configForm.awsRegion\"\n [placeholder]=\"'storage.aws.region.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"awsBucket\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.bucket.required' | translate }}</label\n >\n <input\n fInputText\n id=\"awsBucket\"\n [formField]=\"configForm.awsBucket\"\n [placeholder]=\"'storage.aws.bucket.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"awsAccessKeyId\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.access.key.required' | translate }}</label\n >\n <input\n fInputText\n id=\"awsAccessKeyId\"\n [formField]=\"configForm.awsAccessKeyId\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"awsSecretAccessKey\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.secret.key.required' | translate }}</label\n >\n <input\n type=\"password\"\n fInputText\n id=\"awsSecretAccessKey\"\n [formField]=\"configForm.awsSecretAccessKey\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field md:col-span-2\">\n <label\n for=\"awsEndpoint\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.config.endpoint.optional' | translate }}</label\n >\n <input\n fInputText\n id=\"awsEndpoint\"\n [formField]=\"configForm.awsEndpoint\"\n [placeholder]=\"\n 'storage.config.endpoint.placeholder' | translate\n \"\n class=\"w-full\"\n />\n </div>\n </div>\n }\n\n @if (selectedProvider() === fileLocationEnum.AZURE) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4 p-4 bg-surface-ground rounded-lg border border-surface\"\n >\n <div class=\"md:col-span-2 mb-2\">\n <span\n class=\"text-sm font-semibold text-muted-color uppercase tracking-wide\"\n >{{ 'storage.azure.title' | translate }}</span\n >\n </div>\n <div class=\"field\">\n <label\n for=\"azureAccountName\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.azure.account.name.required' | translate }}</label\n >\n <input\n fInputText\n id=\"azureAccountName\"\n [formField]=\"configForm.azureAccountName\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"azureContainerName\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{\n 'storage.azure.container.name.required' | translate\n }}</label\n >\n <input\n fInputText\n id=\"azureContainerName\"\n [formField]=\"configForm.azureContainerName\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field md:col-span-2\">\n <label\n for=\"azureAccountKey\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.azure.account.key.required' | translate }}</label\n >\n <input\n type=\"password\"\n fInputText\n id=\"azureAccountKey\"\n [formField]=\"configForm.azureAccountKey\"\n class=\"w-full\"\n />\n </div>\n </div>\n }\n\n @if (selectedProvider() === fileLocationEnum.SFTP) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4 p-4 bg-surface-ground rounded-lg border border-surface\"\n >\n <div class=\"md:col-span-2 mb-2\">\n <span\n class=\"text-sm font-semibold text-muted-color uppercase tracking-wide\"\n >{{ 'storage.sftp.title' | translate }}</span\n >\n </div>\n <div class=\"field\">\n <label\n for=\"sftpHost\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.sftp.host.required' | translate }}</label\n >\n <input\n fInputText\n id=\"sftpHost\"\n [formField]=\"configForm.sftpHost\"\n [placeholder]=\"'storage.sftp.host.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"sftpPort\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.sftp.port.required' | translate }}</label\n >\n <input\n type=\"number\"\n fInputText\n id=\"sftpPort\"\n [formField]=\"configForm.sftpPort\"\n [placeholder]=\"'storage.sftp.port.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"sftpUsername\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.sftp.username.required' | translate }}</label\n >\n <input\n fInputText\n id=\"sftpUsername\"\n [formField]=\"configForm.sftpUsername\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field\">\n <label\n for=\"sftpPassword\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.sftp.password.required' | translate }}</label\n >\n <input\n type=\"password\"\n fInputText\n id=\"sftpPassword\"\n [formField]=\"configForm.sftpPassword\"\n class=\"w-full\"\n />\n </div>\n <div class=\"field md:col-span-2\">\n <label\n for=\"sftpBasePath\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.sftp.base.path.required' | translate }}</label\n >\n <input\n fInputText\n id=\"sftpBasePath\"\n [formField]=\"configForm.sftpBasePath\"\n [placeholder]=\"'storage.sftp.base.path.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n </div>\n }\n\n @if (selectedProvider() === fileLocationEnum.LOCAL) {\n <div\n class=\"grid grid-cols-1 gap-4 mt-4 p-4 bg-surface-ground rounded-lg border border-surface\"\n >\n <div class=\"mb-2\">\n <span\n class=\"text-sm font-semibold text-muted-color uppercase tracking-wide\"\n >{{ 'storage.local.title' | translate }}</span\n >\n </div>\n <div class=\"field\">\n <label\n for=\"localBasePath\"\n class=\"block font-medium mb-2 text-sm sm:text-base\"\n >{{ 'storage.local.base.path.required' | translate }}</label\n >\n <input\n fInputText\n id=\"localBasePath\"\n [formField]=\"configForm.localBasePath\"\n [placeholder]=\"\n 'storage.local.base.path.placeholder' | translate\n \"\n class=\"w-full\"\n />\n </div>\n </div>\n }\n\n <div class=\"flex justify-end gap-2 mt-4\">\n <button\n fButton\n severity=\"secondary\"\n [outlined]=\"true\"\n (click)=\"onCancel()\"\n >\n <span pButtonLabel>{{ 'shared.cancel' | translate }}</span>\n </button>\n <button\n fButton\n type=\"submit\"\n [disabled]=\"!isFormValid() || isLoading()\"\n >\n @if (isLoading()) {\n <ui-icon pButtonIcon name=\"spinner\" [spin]=\"true\"></ui-icon>\n }\n <span pButtonLabel>{{ \n (isEditMode() ? 'shared.update' : 'shared.create') | translate\n }}</span>\n </button>\n </div>\n </form>\n </div>\n `,\n})\nexport class StorageConfigFormComponent extends BaseStoragePage {\n private readonly route = inject(ActivatedRoute);\n private readonly configService = inject(StorageConfigApiService);\n private readonly translateService = inject(TranslateService);\n private readonly routeParams = toSignal(this.route.paramMap);\n private initialized = false;\n\n readonly fileLocationEnum = FileLocationEnum;\n readonly storageProviderOptions = STORAGE_PROVIDER_OPTIONS;\n\n readonly existingConfig = signal<IStorageConfig | null>(null);\n readonly isEditMode = computed(() => !!this.existingConfig());\n readonly formModel = signal<IStorageConfigFormModel>({\n ...DEFAULT_FORM_MODEL,\n });\n\n readonly configForm = form(this.formModel, (f) => {\n required(f.name, {\n message: this.translateService.translate(\n 'storage.validation.config.name.required',\n ),\n });\n });\n\n readonly selectedProvider = computed(() => this.formModel().storage);\n readonly isFormValid = computed(\n () => this.formModel().name.trim().length > 0,\n );\n\n constructor() {\n super();\n effect(() => {\n const params = this.routeParams();\n if (!params || this.initialized) return;\n\n this.initialized = true;\n const configId = params.get('id');\n if (configId && configId !== 'new') {\n this.loadConfig(configId);\n }\n });\n }\n\n async loadConfig(id: string): Promise<void> {\n this.isLoading.set(true);\n try {\n const response = await this.configService.findById(id);\n if (response.success && response.data) {\n const config = response.data;\n this.existingConfig.set(config);\n this.formModel.update((m) => ({\n ...m,\n id: config.id,\n name: config.name,\n storage: config.storage,\n isActive: config.isActive ?? true,\n isDefault: config.isDefault ?? false,\n ...this.extractProviderConfig(config),\n }));\n }\n } catch {\n this.navigateTo(['/storage/configs']);\n } finally {\n this.isLoading.set(false);\n }\n }\n\n async onSubmit(): Promise<void> {\n if (!this.isFormValid()) return;\n\n this.isLoading.set(true);\n try {\n const formValue = this.formModel();\n const config = this.buildProviderConfig(formValue);\n\n const response = this.isEditMode()\n ? await this.configService.update({\n id: formValue.id,\n name: formValue.name,\n storage: formValue.storage,\n config,\n isActive: formValue.isActive,\n isDefault: formValue.isDefault,\n })\n : await this.configService.insert({\n name: formValue.name,\n storage: formValue.storage,\n config,\n isActive: formValue.isActive,\n isDefault: formValue.isDefault,\n });\n\n this.showSuccess(\n response.messageKey\n ? this.translateService.translate(\n response.messageKey,\n response.messageVariables as Record<string, string | number>,\n )\n : (response.message ?? ''),\n );\n this.navigateTo(['/storage/configs']);\n } catch {\n } finally {\n this.isLoading.set(false);\n }\n }\n\n onCancel(): void {\n this.navigateTo(['/storage/configs']);\n }\n\n private extractProviderConfig(\n config: IStorageConfig,\n ): Partial<IStorageConfigFormModel> {\n const c = config.config ?? {};\n switch (config.storage) {\n case FileLocationEnum.AWS:\n return {\n awsRegion: (c['region'] as string) || '',\n awsBucket: (c['bucket'] as string) || '',\n awsAccessKeyId: (c['accessKeyId'] as string) || '',\n awsSecretAccessKey: (c['secretAccessKey'] as string) || '',\n awsEndpoint: (c['endpoint'] as string) || '',\n };\n case FileLocationEnum.AZURE:\n return {\n azureAccountName: (c['accountName'] as string) || '',\n azureAccountKey: (c['accountKey'] as string) || '',\n azureContainerName: (c['containerName'] as string) || '',\n };\n case FileLocationEnum.SFTP:\n return {\n sftpHost: (c['host'] as string) || '',\n sftpPort: ((c['port'] as number) || 22).toString(),\n sftpUsername: (c['username'] as string) || '',\n sftpPassword: (c['password'] as string) || '',\n sftpBasePath: (c['basePath'] as string) || '',\n };\n case FileLocationEnum.LOCAL:\n return { localBasePath: (c['basePath'] as string) || '' };\n default:\n return {};\n }\n }\n\n private buildProviderConfig(\n formValue: IStorageConfigFormModel,\n ): Record<string, unknown> {\n switch (formValue.storage) {\n case FileLocationEnum.AWS:\n return {\n region: formValue.awsRegion,\n bucket: formValue.awsBucket,\n accessKeyId: formValue.awsAccessKeyId,\n secretAccessKey: formValue.awsSecretAccessKey,\n ...(formValue.awsEndpoint && { endpoint: formValue.awsEndpoint }),\n };\n case FileLocationEnum.AZURE:\n return {\n accountName: formValue.azureAccountName,\n accountKey: formValue.azureAccountKey,\n containerName: formValue.azureContainerName,\n };\n case FileLocationEnum.SFTP:\n return {\n host: formValue.sftpHost,\n port: formValue.sftpPort ? parseInt(formValue.sftpPort, 10) : 22,\n username: formValue.sftpUsername,\n password: formValue.sftpPassword,\n basePath: formValue.sftpBasePath,\n };\n case FileLocationEnum.LOCAL:\n return { basePath: formValue.localBasePath };\n default:\n return {};\n }\n }\n}\n"],"names":["i2"],"mappings":";;;;;;;;;;;AAsCA,MAAM,kBAAkB,GAA4B;AAClD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,gBAAgB,CAAC,GAAG;AAC7B,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,cAAc,EAAE,EAAE;AAClB,I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