@valtimo/logging 12.4.2 → 12.5.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/esm2022/lib/components/log-details/log-details.component.mjs +47 -0
- package/esm2022/lib/components/log-search/log-search.component.mjs +190 -0
- package/esm2022/lib/components/logging-list/logging-list.component.mjs +169 -5
- package/esm2022/lib/models/index.mjs +18 -0
- package/esm2022/lib/models/logging.model.mjs +33 -0
- package/esm2022/lib/models/search.model.mjs +2 -0
- package/esm2022/lib/services/index.mjs +17 -0
- package/esm2022/lib/services/logging-api.service.mjs +46 -0
- package/fesm2022/valtimo-logging.mjs +490 -11
- package/fesm2022/valtimo-logging.mjs.map +1 -1
- package/lib/components/log-details/log-details.component.d.ts +12 -0
- package/lib/components/log-details/log-details.component.d.ts.map +1 -0
- package/lib/components/log-search/log-search.component.d.ts +46 -0
- package/lib/components/log-search/log-search.component.d.ts.map +1 -0
- package/lib/components/logging-list/logging-list.component.d.ts +36 -1
- package/lib/components/logging-list/logging-list.component.d.ts.map +1 -1
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/logging.model.d.ts +37 -0
- package/lib/models/logging.model.d.ts.map +1 -0
- package/lib/models/search.model.d.ts +18 -0
- package/lib/models/search.model.d.ts.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/logging-api.service.d.ts +14 -0
- package/lib/services/logging-api.service.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -1,14 +1,343 @@
|
|
|
1
|
+
import * as i4 from '@angular/common';
|
|
1
2
|
import { CommonModule } from '@angular/common';
|
|
2
|
-
import
|
|
3
|
+
import * as i2 from '@angular/common/http';
|
|
4
|
+
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
3
5
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
5
|
-
import * as
|
|
6
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
7
|
+
import * as i5 from '@ngx-translate/core';
|
|
6
8
|
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
+
import * as i1 from '@valtimo/config';
|
|
10
|
+
import { BaseApiService, ROLE_ADMIN, HttpLoaderFactory } from '@valtimo/config';
|
|
11
|
+
import { TrashCan16, Filter16 } from '@carbon/icons';
|
|
12
|
+
import * as i1$1 from '@valtimo/components';
|
|
13
|
+
import { CurrentCarbonTheme, CARBON_THEME, DEFAULT_PAGINATION, ViewType, CARBON_CONSTANTS, CarbonListModule } from '@valtimo/components';
|
|
14
|
+
import * as i3 from 'carbon-components-angular';
|
|
15
|
+
import { ModalModule, ButtonModule, DropdownModule, IconModule, InputModule, DatePickerModule, DialogModule } from 'carbon-components-angular';
|
|
16
|
+
import { map, Subscription, debounceTime, BehaviorSubject, tap, switchMap, startWith, combineLatest, take } from 'rxjs';
|
|
17
|
+
import * as i4$1 from 'ngx-json-viewer';
|
|
18
|
+
import { NgxJsonViewerModule } from 'ngx-json-viewer';
|
|
19
|
+
import * as i2$1 from '@angular/forms';
|
|
20
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
21
|
+
import flatpickr from 'flatpickr';
|
|
22
|
+
import * as i1$2 from '@angular/router';
|
|
9
23
|
import { RouterModule } from '@angular/router';
|
|
10
24
|
import { AuthGuardService } from '@valtimo/security';
|
|
11
25
|
|
|
26
|
+
/*
|
|
27
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
28
|
+
*
|
|
29
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
30
|
+
* you may not use this file except in compliance with the License.
|
|
31
|
+
* You may obtain a copy of the License at
|
|
32
|
+
*
|
|
33
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
34
|
+
*
|
|
35
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
37
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
* See the License for the specific language governing permissions and
|
|
39
|
+
* limitations under the License.
|
|
40
|
+
*/
|
|
41
|
+
var LogLevel;
|
|
42
|
+
(function (LogLevel) {
|
|
43
|
+
LogLevel["DEBUG"] = "DEBUG";
|
|
44
|
+
LogLevel["ERROR"] = "ERROR";
|
|
45
|
+
LogLevel["INFO"] = "INFO";
|
|
46
|
+
LogLevel["TRACE"] = "TRACE";
|
|
47
|
+
LogLevel["WARN"] = "WARN";
|
|
48
|
+
})(LogLevel || (LogLevel = {}));
|
|
49
|
+
const LOG_LEVEL_TAG = {
|
|
50
|
+
[LogLevel.DEBUG]: 'teal',
|
|
51
|
+
[LogLevel.ERROR]: 'red',
|
|
52
|
+
[LogLevel.INFO]: 'blue',
|
|
53
|
+
[LogLevel.TRACE]: 'grey',
|
|
54
|
+
[LogLevel.WARN]: 'purple',
|
|
55
|
+
};
|
|
56
|
+
const LOG_ELLIPSIS_LIMIT = 128;
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
60
|
+
*
|
|
61
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
62
|
+
* you may not use this file except in compliance with the License.
|
|
63
|
+
* You may obtain a copy of the License at
|
|
64
|
+
*
|
|
65
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
66
|
+
*
|
|
67
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
68
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
69
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
70
|
+
* See the License for the specific language governing permissions and
|
|
71
|
+
* limitations under the License.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
76
|
+
*
|
|
77
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
78
|
+
* you may not use this file except in compliance with the License.
|
|
79
|
+
* You may obtain a copy of the License at
|
|
80
|
+
*
|
|
81
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
82
|
+
*
|
|
83
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
84
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
85
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
86
|
+
* See the License for the specific language governing permissions and
|
|
87
|
+
* limitations under the License.
|
|
88
|
+
*/
|
|
89
|
+
class LoggingApiService extends BaseApiService {
|
|
90
|
+
constructor(configService, httpClient) {
|
|
91
|
+
super(httpClient, configService);
|
|
92
|
+
this.configService = configService;
|
|
93
|
+
this.httpClient = httpClient;
|
|
94
|
+
}
|
|
95
|
+
getTechnicalLogs(searchRequest) {
|
|
96
|
+
const { size, page, ...searchBody } = searchRequest;
|
|
97
|
+
const params = new HttpParams({
|
|
98
|
+
fromObject: { size, page },
|
|
99
|
+
});
|
|
100
|
+
return this.httpClient.post(this.getApiUrl('management/v1/logging'), searchBody, {
|
|
101
|
+
params,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingApiService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
105
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingApiService, providedIn: 'root' }); }
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingApiService, decorators: [{
|
|
108
|
+
type: Injectable,
|
|
109
|
+
args: [{
|
|
110
|
+
providedIn: 'root',
|
|
111
|
+
}]
|
|
112
|
+
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: i2.HttpClient }] });
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
116
|
+
*
|
|
117
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
118
|
+
* you may not use this file except in compliance with the License.
|
|
119
|
+
* You may obtain a copy of the License at
|
|
120
|
+
*
|
|
121
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
122
|
+
*
|
|
123
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
124
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
125
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
126
|
+
* See the License for the specific language governing permissions and
|
|
127
|
+
* limitations under the License.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
132
|
+
*
|
|
133
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
134
|
+
* you may not use this file except in compliance with the License.
|
|
135
|
+
* You may obtain a copy of the License at
|
|
136
|
+
*
|
|
137
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
138
|
+
*
|
|
139
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
140
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
141
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
142
|
+
* See the License for the specific language governing permissions and
|
|
143
|
+
* limitations under the License.
|
|
144
|
+
*/
|
|
145
|
+
class LogDetailsComponent {
|
|
146
|
+
constructor() {
|
|
147
|
+
this.open = false;
|
|
148
|
+
this.closeModalEvent = new EventEmitter();
|
|
149
|
+
}
|
|
150
|
+
onCloseSelect() {
|
|
151
|
+
this.closeModalEvent.emit();
|
|
152
|
+
}
|
|
153
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LogDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
154
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LogDetailsComponent, isStandalone: true, selector: "valtimo-log-details", inputs: { open: "open", logEvent: "logEvent" }, outputs: { closeModalEvent: "closeModalEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal [open]=\"open\" size=\"lg\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseSelect()\">\n {{ 'logging.detailsTitle' | translate }}\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-log-details__content\">\n <ngx-json-viewer *ngIf=\"logEvent\" [json]=\"logEvent\"></ngx-json-viewer>\n </section>\n</cds-modal>\n", styles: [".valtimo-log-details__content{padding:32px}.valtimo-log-details__content ::ng-deep .ngx-json-viewer{overflow:auto!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "ngmodule", type: NgxJsonViewerModule }, { kind: "component", type: i4$1.NgxJsonViewerComponent, selector: "ngx-json-viewer", inputs: ["json", "expanded", "depth", "_currentDepth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
155
|
+
}
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LogDetailsComponent, decorators: [{
|
|
157
|
+
type: Component,
|
|
158
|
+
args: [{ selector: 'valtimo-log-details', standalone: true, imports: [CommonModule, TranslateModule, ModalModule, NgxJsonViewerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal [open]=\"open\" size=\"lg\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseSelect()\">\n {{ 'logging.detailsTitle' | translate }}\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-log-details__content\">\n <ngx-json-viewer *ngIf=\"logEvent\" [json]=\"logEvent\"></ngx-json-viewer>\n </section>\n</cds-modal>\n", styles: [".valtimo-log-details__content{padding:32px}.valtimo-log-details__content ::ng-deep .ngx-json-viewer{overflow:auto!important}\n"] }]
|
|
159
|
+
}], propDecorators: { open: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], logEvent: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}], closeModalEvent: [{
|
|
164
|
+
type: Output
|
|
165
|
+
}] } });
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
169
|
+
*
|
|
170
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
171
|
+
* you may not use this file except in compliance with the License.
|
|
172
|
+
* You may obtain a copy of the License at
|
|
173
|
+
*
|
|
174
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
175
|
+
*
|
|
176
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
177
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
178
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
+
* See the License for the specific language governing permissions and
|
|
180
|
+
* limitations under the License.
|
|
181
|
+
*/
|
|
182
|
+
class LogSearchComponent {
|
|
183
|
+
get propertiesArray() {
|
|
184
|
+
return this.formGroup.get('properties');
|
|
185
|
+
}
|
|
186
|
+
constructor(cdsThemeService, fb, iconService) {
|
|
187
|
+
this.cdsThemeService = cdsThemeService;
|
|
188
|
+
this.fb = fb;
|
|
189
|
+
this.iconService = iconService;
|
|
190
|
+
this.searchSubmitEvent = new EventEmitter();
|
|
191
|
+
this.theme$ = this.cdsThemeService.currentTheme$.pipe(map((theme) => theme === CurrentCarbonTheme.G10 ? CARBON_THEME.WHITE : CARBON_THEME.G100));
|
|
192
|
+
this.formGroup = this.fb.group({
|
|
193
|
+
likeFormattedMessage: this.fb.control(''),
|
|
194
|
+
level: this.fb.control({ content: '', selected: false }),
|
|
195
|
+
beforeTimestamp: this.fb.control(''),
|
|
196
|
+
afterTimestamp: this.fb.control(''),
|
|
197
|
+
properties: this.fb.array([
|
|
198
|
+
this.fb.group({
|
|
199
|
+
key: this.fb.control(''),
|
|
200
|
+
value: this.fb.control(''),
|
|
201
|
+
}),
|
|
202
|
+
]),
|
|
203
|
+
});
|
|
204
|
+
this.logLevelItems = [
|
|
205
|
+
{
|
|
206
|
+
content: LogLevel.ERROR,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
content: LogLevel.WARN,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
content: LogLevel.INFO,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
content: LogLevel.DEBUG,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
content: LogLevel.TRACE,
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
this._subscriptions = new Subscription();
|
|
222
|
+
this.iconService.register(TrashCan16);
|
|
223
|
+
}
|
|
224
|
+
ngOnInit() {
|
|
225
|
+
this.setInitialForm();
|
|
226
|
+
this._subscriptions.add(this.formGroup.valueChanges.pipe(debounceTime(500)).subscribe(() => {
|
|
227
|
+
this.searchSubmitEvent.emit(this.mapFormValueToLogSearch());
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
ngAfterViewInit() {
|
|
231
|
+
const afterTimestampControlValue = this.formGroup.get('afterTimestamp')?.value;
|
|
232
|
+
const beforeTimestampControlValue = this.formGroup.get('beforeTimestamp')?.value;
|
|
233
|
+
if (!!afterTimestampControlValue) {
|
|
234
|
+
this._afterTimestampDatePicker.writeValue([
|
|
235
|
+
flatpickr.formatDate(new Date(afterTimestampControlValue), 'd-m-Y'),
|
|
236
|
+
]);
|
|
237
|
+
}
|
|
238
|
+
if (!!beforeTimestampControlValue) {
|
|
239
|
+
this._beforeTimestampDatePicker.writeValue([
|
|
240
|
+
flatpickr.formatDate(new Date(beforeTimestampControlValue), 'd-m-Y'),
|
|
241
|
+
]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
ngOnDestroy() {
|
|
245
|
+
this._subscriptions.unsubscribe();
|
|
246
|
+
}
|
|
247
|
+
onClearFilter() {
|
|
248
|
+
this.formGroup.reset();
|
|
249
|
+
this._afterTimestampDatePicker.writeValue([]);
|
|
250
|
+
this._beforeTimestampDatePicker.writeValue([]);
|
|
251
|
+
}
|
|
252
|
+
onDateSelected(control, event) {
|
|
253
|
+
this.formGroup.get(control)?.patchValue(flatpickr.formatDate(event[0], 'Z'));
|
|
254
|
+
}
|
|
255
|
+
addPropertySearchField() {
|
|
256
|
+
this.propertiesArray.push(this.fb.group({
|
|
257
|
+
key: this.fb.control(''),
|
|
258
|
+
value: this.fb.control(''),
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
removePropertySearchField(index) {
|
|
262
|
+
this.propertiesArray.removeAt(index);
|
|
263
|
+
}
|
|
264
|
+
initLogItems(formValue) {
|
|
265
|
+
if (!formValue.level)
|
|
266
|
+
return;
|
|
267
|
+
this.logLevelItems = this.logLevelItems.map((levelItem) => ({
|
|
268
|
+
...levelItem,
|
|
269
|
+
selected: formValue.level?.content === levelItem.content,
|
|
270
|
+
}));
|
|
271
|
+
}
|
|
272
|
+
initPropertiesForm(formValue) {
|
|
273
|
+
if (!formValue.properties)
|
|
274
|
+
return;
|
|
275
|
+
for (let i = 1; i < formValue.properties.length; i++) {
|
|
276
|
+
this.addPropertySearchField();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
mapFormValueToLogSearch() {
|
|
280
|
+
const formValue = this.formGroup.getRawValue();
|
|
281
|
+
const properties = formValue.properties.filter((property) => !!property.key && !!property.value);
|
|
282
|
+
return {
|
|
283
|
+
...(!!formValue.likeFormattedMessage && {
|
|
284
|
+
likeFormattedMessage: formValue.likeFormattedMessage,
|
|
285
|
+
}),
|
|
286
|
+
...(!!formValue.level?.content && { level: formValue.level.content }),
|
|
287
|
+
...(!!formValue.afterTimestamp && { afterTimestamp: formValue.afterTimestamp }),
|
|
288
|
+
...(!!formValue.beforeTimestamp && { beforeTimestamp: formValue.beforeTimestamp }),
|
|
289
|
+
...(!!properties.length && { properties }),
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
mapSearchRequestToFormValue(searchRequest) {
|
|
293
|
+
return {
|
|
294
|
+
...(searchRequest.likeFormattedMessage && {
|
|
295
|
+
likeFormattedMessage: searchRequest.likeFormattedMessage,
|
|
296
|
+
}),
|
|
297
|
+
...(searchRequest.level && {
|
|
298
|
+
level: {
|
|
299
|
+
content: searchRequest.level,
|
|
300
|
+
selected: true,
|
|
301
|
+
},
|
|
302
|
+
}),
|
|
303
|
+
...(searchRequest.afterTimestamp && { afterTimestamp: searchRequest.afterTimestamp }),
|
|
304
|
+
...(searchRequest.beforeTimestamp && { beforeTimestamp: searchRequest.beforeTimestamp }),
|
|
305
|
+
...(searchRequest.properties && { properties: searchRequest.properties }),
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
setInitialForm() {
|
|
309
|
+
const mappedFormValue = this.mapSearchRequestToFormValue(this.initSearchRequest);
|
|
310
|
+
this.initLogItems(mappedFormValue);
|
|
311
|
+
this.initPropertiesForm(mappedFormValue);
|
|
312
|
+
this.formGroup.patchValue(mappedFormValue, { emitEvent: false });
|
|
313
|
+
}
|
|
314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LogSearchComponent, deps: [{ token: i1$1.CdsThemeService }, { token: i2$1.FormBuilder }, { token: i3.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
315
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LogSearchComponent, isStandalone: true, selector: "valtimo-log-search", inputs: { initSearchRequest: "initSearchRequest" }, outputs: { searchSubmitEvent: "searchSubmitEvent" }, viewQueries: [{ propertyName: "_afterTimestampDatePicker", first: true, predicate: ["afterTimestamp"], descendants: true }, { propertyName: "_beforeTimestampDatePicker", first: true, predicate: ["beforeTimestamp"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<form\n *ngIf=\"theme$ | async as theme\"\n class=\"valtimo-log-search\"\n [formGroup]=\"formGroup\"\n (click)=\"$event.stopImmediatePropagation()\"\n>\n <section class=\"valtimo-log-search__fields\">\n <cds-text-label>\n {{ 'logging.columns.formattedMessage' | translate }}\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"likeFormattedMessage\"\n [placeholder]=\"'logging.columns.formattedMessage' | translate\"\n />\n </cds-text-label>\n\n <cds-dropdown\n formControlName=\"level\"\n [attr.data-carbon-theme]=\"theme\"\n [appendInline]=\"true\"\n [label]=\"'logging.columns.level' | translate\"\n [placeholder]=\"'logging.columns.level' | translate\"\n >\n <cds-dropdown-list [items]=\"logLevelItems\"></cds-dropdown-list>\n </cds-dropdown>\n\n <div class=\"valtimo-log-search__timestamp\">\n <cds-date-picker\n #afterTimestamp\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'logging.search.afterTimestamp' | translate\"\n placeholder=\"DD-MM-YYYY\"\n [dateFormat]=\"'d-m-Y'\"\n (valueChange)=\"onDateSelected('afterTimestamp', $event)\"\n ></cds-date-picker>\n\n <cds-date-picker\n #beforeTimestamp\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'logging.search.beforeTimestamp' | translate\"\n placeholder=\"DD-MM-YYYY\"\n [dateFormat]=\"'d-m-Y'\"\n (valueChange)=\"onDateSelected('beforeTimestamp', $event)\"\n ></cds-date-picker>\n </div>\n </section>\n\n <section formArrayName=\"properties\" class=\"valtimo-log-search__properties\">\n <span class=\"valtimo-log-search__label\"> {{ 'logging.search.properties' | translate }} </span>\n\n @for (propertyGroup of propertiesArray.controls; track $index) {\n <form [formGroup]=\"propertyGroup\" class=\"valtimo-log-search__property\">\n <cds-text-label>\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"key\"\n [placeholder]=\"'interface.key' | translate\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"value\"\n [placeholder]=\"'interface.value' | translate\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n iconOnly=\"true\"\n type=\"button\"\n (click)=\"removePropertySearchField($index)\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button cdsButton=\"primary\" size=\"sm\" type=\"button\" (click)=\"addPropertySearchField()\">\n {{ 'logging.search.addProperty' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </section>\n\n <button cdsButton=\"tertiary\" type=\"button\" (click)=\"onClearFilter()\">\n {{ 'interface.clear' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n</form>\n", styles: [".valtimo-log-search{flex-direction:column;padding:16px;max-width:880px}.valtimo-log-search,.valtimo-log-search__property,.valtimo-log-search__timestamp{display:flex;gap:16px}.valtimo-log-search__fields{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-log-search__properties{display:flex;flex-direction:column;max-width:50%}.valtimo-log-search__properties>*:not(:last-child):not(.valtimo-log-search__label){margin-bottom:16px}.valtimo-log-search__property{align-items:flex-end}.valtimo-log-search__label{font-size:var(--cds-label-01-font-size);color:var(--cds-text-secondary)}.valtimo-log-search ::ng-deep .cds--date-picker.cds--date-picker--single .cds--date-picker__input{inline-size:unset!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i3.DatePicker, selector: "cds-date-picker, ibm-date-picker", inputs: ["range", "dateFormat", "language", "label", "helperText", "rangeHelperText", "rangeLabel", "placeholder", "ariaLabel", "inputPattern", "id", "value", "theme", "disabled", "invalid", "invalidText", "warn", "warnText", "size", "rangeInvalid", "rangeInvalidText", "rangeWarn", "rangeWarnText", "skeleton", "plugins", "flatpickrOptions"], outputs: ["valueChange", "onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
316
|
+
}
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LogSearchComponent, decorators: [{
|
|
318
|
+
type: Component,
|
|
319
|
+
args: [{ selector: 'valtimo-log-search', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
320
|
+
CommonModule,
|
|
321
|
+
TranslateModule,
|
|
322
|
+
ButtonModule,
|
|
323
|
+
DropdownModule,
|
|
324
|
+
IconModule,
|
|
325
|
+
InputModule,
|
|
326
|
+
ReactiveFormsModule,
|
|
327
|
+
DatePickerModule,
|
|
328
|
+
], template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<form\n *ngIf=\"theme$ | async as theme\"\n class=\"valtimo-log-search\"\n [formGroup]=\"formGroup\"\n (click)=\"$event.stopImmediatePropagation()\"\n>\n <section class=\"valtimo-log-search__fields\">\n <cds-text-label>\n {{ 'logging.columns.formattedMessage' | translate }}\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"likeFormattedMessage\"\n [placeholder]=\"'logging.columns.formattedMessage' | translate\"\n />\n </cds-text-label>\n\n <cds-dropdown\n formControlName=\"level\"\n [attr.data-carbon-theme]=\"theme\"\n [appendInline]=\"true\"\n [label]=\"'logging.columns.level' | translate\"\n [placeholder]=\"'logging.columns.level' | translate\"\n >\n <cds-dropdown-list [items]=\"logLevelItems\"></cds-dropdown-list>\n </cds-dropdown>\n\n <div class=\"valtimo-log-search__timestamp\">\n <cds-date-picker\n #afterTimestamp\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'logging.search.afterTimestamp' | translate\"\n placeholder=\"DD-MM-YYYY\"\n [dateFormat]=\"'d-m-Y'\"\n (valueChange)=\"onDateSelected('afterTimestamp', $event)\"\n ></cds-date-picker>\n\n <cds-date-picker\n #beforeTimestamp\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'logging.search.beforeTimestamp' | translate\"\n placeholder=\"DD-MM-YYYY\"\n [dateFormat]=\"'d-m-Y'\"\n (valueChange)=\"onDateSelected('beforeTimestamp', $event)\"\n ></cds-date-picker>\n </div>\n </section>\n\n <section formArrayName=\"properties\" class=\"valtimo-log-search__properties\">\n <span class=\"valtimo-log-search__label\"> {{ 'logging.search.properties' | translate }} </span>\n\n @for (propertyGroup of propertiesArray.controls; track $index) {\n <form [formGroup]=\"propertyGroup\" class=\"valtimo-log-search__property\">\n <cds-text-label>\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"key\"\n [placeholder]=\"'interface.key' | translate\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n formControlName=\"value\"\n [placeholder]=\"'interface.value' | translate\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n iconOnly=\"true\"\n type=\"button\"\n (click)=\"removePropertySearchField($index)\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button cdsButton=\"primary\" size=\"sm\" type=\"button\" (click)=\"addPropertySearchField()\">\n {{ 'logging.search.addProperty' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </section>\n\n <button cdsButton=\"tertiary\" type=\"button\" (click)=\"onClearFilter()\">\n {{ 'interface.clear' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n</form>\n", styles: [".valtimo-log-search{flex-direction:column;padding:16px;max-width:880px}.valtimo-log-search,.valtimo-log-search__property,.valtimo-log-search__timestamp{display:flex;gap:16px}.valtimo-log-search__fields{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-log-search__properties{display:flex;flex-direction:column;max-width:50%}.valtimo-log-search__properties>*:not(:last-child):not(.valtimo-log-search__label){margin-bottom:16px}.valtimo-log-search__property{align-items:flex-end}.valtimo-log-search__label{font-size:var(--cds-label-01-font-size);color:var(--cds-text-secondary)}.valtimo-log-search ::ng-deep .cds--date-picker.cds--date-picker--single .cds--date-picker__input{inline-size:unset!important}\n"] }]
|
|
329
|
+
}], ctorParameters: () => [{ type: i1$1.CdsThemeService }, { type: i2$1.FormBuilder }, { type: i3.IconService }], propDecorators: { _afterTimestampDatePicker: [{
|
|
330
|
+
type: ViewChild,
|
|
331
|
+
args: ['afterTimestamp']
|
|
332
|
+
}], _beforeTimestampDatePicker: [{
|
|
333
|
+
type: ViewChild,
|
|
334
|
+
args: ['beforeTimestamp']
|
|
335
|
+
}], initSearchRequest: [{
|
|
336
|
+
type: Input
|
|
337
|
+
}], searchSubmitEvent: [{
|
|
338
|
+
type: Output
|
|
339
|
+
}] } });
|
|
340
|
+
|
|
12
341
|
/*
|
|
13
342
|
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
14
343
|
*
|
|
@@ -25,13 +354,163 @@ import { AuthGuardService } from '@valtimo/security';
|
|
|
25
354
|
* limitations under the License.
|
|
26
355
|
*/
|
|
27
356
|
class LoggingListComponent {
|
|
28
|
-
|
|
29
|
-
|
|
357
|
+
constructor(activatedRoute, iconService, loggingApiService, router) {
|
|
358
|
+
this.activatedRoute = activatedRoute;
|
|
359
|
+
this.iconService = iconService;
|
|
360
|
+
this.loggingApiService = loggingApiService;
|
|
361
|
+
this.router = router;
|
|
362
|
+
this.loading$ = new BehaviorSubject(true);
|
|
363
|
+
this.logItems$ = this.activatedRoute.queryParamMap.pipe(tap(() => this.loading$.next(true)), switchMap(queryParams => this.loggingApiService.getTechnicalLogs({
|
|
364
|
+
...queryParams['params'],
|
|
365
|
+
...(!!queryParams['params']?.properties && {
|
|
366
|
+
properties: this.base64ToObject(queryParams['params'].properties),
|
|
367
|
+
}),
|
|
368
|
+
})), map((loggingPage) => {
|
|
369
|
+
this.pagination$.next({
|
|
370
|
+
...this.pagination$.getValue(),
|
|
371
|
+
collectionSize: loggingPage.totalElements,
|
|
372
|
+
});
|
|
373
|
+
return loggingPage.content.map((logEvent) => ({
|
|
374
|
+
...logEvent,
|
|
375
|
+
tags: [
|
|
376
|
+
{
|
|
377
|
+
content: logEvent.level,
|
|
378
|
+
type: LOG_LEVEL_TAG[logEvent.level],
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
}));
|
|
382
|
+
}), startWith([]), tap(() => {
|
|
383
|
+
this.loading$.next(false);
|
|
384
|
+
}));
|
|
385
|
+
this.searchRequest$ = new BehaviorSubject({});
|
|
386
|
+
this.pagination$ = new BehaviorSubject(DEFAULT_PAGINATION);
|
|
387
|
+
this.logDetailsOpen$ = new BehaviorSubject(false);
|
|
388
|
+
this.selectedLogEvent$ = new BehaviorSubject(null);
|
|
389
|
+
this.FIELDS = [
|
|
390
|
+
{
|
|
391
|
+
key: 'timestamp',
|
|
392
|
+
label: 'logging.columns.timestamp',
|
|
393
|
+
viewType: ViewType.DATE_TIME,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
key: 'level',
|
|
397
|
+
label: 'logging.columns.level',
|
|
398
|
+
viewType: ViewType.TAGS,
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
key: 'formattedMessage',
|
|
402
|
+
label: 'logging.columns.formattedMessage',
|
|
403
|
+
viewType: ViewType.TEXT,
|
|
404
|
+
tooltipCharLimit: LOG_ELLIPSIS_LIMIT,
|
|
405
|
+
},
|
|
406
|
+
];
|
|
407
|
+
this._subscriptions = new Subscription();
|
|
408
|
+
this.iconService.registerAll([Filter16, TrashCan16]);
|
|
409
|
+
}
|
|
410
|
+
ngOnInit() {
|
|
411
|
+
this.setInitialParams();
|
|
412
|
+
}
|
|
413
|
+
ngOnDestroy() {
|
|
414
|
+
this._subscriptions.unsubscribe();
|
|
415
|
+
}
|
|
416
|
+
onCloseModalEvent() {
|
|
417
|
+
this.logDetailsOpen$.next(false);
|
|
418
|
+
setTimeout(() => {
|
|
419
|
+
this.selectedLogEvent$.next(null);
|
|
420
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
421
|
+
}
|
|
422
|
+
onPaginationClicked(page, logItems) {
|
|
423
|
+
const activePagination = this.pagination$.getValue();
|
|
424
|
+
const searchRequest = this.searchRequest$.getValue();
|
|
425
|
+
if (!searchRequest.beforeTimestamp && activePagination.page === 1)
|
|
426
|
+
this.searchRequest$.next({ ...searchRequest, beforeTimestamp: logItems[0].timestamp });
|
|
427
|
+
this.pagination$.next({ ...activePagination, page });
|
|
428
|
+
}
|
|
429
|
+
onPaginationSet(size) {
|
|
430
|
+
const { collectionSize, page } = this.pagination$.getValue();
|
|
431
|
+
const resetPage = Math.ceil(+collectionSize / size) <= +page && +collectionSize > 0;
|
|
432
|
+
this.pagination$.next({ ...this.pagination$.getValue(), size, ...(resetPage && { page: 1 }) });
|
|
433
|
+
}
|
|
434
|
+
onRowClickedEvent(rowClickEvent) {
|
|
435
|
+
const { ctrlClick: _, ...logEvent } = rowClickEvent;
|
|
436
|
+
this.logDetailsOpen$.next(true);
|
|
437
|
+
this.selectedLogEvent$.next(logEvent);
|
|
438
|
+
}
|
|
439
|
+
onSearchSubmitEvent(searchRequest) {
|
|
440
|
+
this.searchRequest$.next(searchRequest);
|
|
441
|
+
}
|
|
442
|
+
onClearFilter() {
|
|
443
|
+
this.onSearchSubmitEvent({});
|
|
444
|
+
}
|
|
445
|
+
base64ToObject(base64string) {
|
|
446
|
+
return JSON.parse(atob(base64string));
|
|
447
|
+
}
|
|
448
|
+
objectToBase64(jsObject) {
|
|
449
|
+
return btoa(JSON.stringify(jsObject));
|
|
450
|
+
}
|
|
451
|
+
openQueryParamsSubscription() {
|
|
452
|
+
this._subscriptions.add(combineLatest([this.pagination$, this.searchRequest$]).subscribe(([pagination, searchRequest]) => {
|
|
453
|
+
const { size, page } = pagination;
|
|
454
|
+
this.router.navigate(['/logging'], {
|
|
455
|
+
queryParams: {
|
|
456
|
+
size,
|
|
457
|
+
page: page - 1,
|
|
458
|
+
...{
|
|
459
|
+
...searchRequest,
|
|
460
|
+
...(!!searchRequest.properties?.length && {
|
|
461
|
+
properties: this.objectToBase64(searchRequest.properties),
|
|
462
|
+
}),
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
});
|
|
466
|
+
}));
|
|
467
|
+
}
|
|
468
|
+
mapQueryParamsToSearchRequest(queryParams) {
|
|
469
|
+
return {
|
|
470
|
+
...(!!queryParams.likeFormattedMessage && {
|
|
471
|
+
likeFormattedMessage: queryParams.likeFormattedMessage,
|
|
472
|
+
}),
|
|
473
|
+
...(!!queryParams.level && { level: queryParams.level }),
|
|
474
|
+
...(!!queryParams.afterTimestamp && { afterTimestamp: queryParams.afterTimestamp }),
|
|
475
|
+
...(!!queryParams.beforeTimestamp && { beforeTimestamp: queryParams.beforeTimestamp }),
|
|
476
|
+
...(!!queryParams.properties && {
|
|
477
|
+
properties: this.base64ToObject(queryParams.properties),
|
|
478
|
+
}),
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
setInitialParams() {
|
|
482
|
+
this.activatedRoute.queryParamMap
|
|
483
|
+
.pipe(take(1), map(queryParams => {
|
|
484
|
+
const { size, page, ...searchRequest } = queryParams['params'];
|
|
485
|
+
return { size, page, searchRequest };
|
|
486
|
+
}))
|
|
487
|
+
.subscribe(({ size, page, searchRequest }) => {
|
|
488
|
+
this.searchRequest$.next(this.mapQueryParamsToSearchRequest(searchRequest));
|
|
489
|
+
this.pagination$.next({
|
|
490
|
+
...this.pagination$.getValue(),
|
|
491
|
+
size: +size,
|
|
492
|
+
page: +(page ?? 0) + 1,
|
|
493
|
+
});
|
|
494
|
+
this.openQueryParamsSubscription();
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingListComponent, deps: [{ token: i1$2.ActivatedRoute }, { token: i3.IconService }, { token: LoggingApiService }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
498
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoggingListComponent, isStandalone: true, selector: "ng-component", providers: [LoggingApiService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n *ngIf=\"logItems$ | async as logItems\"\n [items]=\"logItems\"\n [fields]=\"FIELDS\"\n [loading]=\"loading$ | async\"\n [pagination]=\"pagination$ | async\"\n paginationIdentifier=\"logging\"\n (paginationClicked)=\"onPaginationClicked($event, logItems)\"\n (paginationSet)=\"onPaginationSet($event)\"\n (rowClicked)=\"onRowClickedEvent($event)\"\n>\n <valtimo-no-results\n [action]=\"clearSearchButton\"\n [description]=\"'logging.noResults.description' | translate\"\n [title]=\"'logging.noResults.title' | translate\"\n ></valtimo-no-results>\n\n <button\n carbonToolbarContent\n [cdsOverflowMenu]=\"logSearch\"\n [customPane]=\"true\"\n [iconOnly]=\"true\"\n [flip]=\"true\"\n [offset]=\"{x: 0, y: 47}\"\n cdsButton=\"ghost\"\n placement=\"bottom\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"filter\" size=\"16\"></svg>\n </button>\n</valtimo-carbon-list>\n\n<valtimo-log-details\n [open]=\"logDetailsOpen$ | async\"\n [logEvent]=\"selectedLogEvent$ | async\"\n (closeModalEvent)=\"onCloseModalEvent()\"\n></valtimo-log-details>\n\n<ng-template #logSearch>\n <valtimo-log-search\n [initSearchRequest]=\"searchRequest$ | async\"\n (searchSubmitEvent)=\"onSearchSubmitEvent($event)\"\n ></valtimo-log-search>\n</ng-template>\n\n<ng-template #clearSearchButton>\n <button cdsButton=\"primary\" (click)=\"onClearFilter()\">\n {{ 'interface.clear' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n</ng-template>\n", styles: ["::ng-deep .cds--overflow-menu-options.cds--overflow-menu-options--open{max-width:max-content!important;width:max-content!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: DialogModule }, { kind: "directive", type: i3.OverflowMenuDirective, selector: "[cdsOverflowMenu], [ibmOverflowMenu]", inputs: ["ibmOverflowMenu", "cdsOverflowMenu", "flip", "offset", "wrapperClass", "customPane"], exportAs: ["overflowMenu"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: LogDetailsComponent, selector: "valtimo-log-details", inputs: ["open", "logEvent"], outputs: ["closeModalEvent"] }, { kind: "component", type: LogSearchComponent, selector: "valtimo-log-search", inputs: ["initSearchRequest"], outputs: ["searchSubmitEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
30
499
|
}
|
|
31
500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingListComponent, decorators: [{
|
|
32
501
|
type: Component,
|
|
33
|
-
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
34
|
-
|
|
502
|
+
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
503
|
+
CommonModule,
|
|
504
|
+
TranslateModule,
|
|
505
|
+
ButtonModule,
|
|
506
|
+
CarbonListModule,
|
|
507
|
+
DialogModule,
|
|
508
|
+
DropdownModule,
|
|
509
|
+
IconModule,
|
|
510
|
+
LogDetailsComponent,
|
|
511
|
+
LogSearchComponent,
|
|
512
|
+
], providers: [LoggingApiService], template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n *ngIf=\"logItems$ | async as logItems\"\n [items]=\"logItems\"\n [fields]=\"FIELDS\"\n [loading]=\"loading$ | async\"\n [pagination]=\"pagination$ | async\"\n paginationIdentifier=\"logging\"\n (paginationClicked)=\"onPaginationClicked($event, logItems)\"\n (paginationSet)=\"onPaginationSet($event)\"\n (rowClicked)=\"onRowClickedEvent($event)\"\n>\n <valtimo-no-results\n [action]=\"clearSearchButton\"\n [description]=\"'logging.noResults.description' | translate\"\n [title]=\"'logging.noResults.title' | translate\"\n ></valtimo-no-results>\n\n <button\n carbonToolbarContent\n [cdsOverflowMenu]=\"logSearch\"\n [customPane]=\"true\"\n [iconOnly]=\"true\"\n [flip]=\"true\"\n [offset]=\"{x: 0, y: 47}\"\n cdsButton=\"ghost\"\n placement=\"bottom\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"filter\" size=\"16\"></svg>\n </button>\n</valtimo-carbon-list>\n\n<valtimo-log-details\n [open]=\"logDetailsOpen$ | async\"\n [logEvent]=\"selectedLogEvent$ | async\"\n (closeModalEvent)=\"onCloseModalEvent()\"\n></valtimo-log-details>\n\n<ng-template #logSearch>\n <valtimo-log-search\n [initSearchRequest]=\"searchRequest$ | async\"\n (searchSubmitEvent)=\"onSearchSubmitEvent($event)\"\n ></valtimo-log-search>\n</ng-template>\n\n<ng-template #clearSearchButton>\n <button cdsButton=\"primary\" (click)=\"onClearFilter()\">\n {{ 'interface.clear' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n</ng-template>\n", styles: ["::ng-deep .cds--overflow-menu-options.cds--overflow-menu-options--open{max-width:max-content!important;width:max-content!important}\n"] }]
|
|
513
|
+
}], ctorParameters: () => [{ type: i1$2.ActivatedRoute }, { type: i3.IconService }, { type: LoggingApiService }, { type: i1$2.Router }] });
|
|
35
514
|
|
|
36
515
|
/*
|
|
37
516
|
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
@@ -58,7 +537,7 @@ const routes = [
|
|
|
58
537
|
];
|
|
59
538
|
class LoggingRoutingModule {
|
|
60
539
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
61
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: LoggingRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] }); }
|
|
540
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: LoggingRoutingModule, imports: [i1$2.RouterModule], exports: [RouterModule] }); }
|
|
62
541
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingRoutingModule, imports: [RouterModule.forRoot(routes), RouterModule] }); }
|
|
63
542
|
}
|
|
64
543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingRoutingModule, decorators: [{
|
|
@@ -87,7 +566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
87
566
|
class LoggingModule {
|
|
88
567
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
89
568
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: LoggingModule, imports: [CommonModule,
|
|
90
|
-
LoggingRoutingModule,
|
|
569
|
+
LoggingRoutingModule, i5.TranslateModule, LoggingListComponent] }); }
|
|
91
570
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoggingModule, imports: [CommonModule,
|
|
92
571
|
LoggingRoutingModule,
|
|
93
572
|
TranslateModule.forRoot({
|