@flusys/ng-storage 3.0.0 → 4.0.0-rc
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/README.md +13 -7
- package/fesm2022/{flusys-ng-storage-file-manager-form.component-CXVB9G-f.mjs → flusys-ng-storage-file-manager-form.component-AM7JE-s5.mjs} +67 -74
- package/fesm2022/flusys-ng-storage-file-manager-form.component-AM7JE-s5.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-file-manager-list.component-0O_b4EjN.mjs → flusys-ng-storage-file-manager-list.component-bj6oOzOL.mjs} +66 -74
- package/fesm2022/flusys-ng-storage-file-manager-list.component-bj6oOzOL.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-form.component-BTQGEqNu.mjs → flusys-ng-storage-folder-form.component-Cc2ybTwu.mjs} +25 -34
- package/fesm2022/flusys-ng-storage-folder-form.component-Cc2ybTwu.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-list.component-B8GoIh6Z.mjs → flusys-ng-storage-folder-list.component-B2Q41I1g.mjs} +34 -39
- package/fesm2022/flusys-ng-storage-folder-list.component-B2Q41I1g.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-form.component-CorNWrmF.mjs → flusys-ng-storage-storage-config-form.component-a88XhuPH.mjs} +87 -85
- package/fesm2022/flusys-ng-storage-storage-config-form.component-a88XhuPH.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-list.component-YXzz3Tvo.mjs → flusys-ng-storage-storage-config-list.component-DBH_qf9o.mjs} +36 -35
- package/fesm2022/flusys-ng-storage-storage-config-list.component-DBH_qf9o.mjs.map +1 -0
- package/fesm2022/flusys-ng-storage.mjs +490 -151
- package/fesm2022/flusys-ng-storage.mjs.map +1 -1
- package/package.json +4 -4
- package/types/flusys-ng-storage.d.ts +56 -36
- package/fesm2022/flusys-ng-storage-file-manager-form.component-CXVB9G-f.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-file-manager-list.component-0O_b4EjN.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-form.component-BTQGEqNu.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-list.component-B8GoIh6Z.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-form.component-CorNWrmF.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-list.component-YXzz3Tvo.mjs.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import {
|
|
2
|
+
import { inject, Component } from '@angular/core';
|
|
3
|
+
import { TranslateService } from '@flusys/ng-localization';
|
|
4
|
+
import { STORAGE_CONFIG_PERMISSIONS, AngularModule, PrimeModule, HasPermissionDirective, TranslatePipe } from '@flusys/ng-shared';
|
|
4
5
|
import { firstValueFrom } from 'rxjs';
|
|
5
|
-
import { BaseStorageListPage, StorageConfigApiService, getProviderIcon,
|
|
6
|
+
import { BaseStorageListPage, StorageConfigApiService, getProviderIcon, getProviderLabelKey, getProviderSeverity } from './flusys-ng-storage.mjs';
|
|
6
7
|
import * as i1 from 'primeng/button';
|
|
7
8
|
import * as i2 from 'primeng/table';
|
|
8
9
|
import * as i3 from 'primeng/tag';
|
|
@@ -12,14 +13,15 @@ import * as i5 from '@angular/common';
|
|
|
12
13
|
class StorageConfigListComponent extends BaseStorageListPage {
|
|
13
14
|
STORAGE_CONFIG_PERMISSIONS = STORAGE_CONFIG_PERMISSIONS;
|
|
14
15
|
configService = inject(StorageConfigApiService);
|
|
16
|
+
translateService = inject(TranslateService);
|
|
15
17
|
getProviderIcon = getProviderIcon;
|
|
16
|
-
|
|
18
|
+
getProviderLabelKey = getProviderLabelKey;
|
|
17
19
|
getProviderSeverity = getProviderSeverity;
|
|
18
20
|
getResourceRoute() {
|
|
19
21
|
return '/storage/configs';
|
|
20
22
|
}
|
|
21
23
|
getDeleteConfirmMessage(config) {
|
|
22
|
-
return
|
|
24
|
+
return this.translateService.translate('storage.delete.confirm.named', { name: config.name });
|
|
23
25
|
}
|
|
24
26
|
async loadData() {
|
|
25
27
|
this.isLoading.set(true);
|
|
@@ -31,7 +33,7 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
catch {
|
|
34
|
-
this.showError('
|
|
36
|
+
this.showError(this.translateService.translate('storage.config.load.failed'));
|
|
35
37
|
}
|
|
36
38
|
finally {
|
|
37
39
|
this.isLoading.set(false);
|
|
@@ -39,9 +41,9 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
39
41
|
}
|
|
40
42
|
onDeleteConfig(config) {
|
|
41
43
|
this.onDeleteAsync(config, (c) => c.id, (id) => this.configService.deleteAsync({ id, type: 'delete' }), {
|
|
42
|
-
header: '
|
|
43
|
-
successMessage: '
|
|
44
|
-
errorMessage: '
|
|
44
|
+
header: this.translateService.translate('storage.config.delete.title'),
|
|
45
|
+
successMessage: this.translateService.translate('storage.config.delete.success'),
|
|
46
|
+
errorMessage: this.translateService.translate('storage.config.delete.failed'),
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: StorageConfigListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -49,12 +51,12 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
49
51
|
<div class="card">
|
|
50
52
|
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3 mb-4">
|
|
51
53
|
<div>
|
|
52
|
-
<h3 class="text-lg sm:text-xl font-semibold">
|
|
54
|
+
<h3 class="text-lg sm:text-xl font-semibold">{{ 'storage.config.title' | translate }}</h3>
|
|
53
55
|
@if (showCompanyInfo()) {
|
|
54
|
-
<p class="text-sm text-muted-color mt-1">
|
|
56
|
+
<p class="text-sm text-muted-color mt-1">{{ 'storage.company' | translate }}: {{ currentCompanyName() }}</p>
|
|
55
57
|
}
|
|
56
58
|
</div>
|
|
57
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.CREATE" label="
|
|
59
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.CREATE" [label]="'storage.button.new.configuration' | translate" icon="pi pi-plus" (onClick)="onCreate()" styleClass="w-full sm:w-auto" />
|
|
58
60
|
</div>
|
|
59
61
|
|
|
60
62
|
<div class="overflow-x-auto">
|
|
@@ -72,10 +74,10 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
72
74
|
>
|
|
73
75
|
<ng-template #header>
|
|
74
76
|
<tr>
|
|
75
|
-
<th>
|
|
76
|
-
<th>
|
|
77
|
-
<th class="hidden sm:table-cell">
|
|
78
|
-
<th class="w-[120px]">
|
|
77
|
+
<th>{{ 'storage.table.name' | translate }}</th>
|
|
78
|
+
<th>{{ 'storage.table.provider' | translate }}</th>
|
|
79
|
+
<th class="hidden sm:table-cell">{{ 'storage.table.created' | translate }}</th>
|
|
80
|
+
<th class="w-[120px]">{{ 'storage.table.actions' | translate }}</th>
|
|
79
81
|
</tr>
|
|
80
82
|
</ng-template>
|
|
81
83
|
<ng-template #body let-config>
|
|
@@ -87,13 +89,13 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
87
89
|
</div>
|
|
88
90
|
</td>
|
|
89
91
|
<td>
|
|
90
|
-
<p-tag [value]="
|
|
92
|
+
<p-tag [value]="getProviderLabelKey(config.storage) | translate" [severity]="getProviderSeverity(config.storage)" />
|
|
91
93
|
</td>
|
|
92
94
|
<td class="hidden sm:table-cell">{{ config.createdAt | date: 'short' }}</td>
|
|
93
95
|
<td>
|
|
94
96
|
<div class="flex gap-1">
|
|
95
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.UPDATE" icon="pi pi-pencil" [text]="true" severity="secondary" size="small" (onClick)="onEdit(config.id)" pTooltip="
|
|
96
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.DELETE" icon="pi pi-trash" [text]="true" severity="danger" size="small" (onClick)="onDeleteConfig(config)" pTooltip="
|
|
97
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.UPDATE" icon="pi pi-pencil" [text]="true" severity="secondary" size="small" (onClick)="onEdit(config.id)" [pTooltip]="'storage.tooltip.edit' | translate" tooltipPosition="top" />
|
|
98
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.DELETE" icon="pi pi-trash" [text]="true" severity="danger" size="small" (onClick)="onDeleteConfig(config)" [pTooltip]="'storage.tooltip.delete' | translate" tooltipPosition="top" />
|
|
97
99
|
</div>
|
|
98
100
|
</td>
|
|
99
101
|
</tr>
|
|
@@ -101,31 +103,30 @@ class StorageConfigListComponent extends BaseStorageListPage {
|
|
|
101
103
|
<ng-template #emptymessage>
|
|
102
104
|
<tr>
|
|
103
105
|
<td colspan="4" class="text-center py-4 text-muted-color">
|
|
104
|
-
{{ showCompanyInfo() ? '
|
|
106
|
+
{{ (showCompanyInfo() ? 'storage.empty.configs.in.company' : 'storage.empty.configs') | translate }}
|
|
105
107
|
</td>
|
|
106
108
|
</tr>
|
|
107
109
|
</ng-template>
|
|
108
110
|
</p-table>
|
|
109
111
|
</div>
|
|
110
112
|
</div>
|
|
111
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i3.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "directive", type: i4.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: i5.DatePipe, name: "date" }
|
|
113
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i3.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "directive", type: i4.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
112
114
|
}
|
|
113
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: StorageConfigListComponent, decorators: [{
|
|
114
116
|
type: Component,
|
|
115
117
|
args: [{
|
|
116
118
|
selector: 'lib-storage-config-list',
|
|
117
|
-
|
|
118
|
-
imports: [AngularModule, PrimeModule, HasPermissionDirective],
|
|
119
|
+
imports: [AngularModule, PrimeModule, HasPermissionDirective, TranslatePipe],
|
|
119
120
|
template: `
|
|
120
121
|
<div class="card">
|
|
121
122
|
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3 mb-4">
|
|
122
123
|
<div>
|
|
123
|
-
<h3 class="text-lg sm:text-xl font-semibold">
|
|
124
|
+
<h3 class="text-lg sm:text-xl font-semibold">{{ 'storage.config.title' | translate }}</h3>
|
|
124
125
|
@if (showCompanyInfo()) {
|
|
125
|
-
<p class="text-sm text-muted-color mt-1">
|
|
126
|
+
<p class="text-sm text-muted-color mt-1">{{ 'storage.company' | translate }}: {{ currentCompanyName() }}</p>
|
|
126
127
|
}
|
|
127
128
|
</div>
|
|
128
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.CREATE" label="
|
|
129
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.CREATE" [label]="'storage.button.new.configuration' | translate" icon="pi pi-plus" (onClick)="onCreate()" styleClass="w-full sm:w-auto" />
|
|
129
130
|
</div>
|
|
130
131
|
|
|
131
132
|
<div class="overflow-x-auto">
|
|
@@ -143,10 +144,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
143
144
|
>
|
|
144
145
|
<ng-template #header>
|
|
145
146
|
<tr>
|
|
146
|
-
<th>
|
|
147
|
-
<th>
|
|
148
|
-
<th class="hidden sm:table-cell">
|
|
149
|
-
<th class="w-[120px]">
|
|
147
|
+
<th>{{ 'storage.table.name' | translate }}</th>
|
|
148
|
+
<th>{{ 'storage.table.provider' | translate }}</th>
|
|
149
|
+
<th class="hidden sm:table-cell">{{ 'storage.table.created' | translate }}</th>
|
|
150
|
+
<th class="w-[120px]">{{ 'storage.table.actions' | translate }}</th>
|
|
150
151
|
</tr>
|
|
151
152
|
</ng-template>
|
|
152
153
|
<ng-template #body let-config>
|
|
@@ -158,13 +159,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
158
159
|
</div>
|
|
159
160
|
</td>
|
|
160
161
|
<td>
|
|
161
|
-
<p-tag [value]="
|
|
162
|
+
<p-tag [value]="getProviderLabelKey(config.storage) | translate" [severity]="getProviderSeverity(config.storage)" />
|
|
162
163
|
</td>
|
|
163
164
|
<td class="hidden sm:table-cell">{{ config.createdAt | date: 'short' }}</td>
|
|
164
165
|
<td>
|
|
165
166
|
<div class="flex gap-1">
|
|
166
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.UPDATE" icon="pi pi-pencil" [text]="true" severity="secondary" size="small" (onClick)="onEdit(config.id)" pTooltip="
|
|
167
|
-
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.DELETE" icon="pi pi-trash" [text]="true" severity="danger" size="small" (onClick)="onDeleteConfig(config)" pTooltip="
|
|
167
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.UPDATE" icon="pi pi-pencil" [text]="true" severity="secondary" size="small" (onClick)="onEdit(config.id)" [pTooltip]="'storage.tooltip.edit' | translate" tooltipPosition="top" />
|
|
168
|
+
<p-button *hasPermission="STORAGE_CONFIG_PERMISSIONS.DELETE" icon="pi pi-trash" [text]="true" severity="danger" size="small" (onClick)="onDeleteConfig(config)" [pTooltip]="'storage.tooltip.delete' | translate" tooltipPosition="top" />
|
|
168
169
|
</div>
|
|
169
170
|
</td>
|
|
170
171
|
</tr>
|
|
@@ -172,7 +173,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
172
173
|
<ng-template #emptymessage>
|
|
173
174
|
<tr>
|
|
174
175
|
<td colspan="4" class="text-center py-4 text-muted-color">
|
|
175
|
-
{{ showCompanyInfo() ? '
|
|
176
|
+
{{ (showCompanyInfo() ? 'storage.empty.configs.in.company' : 'storage.empty.configs') | translate }}
|
|
176
177
|
</td>
|
|
177
178
|
</tr>
|
|
178
179
|
</ng-template>
|
|
@@ -184,4 +185,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
184
185
|
}] });
|
|
185
186
|
|
|
186
187
|
export { StorageConfigListComponent };
|
|
187
|
-
//# sourceMappingURL=flusys-ng-storage-storage-config-list.component-
|
|
188
|
+
//# sourceMappingURL=flusys-ng-storage-storage-config-list.component-DBH_qf9o.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-storage-storage-config-list.component-DBH_qf9o.mjs","sources":["../../../projects/ng-storage/pages/storage-config/storage-config-list.component.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { TranslateService } from '@flusys/ng-localization';\nimport { AngularModule, HasPermissionDirective, PrimeModule, STORAGE_CONFIG_PERMISSIONS, TranslatePipe } from '@flusys/ng-shared';\nimport { firstValueFrom } from 'rxjs';\nimport { IStorageConfig } from '../../interfaces/storage-config.interface';\nimport { StorageConfigApiService } from '../../services/storage-config-api.service';\nimport { BaseStorageListPage } from '../../utils/base-storage-page';\nimport { getProviderIcon, getProviderLabelKey, getProviderSeverity } from '../../utils/storage-utils';\n\n@Component({\n selector: 'lib-storage-config-list',\n imports: [AngularModule, PrimeModule, HasPermissionDirective, TranslatePipe],\n template: `\n <div class=\"card\">\n <div class=\"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3 mb-4\">\n <div>\n <h3 class=\"text-lg sm:text-xl font-semibold\">{{ 'storage.config.title' | translate }}</h3>\n @if (showCompanyInfo()) {\n <p class=\"text-sm text-muted-color mt-1\">{{ 'storage.company' | translate }}: {{ currentCompanyName() }}</p>\n }\n </div>\n <p-button *hasPermission=\"STORAGE_CONFIG_PERMISSIONS.CREATE\" [label]=\"'storage.button.new.configuration' | translate\" icon=\"pi pi-plus\" (onClick)=\"onCreate()\" styleClass=\"w-full sm:w-auto\" />\n </div>\n\n <div class=\"overflow-x-auto\">\n <p-table\n [value]=\"items()\"\n [loading]=\"isLoading()\"\n [paginator]=\"totalRecords() > 0\"\n [rows]=\"pageSize()\"\n [totalRecords]=\"totalRecords()\"\n [lazy]=\"true\"\n (onLazyLoad)=\"onPageChange($event)\"\n [rowsPerPageOptions]=\"[10, 25, 50]\"\n [scrollable]=\"true\"\n styleClass=\"p-datatable-sm\"\n >\n <ng-template #header>\n <tr>\n <th>{{ 'storage.table.name' | translate }}</th>\n <th>{{ 'storage.table.provider' | translate }}</th>\n <th class=\"hidden sm:table-cell\">{{ 'storage.table.created' | translate }}</th>\n <th class=\"w-[120px]\">{{ 'storage.table.actions' | translate }}</th>\n </tr>\n </ng-template>\n <ng-template #body let-config>\n <tr>\n <td>\n <div class=\"flex items-center gap-2\">\n <i [class]=\"getProviderIcon(config.storage)\"></i>\n <span class=\"truncate max-w-32 sm:max-w-none\">{{ config.name }}</span>\n </div>\n </td>\n <td>\n <p-tag [value]=\"getProviderLabelKey(config.storage) | translate\" [severity]=\"getProviderSeverity(config.storage)\" />\n </td>\n <td class=\"hidden sm:table-cell\">{{ config.createdAt | date: 'short' }}</td>\n <td>\n <div class=\"flex gap-1\">\n <p-button *hasPermission=\"STORAGE_CONFIG_PERMISSIONS.UPDATE\" icon=\"pi pi-pencil\" [text]=\"true\" severity=\"secondary\" size=\"small\" (onClick)=\"onEdit(config.id)\" [pTooltip]=\"'storage.tooltip.edit' | translate\" tooltipPosition=\"top\" />\n <p-button *hasPermission=\"STORAGE_CONFIG_PERMISSIONS.DELETE\" icon=\"pi pi-trash\" [text]=\"true\" severity=\"danger\" size=\"small\" (onClick)=\"onDeleteConfig(config)\" [pTooltip]=\"'storage.tooltip.delete' | translate\" tooltipPosition=\"top\" />\n </div>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td colspan=\"4\" class=\"text-center py-4 text-muted-color\">\n {{ (showCompanyInfo() ? 'storage.empty.configs.in.company' : 'storage.empty.configs') | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n `,\n})\nexport class StorageConfigListComponent extends BaseStorageListPage<IStorageConfig> {\n readonly STORAGE_CONFIG_PERMISSIONS = STORAGE_CONFIG_PERMISSIONS;\n\n private readonly configService = inject(StorageConfigApiService);\n private readonly translateService = inject(TranslateService);\n\n readonly getProviderIcon = getProviderIcon;\n readonly getProviderLabelKey = getProviderLabelKey;\n readonly getProviderSeverity = getProviderSeverity;\n\n getResourceRoute(): string {\n return '/storage/configs';\n }\n\n override getDeleteConfirmMessage(config: IStorageConfig): string {\n return this.translateService.translate('storage.delete.confirm.named', { name: config.name });\n }\n\n async loadData(): Promise<void> {\n this.isLoading.set(true);\n try {\n const response = await firstValueFrom(\n this.configService.getAll('', { pagination: this.getPaginationParams() }),\n );\n if (response.success) {\n this.items.set(response.data ?? []);\n this.total.set(response.meta?.total ?? 0);\n }\n } catch {\n this.showError(this.translateService.translate('storage.config.load.failed'));\n } finally {\n this.isLoading.set(false);\n }\n }\n\n onDeleteConfig(config: IStorageConfig): void {\n this.onDeleteAsync(\n config,\n (c) => c.id,\n (id) => this.configService.deleteAsync({ id, type: 'delete' }),\n {\n header: this.translateService.translate('storage.config.delete.title'),\n successMessage: this.translateService.translate('storage.config.delete.success'),\n errorMessage: this.translateService.translate('storage.config.delete.failed'),\n },\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AA6EM,MAAO,0BAA2B,SAAQ,mBAAmC,CAAA;IACxE,0BAA0B,GAAG,0BAA0B;AAE/C,IAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAEnD,eAAe,GAAG,eAAe;IACjC,mBAAmB,GAAG,mBAAmB;IACzC,mBAAmB,GAAG,mBAAmB;IAElD,gBAAgB,GAAA;AACd,QAAA,OAAO,kBAAkB;IAC3B;AAES,IAAA,uBAAuB,CAAC,MAAsB,EAAA;AACrD,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC/F;AAEA,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;AACxB,QAAA,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,cAAc,CACnC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE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