@firestitch/system 12.5.6 → 13.0.2

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.
Files changed (81) hide show
  1. package/esm2020/app/modules/query-logs/components/explain/explain.component.mjs +24 -0
  2. package/esm2020/app/modules/query-logs/components/query-log/query-log.component.mjs +58 -0
  3. package/esm2020/app/modules/query-logs/components/query-logs/query-logs.component.mjs +84 -0
  4. package/{esm2015/app/modules/query-logs/query-logs.module.js → esm2020/app/modules/query-logs/query-logs.module.mjs} +5 -5
  5. package/esm2020/app/modules/system/components/api-log/api-log.component.mjs +34 -0
  6. package/esm2020/app/modules/system/components/api-logs/api-logs.component.mjs +69 -0
  7. package/esm2020/app/modules/system/components/cron/cron.component.mjs +104 -0
  8. package/esm2020/app/modules/system/components/cron-log/cron-log.component.mjs +37 -0
  9. package/esm2020/app/modules/system/components/crons/crons.component.mjs +231 -0
  10. package/esm2020/app/modules/system/components/dashboard/dashboard.component.mjs +84 -0
  11. package/esm2020/app/modules/system/components/info/info.component.mjs +31 -0
  12. package/esm2020/app/modules/system/components/process/process.component.mjs +62 -0
  13. package/esm2020/app/modules/system/components/processes/processes.component.mjs +174 -0
  14. package/esm2020/app/modules/system/components/server-log/server-log.component.mjs +38 -0
  15. package/esm2020/app/modules/system/components/server-logs/server-logs.component.mjs +53 -0
  16. package/esm2020/app/modules/system/components/settings/settings.component.mjs +138 -0
  17. package/esm2020/app/modules/system/components/upgrade-logs/upgrade-logs.component.mjs +44 -0
  18. package/{esm2015/app/modules/system/fs-system.module.js → esm2020/app/modules/system/fs-system.module.mjs} +5 -5
  19. package/{esm2015/app/modules/system/pipes/key-name-value.pipe.js → esm2020/app/modules/system/pipes/key-name-value.pipe.mjs} +5 -5
  20. package/fesm2015/firestitch-system.mjs +1447 -0
  21. package/fesm2015/firestitch-system.mjs.map +1 -0
  22. package/fesm2020/firestitch-system.mjs +1449 -0
  23. package/fesm2020/firestitch-system.mjs.map +1 -0
  24. package/package.json +20 -7
  25. package/styles.scss +3 -0
  26. package/bundles/firestitch-system.umd.js +0 -1904
  27. package/bundles/firestitch-system.umd.js.map +0 -1
  28. package/esm2015/app/modules/query-logs/components/explain/explain.component.js +0 -27
  29. package/esm2015/app/modules/query-logs/components/query-log/query-log.component.js +0 -63
  30. package/esm2015/app/modules/query-logs/components/query-logs/query-logs.component.js +0 -89
  31. package/esm2015/app/modules/system/components/api-log/api-log.component.js +0 -37
  32. package/esm2015/app/modules/system/components/api-logs/api-logs.component.js +0 -73
  33. package/esm2015/app/modules/system/components/cron/cron.component.js +0 -102
  34. package/esm2015/app/modules/system/components/cron-log/cron-log.component.js +0 -40
  35. package/esm2015/app/modules/system/components/crons/crons.component.js +0 -229
  36. package/esm2015/app/modules/system/components/dashboard/dashboard.component.js +0 -89
  37. package/esm2015/app/modules/system/components/info/info.component.js +0 -36
  38. package/esm2015/app/modules/system/components/process/process.component.js +0 -66
  39. package/esm2015/app/modules/system/components/processes/processes.component.js +0 -179
  40. package/esm2015/app/modules/system/components/server-log/server-log.component.js +0 -41
  41. package/esm2015/app/modules/system/components/server-logs/server-logs.component.js +0 -57
  42. package/esm2015/app/modules/system/components/settings/settings.component.js +0 -137
  43. package/esm2015/app/modules/system/components/upgrade-logs/upgrade-logs.component.js +0 -48
  44. package/fesm2015/firestitch-system.js +0 -1498
  45. package/fesm2015/firestitch-system.js.map +0 -1
  46. /package/{esm2015/app/modules/query-logs/components/explain/index.js → esm2020/app/modules/query-logs/components/explain/index.mjs} +0 -0
  47. /package/{esm2015/app/modules/query-logs/components/index.js → esm2020/app/modules/query-logs/components/index.mjs} +0 -0
  48. /package/{esm2015/app/modules/query-logs/components/query-log/index.js → esm2020/app/modules/query-logs/components/query-log/index.mjs} +0 -0
  49. /package/{esm2015/app/modules/query-logs/components/query-logs/index.js → esm2020/app/modules/query-logs/components/query-logs/index.mjs} +0 -0
  50. /package/{esm2015/app/modules/system/components/api-log/index.js → esm2020/app/modules/system/components/api-log/index.mjs} +0 -0
  51. /package/{esm2015/app/modules/system/components/api-logs/index.js → esm2020/app/modules/system/components/api-logs/index.mjs} +0 -0
  52. /package/{esm2015/app/modules/system/components/cron/index.js → esm2020/app/modules/system/components/cron/index.mjs} +0 -0
  53. /package/{esm2015/app/modules/system/components/cron-log/index.js → esm2020/app/modules/system/components/cron-log/index.mjs} +0 -0
  54. /package/{esm2015/app/modules/system/components/crons/index.js → esm2020/app/modules/system/components/crons/index.mjs} +0 -0
  55. /package/{esm2015/app/modules/system/components/dashboard/index.js → esm2020/app/modules/system/components/dashboard/index.mjs} +0 -0
  56. /package/{esm2015/app/modules/system/components/info/index.js → esm2020/app/modules/system/components/info/index.mjs} +0 -0
  57. /package/{esm2015/app/modules/system/components/process/index.js → esm2020/app/modules/system/components/process/index.mjs} +0 -0
  58. /package/{esm2015/app/modules/system/components/processes/index.js → esm2020/app/modules/system/components/processes/index.mjs} +0 -0
  59. /package/{esm2015/app/modules/system/components/server-log/index.js → esm2020/app/modules/system/components/server-log/index.mjs} +0 -0
  60. /package/{esm2015/app/modules/system/components/server-logs/index.js → esm2020/app/modules/system/components/server-logs/index.mjs} +0 -0
  61. /package/{esm2015/app/modules/system/components/settings/index.js → esm2020/app/modules/system/components/settings/index.mjs} +0 -0
  62. /package/{esm2015/app/modules/system/components/upgrade-logs/index.js → esm2020/app/modules/system/components/upgrade-logs/index.mjs} +0 -0
  63. /package/{esm2015/app/modules/system/consts/api-log-states.const.js → esm2020/app/modules/system/consts/api-log-states.const.mjs} +0 -0
  64. /package/{esm2015/app/modules/system/consts/cron-log-states.const.js → esm2020/app/modules/system/consts/cron-log-states.const.mjs} +0 -0
  65. /package/{esm2015/app/modules/system/consts/cron-states.const.js → esm2020/app/modules/system/consts/cron-states.const.mjs} +0 -0
  66. /package/{esm2015/app/modules/system/consts/index.js → esm2020/app/modules/system/consts/index.mjs} +0 -0
  67. /package/{esm2015/app/modules/system/consts/process-states.const.js → esm2020/app/modules/system/consts/process-states.const.mjs} +0 -0
  68. /package/{esm2015/app/modules/system/enums/api-log-state.enum.js → esm2020/app/modules/system/enums/api-log-state.enum.mjs} +0 -0
  69. /package/{esm2015/app/modules/system/enums/cron-log-state.enum.js → esm2020/app/modules/system/enums/cron-log-state.enum.mjs} +0 -0
  70. /package/{esm2015/app/modules/system/enums/cron-state.enum.js → esm2020/app/modules/system/enums/cron-state.enum.mjs} +0 -0
  71. /package/{esm2015/app/modules/system/enums/index.js → esm2020/app/modules/system/enums/index.mjs} +0 -0
  72. /package/{esm2015/app/modules/system/enums/process-state.enum.js → esm2020/app/modules/system/enums/process-state.enum.mjs} +0 -0
  73. /package/{esm2015/app/modules/system/enums/setting-interface-type.enum.js → esm2020/app/modules/system/enums/setting-interface-type.enum.mjs} +0 -0
  74. /package/{esm2015/app/modules/system/helpers/index-name-value.js → esm2020/app/modules/system/helpers/index-name-value.mjs} +0 -0
  75. /package/{esm2015/app/modules/system/injectors/system-config.injector.js → esm2020/app/modules/system/injectors/system-config.injector.mjs} +0 -0
  76. /package/{esm2015/app/modules/system/interfaces/dashboard-action.js → esm2020/app/modules/system/interfaces/dashboard-action.mjs} +0 -0
  77. /package/{esm2015/app/modules/system/interfaces/index.js → esm2020/app/modules/system/interfaces/index.mjs} +0 -0
  78. /package/{esm2015/app/modules/system/interfaces/process-action.js → esm2020/app/modules/system/interfaces/process-action.mjs} +0 -0
  79. /package/{esm2015/app/modules/system/interfaces/system-config.js → esm2020/app/modules/system/interfaces/system-config.mjs} +0 -0
  80. /package/{esm2015/firestitch-system.js → esm2020/firestitch-system.mjs} +0 -0
  81. /package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
@@ -0,0 +1,1449 @@
1
+ import * as i8 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Inject, ViewChild, Input, NgModule, Pipe, Injectable, EventEmitter, Output, InjectionToken } from '@angular/core';
5
+ import * as i16 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i4 from '@angular/material/button';
9
+ import { MatButtonModule } from '@angular/material/button';
10
+ import * as i1 from '@angular/material/dialog';
11
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
12
+ import * as i3$1 from '@angular/material/tabs';
13
+ import { MatTabsModule } from '@angular/material/tabs';
14
+ import * as i2$1 from '@firestitch/clipboard';
15
+ import { FsClipboardModule } from '@firestitch/clipboard';
16
+ import * as i10 from '@firestitch/common';
17
+ import { FsCommonModule } from '@firestitch/common';
18
+ import * as i4$2 from '@firestitch/date';
19
+ import { FsDateModule, parse } from '@firestitch/date';
20
+ import * as i2 from '@firestitch/dialog';
21
+ import { FsDialogModule } from '@firestitch/dialog';
22
+ import * as i4$1 from '@firestitch/form';
23
+ import { FsFormModule } from '@firestitch/form';
24
+ import * as i3 from '@firestitch/label';
25
+ import { FsLabelModule } from '@firestitch/label';
26
+ import * as i2$2 from '@firestitch/list';
27
+ import { FsListComponent, FsListModule } from '@firestitch/list';
28
+ import * as i7 from '@firestitch/popover';
29
+ import { FsPopoverModule } from '@firestitch/popover';
30
+ import { ItemType } from '@firestitch/filter';
31
+ import { map, tap, switchMap, takeUntil } from 'rxjs/operators';
32
+ import * as i4$3 from '@angular/material/expansion';
33
+ import { MatExpansionModule } from '@angular/material/expansion';
34
+ import * as i7$1 from '@angular/material/form-field';
35
+ import { MatFormFieldModule } from '@angular/material/form-field';
36
+ import * as i3$2 from '@angular/material/icon';
37
+ import { MatIconModule } from '@angular/material/icon';
38
+ import * as i15 from '@angular/material/input';
39
+ import { MatInputModule } from '@angular/material/input';
40
+ import * as i8$1 from '@angular/material/select';
41
+ import { MatSelectModule } from '@angular/material/select';
42
+ import * as i9 from '@angular/material/tooltip';
43
+ import { MatTooltipModule } from '@angular/material/tooltip';
44
+ import * as i11 from '@firestitch/colorpicker';
45
+ import { FsColorPickerModule } from '@firestitch/colorpicker';
46
+ import * as i10$1 from '@firestitch/datepicker';
47
+ import { FsDatePickerModule } from '@firestitch/datepicker';
48
+ import * as i12 from '@firestitch/file';
49
+ import { FsFileModule } from '@firestitch/file';
50
+ import { FsFileManagerModule } from '@firestitch/file-manager';
51
+ import * as i6 from '@firestitch/menu';
52
+ import { FsMenuModule } from '@firestitch/menu';
53
+ import * as i5 from '@firestitch/skeleton';
54
+ import { FsSkeletonModule } from '@firestitch/skeleton';
55
+ import * as i1$1 from '@firestitch/message';
56
+ import * as i3$3 from '@firestitch/prompt';
57
+ import { SelectionActionType } from '@firestitch/selection';
58
+ import { Subject } from 'rxjs';
59
+ import { differenceInSeconds, differenceInMinutes } from 'date-fns';
60
+ import * as i2$3 from '@firestitch/build';
61
+ import * as i9$1 from '@angular/material/core';
62
+
63
+ class ExplainComponent {
64
+ constructor(_data) {
65
+ this._data = _data;
66
+ this.explain = _data.explain;
67
+ }
68
+ }
69
+ ExplainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExplainComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
70
+ ExplainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ExplainComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>Explain</h1>\n <mat-dialog-content>\n <div class=\"explain-popover\">{{explain | json}}</div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".explain-popover{white-space:pre}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i4$1.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "json": i8.JsonPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExplainComponent, decorators: [{
72
+ type: Component,
73
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog>\n <h1 mat-dialog-title>Explain</h1>\n <mat-dialog-content>\n <div class=\"explain-popover\">{{explain | json}}</div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".explain-popover{white-space:pre}\n"] }]
74
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
75
+ type: Inject,
76
+ args: [MAT_DIALOG_DATA]
77
+ }] }]; } });
78
+
79
+ class QueryLogComponent {
80
+ constructor(_data, _dialog) {
81
+ this._data = _data;
82
+ this._dialog = _dialog;
83
+ this.accessTypes = {
84
+ NULL: 'This access method means MySQL can resolve the query during the optimization phase and will not even access the table or index during the execution stage.',
85
+ system: 'The table is empty or has one row.',
86
+ const: 'The value of the column can be treated as a constant (there is one row matching the query). Note: Primary Key Lookup, Unique Index Lookup',
87
+ eq_ref: 'The index is clustered and is being used by the operation (either the index is a PRIMARY KEY or UNIQUE INDEX with all key columns defined as NOT NULL)',
88
+ ref: 'The indexed column was accessed using an equality operator Note: The ref_or_null access type is a variation on ref. It means MySQL must do a second lookup to find NULL entries after doing the initial lookup.',
89
+ fulltext: 'Operation (JOIN) is using the table’s fulltext index',
90
+ index: 'The entire index is scanned to find a match for the query. Note: The main advantage is that this avoids sorting. The biggest disadvantage is the cost of reading an entire table in index order. This usually means accessing the rows in random order, which is very expensive.',
91
+ index_merge: 'This join type indicates that the Index Merge optimization is used. In this case, the key column in the output row contains a list of indexes used. It indicates a query can make limited use of multiple indexes on a single table.',
92
+ range: 'This type replaces eq_ref for some IN subqueries of the following form: value IN (SELECT primary_key FROM single_table WHERE some_expr)',
93
+ unique_subquery: '',
94
+ ALL: 'MySQL scans the entire table to satisfy the query',
95
+ };
96
+ this.queryLog = _data.queryLog;
97
+ }
98
+ openExplain() {
99
+ this._dialog.open(ExplainComponent, {
100
+ data: { explain: this.explain },
101
+ });
102
+ }
103
+ get explain() {
104
+ return this.queryLog.explain;
105
+ }
106
+ get queryBlock() {
107
+ return this.explain?.queryBlock;
108
+ }
109
+ get orderingOperation() {
110
+ return this.queryBlock?.orderingOperation;
111
+ }
112
+ }
113
+ QueryLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
114
+ QueryLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: QueryLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>Query Log</h1>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large\">\n <fs-label-field>\n <fs-label>Duration</fs-label>\n {{queryLog.duration}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Optimized</fs-label>\n {{queryLog.optimized ? 'Yes' : 'No'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Query Cost</fs-label>\n {{queryLog.queryCost}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Raw Explain</fs-label>\n <a (click)=\"openExplain()\">View</a>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>URL</fs-label>\n {{queryLog.path | fsFormatTruncate: 50}}\n </fs-label-field>\n </div>\n\n <mat-tab-group>\n <mat-tab label=\"Query\">\n <fs-clipboard-button\n [content]=\"queryLog.prettyQuery\">\n </fs-clipboard-button>\n <div [innerHTML]=\"queryLog.prettyQuery\" class=\"query\"></div>\n </mat-tab>\n \n <mat-tab label=\"Explain\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock, selectId: queryBlock.selectId, costInfo: queryBlock.costInfo }\"></ng-container>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n\n<ng-template #nestedLoop let-queryBlock=\"queryBlock\" let-selectId=\"selectId\" let-costInfo=\"costInfo\">\n <ng-container *ngIf=\"selectId\">\n <h1>Select {{selectId}}</h1>\n </ng-container>\n \n <div class=\"fs-row.gap-large\">\n <ng-container *ngIf=\"costInfo?.queryCost\">\n <fs-label-field>\n <fs-label>Query Cost</fs-label>\n {{costInfo.queryCost}}\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"queryBlock.orderingOperation\">\n <fs-label-field>\n <fs-label>Ordering Operation</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.orderingOperation }\"></ng-container>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.groupingOperation\">\n <fs-label-field>\n <fs-label>Grouping Operation</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.groupingOperation }\"></ng-container>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.duplicatesRemoval\">\n <fs-label-field>\n <fs-label>Duplicates Removal</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.duplicatesRemoval }\"></ng-container>\n </fs-label-field>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"queryBlock.orderingOperation\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.orderingOperation }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.groupingOperation\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.groupingOperation }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.duplicatesRemoval\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.duplicatesRemoval }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.table\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: { nestedLoop: [ queryBlock ]} }\"></ng-container>\n \n <ng-container *ngIf=\"queryBlock.table.attachedSubqueries\"> \n <fs-label>Attached Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.table.attachedSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container> \n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock, selectId: subquery.queryBlock.selectId, costInfo: subquery.queryBlock.costInfo }\"></ng-container>\n </ng-container>\n </ng-container> \n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.nestedLoop\">\n <table class=\"fs-list-table style-line\">\n <thead>\n <tr>\n <th>Table</th>\n <th>Type</th>\n <th>Keys</th>\n <th>Ref</th>\n <th>Rows</th>\n <th>Filtered</th>\n <th>Extra</th>\n <th>Cost</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of queryBlock.nestedLoop; let index = index\">\n <tr>\n <td>\n {{item.table.tableName}}\n </td>\n <td>\n <fs-popover [template]=\"accessTypePopover\" [data]=\"item.table.accessType\">\n <span class=\"access-type\" [ngClass]=\"item.table.accessType\">{{item.table.accessType}}</span>\n </fs-popover> \n </td>\n <td>\n <fs-popover \n [template]=\"keysPopover\"\n [maxWidth]=\"null\"\n [data]=\"{ possibleKeys: item.table.possibleKeys, key: item.table.key }\">\n {{item.table.key}}\n </fs-popover>\n </td>\n <td>\n <div class=\"fs-delimit\">\n <ng-container *ngFor=\"let ref of item.table.ref\">\n <span>{{ref}}</span>\n </ng-container>\n </div>\n </td>\n <td>\n {{item.table.rowsExaminedPerScan}}\n </td>\n <td>\n {{item.table.filtered}}\n </td>\n <td>\n <div class=\"fs-delimit\">\n <ng-container *ngIf=\"item.table.indexCondition\">\n <span>\n <fs-popover \n [template]=\"usingIndexCondition\" \n [maxWidth]=\"null\"\n [data]=\"item.table.indexCondition\">\n Using Index Condition\n </fs-popover>\n </span>\n </ng-container>\n <ng-container *ngIf=\"item.table.attachedCondition\">\n <span>\n <fs-popover \n [template]=\"usingWhere\" \n [maxWidth]=\"null\"\n [data]=\"item.table.attachedCondition\">\n Using Where\n </fs-popover>\n </span>\n </ng-container>\n <ng-container *ngIf=\"item.usingIndex\">\n <span>Using Index</span>\n </ng-container> \n <ng-container *ngIf=\"item.usingFilesort\">\n <span class=\"critical\">Using File Sort</span>\n </ng-container>\n \n <ng-container *ngIf=\"item.usingTemporaryTable\">\n <span class=\"critical\">Temporary Table</span>\n </ng-container>\n </div>\n </td>\n <td> \n <fs-popover [template]=\"tableCostPopover\" [data]=\"item.table?.costInfo\">\n {{item.table?.costInfo.prefixCost}}\n </fs-popover>\n <ng-template #tableCostPopover let-data=\"data\">\n <div>Eval Cost: {{data.evalCost}}</div>\n <div>Read Cost: {{data.readCost}}</div>\n <div>Prefix Cost: {{data.prefixCost}}</div>\n <div>Data Read Per Join: {{data.dataReadPerJoin}}</div>\n </ng-template>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <br>\n </ng-container> \n \n <ng-container *ngIf=\"queryBlock.selectListSubqueries\">\n <br>\n <fs-label>Select List Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.selectListSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container> \n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock, selectId: subquery.queryBlock.selectId, costInfo: subquery.queryBlock.costInfo }\"></ng-container>\n </ng-container>\n </ng-container>\n<!-- \n <ng-container *ngIf=\"queryBlock.queryBlockattachedSubqueries\">\n <br>\n <fs-label>Attached Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.attachedSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container>\n </ng-container>\n </ng-container> -->\n</ng-template>\n\n<ng-template #keysPopover let-data=\"data\">\n <div class=\"fs-delimit\">\n <ng-container *ngFor=\"let possibleKey of data.possibleKeys\">\n <span [ngClass]=\"{ 'query-log-used-key': possibleKey === data.key }\">{{possibleKey}}</span>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #usingWhere let-data=\"data\">\n {{data}}\n</ng-template>\n\n<ng-template #usingIndexCondition let-data=\"data\">\n {{data}}\n</ng-template>\n\n<ng-template #accessTypePopover let-data=\"data\">\n {{accessTypes[data]}}\n</ng-template>\n\n\n<ng-template #queryBlockCritical let-queryBlock=\"queryBlock\">\n <div class=\"fs-delimit\">\n <ng-container *ngIf=\"queryBlock.usingFilesort\">\n <span class=\"critical\">Using File Sort</span>\n </ng-container>\n \n <ng-container *ngIf=\"queryBlock.usingTemporaryTable\">\n <span class=\"critical\">Temporary Table</span>\n </ng-container>\n </div>\n</ng-template>", styles: ["::ng-deep .query-log-used-key{font-weight:700}::ng-deep .explain-popover{white-space:pre}.critical{color:red}fs-clipboard-button{float:right}.query{white-space:break-spaces}.access-type{color:green}.access-type.fulltext,.access-type.index,.access-type.range{color:orange}.access-type.ALL{color:red}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i2$1.FsClipboardButtonComponent, selector: "fs-clipboard-button", inputs: ["content", "tooltip"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i7.FsPopoverComponent, selector: "fs-popover" }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i4$1.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "fsFormatTruncate": i10.FsFormatTruncatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogComponent, decorators: [{
116
+ type: Component,
117
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog>\n <h1 mat-dialog-title>Query Log</h1>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large\">\n <fs-label-field>\n <fs-label>Duration</fs-label>\n {{queryLog.duration}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Optimized</fs-label>\n {{queryLog.optimized ? 'Yes' : 'No'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Query Cost</fs-label>\n {{queryLog.queryCost}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Raw Explain</fs-label>\n <a (click)=\"openExplain()\">View</a>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>URL</fs-label>\n {{queryLog.path | fsFormatTruncate: 50}}\n </fs-label-field>\n </div>\n\n <mat-tab-group>\n <mat-tab label=\"Query\">\n <fs-clipboard-button\n [content]=\"queryLog.prettyQuery\">\n </fs-clipboard-button>\n <div [innerHTML]=\"queryLog.prettyQuery\" class=\"query\"></div>\n </mat-tab>\n \n <mat-tab label=\"Explain\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock, selectId: queryBlock.selectId, costInfo: queryBlock.costInfo }\"></ng-container>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n\n<ng-template #nestedLoop let-queryBlock=\"queryBlock\" let-selectId=\"selectId\" let-costInfo=\"costInfo\">\n <ng-container *ngIf=\"selectId\">\n <h1>Select {{selectId}}</h1>\n </ng-container>\n \n <div class=\"fs-row.gap-large\">\n <ng-container *ngIf=\"costInfo?.queryCost\">\n <fs-label-field>\n <fs-label>Query Cost</fs-label>\n {{costInfo.queryCost}}\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"queryBlock.orderingOperation\">\n <fs-label-field>\n <fs-label>Ordering Operation</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.orderingOperation }\"></ng-container>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.groupingOperation\">\n <fs-label-field>\n <fs-label>Grouping Operation</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.groupingOperation }\"></ng-container>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.duplicatesRemoval\">\n <fs-label-field>\n <fs-label>Duplicates Removal</fs-label>\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.duplicatesRemoval }\"></ng-container>\n </fs-label-field>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"queryBlock.orderingOperation\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.orderingOperation }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.groupingOperation\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.groupingOperation }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.duplicatesRemoval\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: queryBlock.duplicatesRemoval }\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.table\">\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: { nestedLoop: [ queryBlock ]} }\"></ng-container>\n \n <ng-container *ngIf=\"queryBlock.table.attachedSubqueries\"> \n <fs-label>Attached Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.table.attachedSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container> \n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock, selectId: subquery.queryBlock.selectId, costInfo: subquery.queryBlock.costInfo }\"></ng-container>\n </ng-container>\n </ng-container> \n </ng-container>\n\n <ng-container *ngIf=\"queryBlock.nestedLoop\">\n <table class=\"fs-list-table style-line\">\n <thead>\n <tr>\n <th>Table</th>\n <th>Type</th>\n <th>Keys</th>\n <th>Ref</th>\n <th>Rows</th>\n <th>Filtered</th>\n <th>Extra</th>\n <th>Cost</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of queryBlock.nestedLoop; let index = index\">\n <tr>\n <td>\n {{item.table.tableName}}\n </td>\n <td>\n <fs-popover [template]=\"accessTypePopover\" [data]=\"item.table.accessType\">\n <span class=\"access-type\" [ngClass]=\"item.table.accessType\">{{item.table.accessType}}</span>\n </fs-popover> \n </td>\n <td>\n <fs-popover \n [template]=\"keysPopover\"\n [maxWidth]=\"null\"\n [data]=\"{ possibleKeys: item.table.possibleKeys, key: item.table.key }\">\n {{item.table.key}}\n </fs-popover>\n </td>\n <td>\n <div class=\"fs-delimit\">\n <ng-container *ngFor=\"let ref of item.table.ref\">\n <span>{{ref}}</span>\n </ng-container>\n </div>\n </td>\n <td>\n {{item.table.rowsExaminedPerScan}}\n </td>\n <td>\n {{item.table.filtered}}\n </td>\n <td>\n <div class=\"fs-delimit\">\n <ng-container *ngIf=\"item.table.indexCondition\">\n <span>\n <fs-popover \n [template]=\"usingIndexCondition\" \n [maxWidth]=\"null\"\n [data]=\"item.table.indexCondition\">\n Using Index Condition\n </fs-popover>\n </span>\n </ng-container>\n <ng-container *ngIf=\"item.table.attachedCondition\">\n <span>\n <fs-popover \n [template]=\"usingWhere\" \n [maxWidth]=\"null\"\n [data]=\"item.table.attachedCondition\">\n Using Where\n </fs-popover>\n </span>\n </ng-container>\n <ng-container *ngIf=\"item.usingIndex\">\n <span>Using Index</span>\n </ng-container> \n <ng-container *ngIf=\"item.usingFilesort\">\n <span class=\"critical\">Using File Sort</span>\n </ng-container>\n \n <ng-container *ngIf=\"item.usingTemporaryTable\">\n <span class=\"critical\">Temporary Table</span>\n </ng-container>\n </div>\n </td>\n <td> \n <fs-popover [template]=\"tableCostPopover\" [data]=\"item.table?.costInfo\">\n {{item.table?.costInfo.prefixCost}}\n </fs-popover>\n <ng-template #tableCostPopover let-data=\"data\">\n <div>Eval Cost: {{data.evalCost}}</div>\n <div>Read Cost: {{data.readCost}}</div>\n <div>Prefix Cost: {{data.prefixCost}}</div>\n <div>Data Read Per Join: {{data.dataReadPerJoin}}</div>\n </ng-template>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <br>\n </ng-container> \n \n <ng-container *ngIf=\"queryBlock.selectListSubqueries\">\n <br>\n <fs-label>Select List Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.selectListSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container> \n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock, selectId: subquery.queryBlock.selectId, costInfo: subquery.queryBlock.costInfo }\"></ng-container>\n </ng-container>\n </ng-container>\n<!-- \n <ng-container *ngIf=\"queryBlock.queryBlockattachedSubqueries\">\n <br>\n <fs-label>Attached Subqueries</fs-label>\n <ng-container *ngFor=\"let subquery of queryBlock.attachedSubqueries\">\n <ng-container [ngTemplateOutlet]=\"queryBlockCritical\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"nestedLoop\" [ngTemplateOutletContext]=\"{ queryBlock: subquery.queryBlock }\"></ng-container>\n </ng-container>\n </ng-container> -->\n</ng-template>\n\n<ng-template #keysPopover let-data=\"data\">\n <div class=\"fs-delimit\">\n <ng-container *ngFor=\"let possibleKey of data.possibleKeys\">\n <span [ngClass]=\"{ 'query-log-used-key': possibleKey === data.key }\">{{possibleKey}}</span>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #usingWhere let-data=\"data\">\n {{data}}\n</ng-template>\n\n<ng-template #usingIndexCondition let-data=\"data\">\n {{data}}\n</ng-template>\n\n<ng-template #accessTypePopover let-data=\"data\">\n {{accessTypes[data]}}\n</ng-template>\n\n\n<ng-template #queryBlockCritical let-queryBlock=\"queryBlock\">\n <div class=\"fs-delimit\">\n <ng-container *ngIf=\"queryBlock.usingFilesort\">\n <span class=\"critical\">Using File Sort</span>\n </ng-container>\n \n <ng-container *ngIf=\"queryBlock.usingTemporaryTable\">\n <span class=\"critical\">Temporary Table</span>\n </ng-container>\n </div>\n</ng-template>", styles: ["::ng-deep .query-log-used-key{font-weight:700}::ng-deep .explain-popover{white-space:pre}.critical{color:red}fs-clipboard-button{float:right}.query{white-space:break-spaces}.access-type{color:green}.access-type.fulltext,.access-type.index,.access-type.range{color:orange}.access-type.ALL{color:red}\n"] }]
118
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
119
+ type: Inject,
120
+ args: [MAT_DIALOG_DATA]
121
+ }] }, { type: i1.MatDialog }]; } });
122
+
123
+ class QueryLogsComponent {
124
+ constructor(_dialog) {
125
+ this._dialog = _dialog;
126
+ }
127
+ openQueryLog(queryLog) {
128
+ this._dialog.open(QueryLogComponent, {
129
+ data: { queryLog },
130
+ width: '100%',
131
+ });
132
+ }
133
+ ngOnInit() {
134
+ this.listConfig = {
135
+ filters: [
136
+ {
137
+ name: 'keyword',
138
+ type: ItemType.Keyword,
139
+ label: 'Search',
140
+ },
141
+ {
142
+ name: 'optimized',
143
+ type: ItemType.Select,
144
+ label: 'Optimization',
145
+ values: [
146
+ { name: 'Any', value: undefined },
147
+ { name: 'Yes', value: 'true' },
148
+ { name: 'No', value: 'false' },
149
+ ],
150
+ },
151
+ {
152
+ name: 'createDate',
153
+ type: ItemType.DateTimeRange,
154
+ label: ['From Date', 'To Date'],
155
+ },
156
+ {
157
+ name: 'duration',
158
+ type: ItemType.Range,
159
+ label: ['Min Duration', 'Max Duration'],
160
+ },
161
+ ],
162
+ actions: [
163
+ {
164
+ label: 'Purge',
165
+ primary: false,
166
+ click: () => {
167
+ this.purgeQueryLogs()
168
+ .subscribe(() => {
169
+ this.list.reload();
170
+ });
171
+ },
172
+ },
173
+ ],
174
+ fetch: (query) => {
175
+ return this.loadQueryLogs(query)
176
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
177
+ },
178
+ };
179
+ }
180
+ }
181
+ QueryLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
182
+ QueryLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: QueryLogsComponent, selector: "fs-system-query-logs", inputs: { loadQueryLogs: "loadQueryLogs", purgeQueryLogs: "purgeQueryLogs" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Optimized\" name=\"optimized\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <span [ngClass]=\"{ optimized: row.optimized, 'not-optimized': !row.optimized }\">\n {{row.optimized ? 'Yes' : 'No'}}\n </span>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Duration\" name=\"duration\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.duration}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Cost\" name=\"query_cost\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.queryCost}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Query\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openQueryLog(row)\">{{ row.query | fsFormatTruncate: 500 }}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Created\" name=\"query_log_id\" [sortable]=\"true\" [direction]=\"'desc'\" [sortableDefault]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n</fs-list>", styles: [":host ::ng-deep .optimized{color:green}:host ::ng-deep .not-optimized{color:red}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "fsFormatTruncate": i10.FsFormatTruncatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogsComponent, decorators: [{
184
+ type: Component,
185
+ args: [{ selector: 'fs-system-query-logs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Optimized\" name=\"optimized\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <span [ngClass]=\"{ optimized: row.optimized, 'not-optimized': !row.optimized }\">\n {{row.optimized ? 'Yes' : 'No'}}\n </span>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Duration\" name=\"duration\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.duration}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Cost\" name=\"query_cost\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.queryCost}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Query\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openQueryLog(row)\">{{ row.query | fsFormatTruncate: 500 }}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Created\" name=\"query_log_id\" [sortable]=\"true\" [direction]=\"'desc'\" [sortableDefault]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n</fs-list>", styles: [":host ::ng-deep .optimized{color:green}:host ::ng-deep .not-optimized{color:red}\n"] }]
186
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
187
+ type: ViewChild,
188
+ args: [FsListComponent]
189
+ }], loadQueryLogs: [{
190
+ type: Input
191
+ }], purgeQueryLogs: [{
192
+ type: Input
193
+ }] } });
194
+
195
+ class FsSystemQueryLogsModule {
196
+ }
197
+ FsSystemQueryLogsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
198
+ FsSystemQueryLogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, declarations: [QueryLogsComponent,
199
+ QueryLogComponent,
200
+ ExplainComponent], imports: [CommonModule,
201
+ RouterModule,
202
+ CommonModule,
203
+ FormsModule,
204
+ MatTabsModule,
205
+ MatButtonModule,
206
+ MatDialogModule,
207
+ FsFormModule,
208
+ FsLabelModule,
209
+ FsPopoverModule,
210
+ FsCommonModule,
211
+ FsDateModule,
212
+ FsDialogModule,
213
+ FsListModule,
214
+ FsClipboardModule], exports: [QueryLogsComponent] });
215
+ FsSystemQueryLogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, imports: [[
216
+ CommonModule,
217
+ RouterModule,
218
+ CommonModule,
219
+ FormsModule,
220
+ MatTabsModule,
221
+ MatButtonModule,
222
+ MatDialogModule,
223
+ FsFormModule,
224
+ FsLabelModule,
225
+ FsPopoverModule,
226
+ FsCommonModule,
227
+ FsDateModule,
228
+ FsDialogModule,
229
+ FsListModule,
230
+ FsClipboardModule,
231
+ ]] });
232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, decorators: [{
233
+ type: NgModule,
234
+ args: [{
235
+ imports: [
236
+ CommonModule,
237
+ RouterModule,
238
+ CommonModule,
239
+ FormsModule,
240
+ MatTabsModule,
241
+ MatButtonModule,
242
+ MatDialogModule,
243
+ FsFormModule,
244
+ FsLabelModule,
245
+ FsPopoverModule,
246
+ FsCommonModule,
247
+ FsDateModule,
248
+ FsDialogModule,
249
+ FsListModule,
250
+ FsClipboardModule,
251
+ ],
252
+ declarations: [
253
+ QueryLogsComponent,
254
+ QueryLogComponent,
255
+ ExplainComponent,
256
+ ],
257
+ exports: [
258
+ QueryLogsComponent,
259
+ ],
260
+ }]
261
+ }] });
262
+
263
+ var CronState;
264
+ (function (CronState) {
265
+ CronState["Running"] = "running";
266
+ CronState["Idle"] = "idle";
267
+ CronState["Failed"] = "failed";
268
+ CronState["Queued"] = "queued";
269
+ CronState["Disabled"] = "disabled";
270
+ CronState["Enabled"] = "enabled";
271
+ CronState["Killing"] = "killing";
272
+ })(CronState || (CronState = {}));
273
+
274
+ var SettingInterfaceType;
275
+ (function (SettingInterfaceType) {
276
+ SettingInterfaceType["RadioButton"] = "R";
277
+ SettingInterfaceType["InputBox"] = "I";
278
+ SettingInterfaceType["Textarea"] = "T";
279
+ SettingInterfaceType["Select"] = "D";
280
+ SettingInterfaceType["SelectMultiple"] = "W";
281
+ SettingInterfaceType["Date"] = "A";
282
+ SettingInterfaceType["File"] = "F";
283
+ SettingInterfaceType["Static"] = "S";
284
+ SettingInterfaceType["Password"] = "P";
285
+ SettingInterfaceType["Time"] = "M";
286
+ SettingInterfaceType["None"] = "N";
287
+ SettingInterfaceType["Color"] = "C";
288
+ })(SettingInterfaceType || (SettingInterfaceType = {}));
289
+
290
+ var ApiLogState;
291
+ (function (ApiLogState) {
292
+ ApiLogState["Success"] = "success";
293
+ ApiLogState["Failed"] = "failed";
294
+ ApiLogState["Deleted"] = "deleted";
295
+ })(ApiLogState || (ApiLogState = {}));
296
+
297
+ var ProcessState;
298
+ (function (ProcessState) {
299
+ ProcessState["Queued"] = "Q";
300
+ ProcessState["Running"] = "R";
301
+ ProcessState["Completed"] = "C";
302
+ ProcessState["Killed"] = "K";
303
+ ProcessState["Deleted"] = "D";
304
+ ProcessState["Failed"] = "F";
305
+ })(ProcessState || (ProcessState = {}));
306
+
307
+ var CronLogState;
308
+ (function (CronLogState) {
309
+ CronLogState["Message"] = "message";
310
+ CronLogState["Disabled"] = "disabled";
311
+ CronLogState["Enabled"] = "enabled";
312
+ CronLogState["Started"] = "started";
313
+ CronLogState["Running"] = "running";
314
+ CronLogState["Completed"] = "completed";
315
+ CronLogState["Failed"] = "failed";
316
+ CronLogState["Killed"] = "killed";
317
+ CronLogState["Queued"] = "queued";
318
+ CronLogState["Reset"] = "reset";
319
+ CronLogState["Stagnant"] = "stagnant";
320
+ CronLogState["LongRunning"] = "long_running";
321
+ })(CronLogState || (CronLogState = {}));
322
+
323
+ const CronStates = [
324
+ { name: 'Running', value: CronState.Running },
325
+ { name: 'Idle', value: CronState.Idle },
326
+ { name: 'Failed', value: CronState.Failed },
327
+ { name: 'Queued', value: CronState.Queued },
328
+ { name: 'Disabled', value: CronState.Disabled },
329
+ { name: 'Killing', value: CronState.Killing },
330
+ { name: 'Enabled', value: CronState.Enabled },
331
+ ];
332
+
333
+ const ApiLogStates = [
334
+ { name: 'Success', value: ApiLogState.Success },
335
+ { name: 'Failed', value: ApiLogState.Failed },
336
+ { name: 'Deleted', value: ApiLogState.Deleted }
337
+ ];
338
+
339
+ const ProcessStates = [
340
+ { name: 'Queued', value: ProcessState.Queued },
341
+ { name: 'Running', value: ProcessState.Running },
342
+ { name: 'Completed', value: ProcessState.Completed },
343
+ { name: 'Killed', value: ProcessState.Killed },
344
+ { name: 'Failed', value: ProcessState.Failed },
345
+ { name: 'Deleted', value: ProcessState.Deleted }
346
+ ];
347
+
348
+ function indexNameValue(arry) {
349
+ const obj = {};
350
+ arry.forEach(item => {
351
+ obj[item.value] = item.name;
352
+ });
353
+ return obj;
354
+ }
355
+
356
+ class ApiLogComponent {
357
+ constructor(_dialogRef, data) {
358
+ this._dialogRef = _dialogRef;
359
+ this.data = data;
360
+ }
361
+ ngOnInit() {
362
+ this.apiLogStates = indexNameValue(ApiLogStates);
363
+ if (this.data.apiLog) {
364
+ this.apiLog = this.data.apiLog;
365
+ }
366
+ }
367
+ }
368
+ ApiLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
369
+ ApiLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ApiLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"apiLog\">\n\n <div mat-dialog-title>API Log</div>\n\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.wrap\">\n <div>\n <fs-label-field>\n <fs-label>\n Type\n </fs-label>\n {{apiLog.type}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{apiLogStates[apiLog.state]}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.code\">\n <fs-label>\n Code\n </fs-label>\n {{apiLog.code}}\n </fs-label-field>\n\n </div>\n <div>\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{apiLog.createDate|fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.direction\">\n <fs-label>\n Direction\n </fs-label>\n {{apiLog.direction}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.length\">\n <fs-label>\n Duration\n </fs-label>\n {{ apiLog.length | fsDateDuration }}\n </fs-label-field>\n </div>\n </div>\n\n <div>\n <fs-label-field *ngIf=\"apiLog.message\">\n <fs-label>\n Message\n </fs-label>\n {{apiLog.message}}\n </fs-label-field>\n </div>\n\n\n <div class=\"fs-row.gap-large.wrap\">\n <div>\n <fs-label-field *ngIf=\"apiLog.method\">\n <fs-label>\n Method\n </fs-label>\n {{apiLog.method}}\n </fs-label-field>\n </div>\n <div>\n <fs-label-field *ngIf=\"apiLog.url\">\n <fs-label>\n URL\n </fs-label>\n {{apiLog.url}}\n </fs-label-field>\n </div>\n </div>\n\n <div>\n <fs-label-field *ngIf=\"apiLog.request\">\n <fs-label>\n Request\n </fs-label>\n <pre>{{apiLog.request|json}}</pre>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"apiLog.response\">\n <fs-label>\n Response\n </fs-label>\n <pre>{{apiLog.response|json}}</pre>\n </fs-label-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i4$2.FsDateFormatPipe, "fsDateDuration": i4$2.FsDateDurationPipe, "json": i8.JsonPipe } });
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogComponent, decorators: [{
371
+ type: Component,
372
+ args: [{ template: "<fs-dialog *fsSkeleton=\"apiLog\">\n\n <div mat-dialog-title>API Log</div>\n\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.wrap\">\n <div>\n <fs-label-field>\n <fs-label>\n Type\n </fs-label>\n {{apiLog.type}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{apiLogStates[apiLog.state]}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.code\">\n <fs-label>\n Code\n </fs-label>\n {{apiLog.code}}\n </fs-label-field>\n\n </div>\n <div>\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{apiLog.createDate|fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.direction\">\n <fs-label>\n Direction\n </fs-label>\n {{apiLog.direction}}\n </fs-label-field>\n\n\n <fs-label-field *ngIf=\"apiLog.length\">\n <fs-label>\n Duration\n </fs-label>\n {{ apiLog.length | fsDateDuration }}\n </fs-label-field>\n </div>\n </div>\n\n <div>\n <fs-label-field *ngIf=\"apiLog.message\">\n <fs-label>\n Message\n </fs-label>\n {{apiLog.message}}\n </fs-label-field>\n </div>\n\n\n <div class=\"fs-row.gap-large.wrap\">\n <div>\n <fs-label-field *ngIf=\"apiLog.method\">\n <fs-label>\n Method\n </fs-label>\n {{apiLog.method}}\n </fs-label-field>\n </div>\n <div>\n <fs-label-field *ngIf=\"apiLog.url\">\n <fs-label>\n URL\n </fs-label>\n {{apiLog.url}}\n </fs-label-field>\n </div>\n </div>\n\n <div>\n <fs-label-field *ngIf=\"apiLog.request\">\n <fs-label>\n Request\n </fs-label>\n <pre>{{apiLog.request|json}}</pre>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"apiLog.response\">\n <fs-label>\n Response\n </fs-label>\n <pre>{{apiLog.response|json}}</pre>\n </fs-label-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""] }]
373
+ }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
374
+ type: Inject,
375
+ args: [MAT_DIALOG_DATA]
376
+ }] }]; } });
377
+
378
+ class ApiLogsComponent {
379
+ constructor(_dialog) {
380
+ this._dialog = _dialog;
381
+ this.config = null;
382
+ this.apiLogStates = indexNameValue(ApiLogStates);
383
+ }
384
+ ngOnInit() {
385
+ this._configList();
386
+ }
387
+ _configList() {
388
+ this.config = {
389
+ filters: [
390
+ {
391
+ type: ItemType.Keyword,
392
+ name: 'keyword',
393
+ label: 'Search',
394
+ },
395
+ {
396
+ type: ItemType.Select,
397
+ name: 'state',
398
+ label: 'Status',
399
+ values: ApiLogStates,
400
+ },
401
+ {
402
+ name: 'createDate',
403
+ type: ItemType.DateRange,
404
+ label: ['From Date', 'To Date'],
405
+ },
406
+ ],
407
+ fetch: (query) => {
408
+ Object.assign(query, {});
409
+ return this.loadApiLogs(query)
410
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
411
+ },
412
+ };
413
+ }
414
+ open(apiLog) {
415
+ this._dialog.open(ApiLogComponent, {
416
+ data: { apiLog },
417
+ width: '85%',
418
+ });
419
+ }
420
+ }
421
+ ApiLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
422
+ ApiLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ApiLogsComponent, selector: "fs-system-api-logs", inputs: { loadApiLogs: "loadApiLogs" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a href=\"javascript:;\" (click)=\"open(row)\">\n {{row.type || 'Unknown'}}\n <mat-icon class=\"direction\" *ngIf=\"row.direction=='outgoing'\">arrow_upward</mat-icon>\n <mat-icon class=\"direction\" *ngIf=\"row.direction=='incoming'\">arrow_downward</mat-icon>\n </a>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{apiLogStates[row.state]}}\n <span *ngIf=\"row.code\" class=\"code\" [ngClass]=\"{'success': row.code==200,'error': row.code!=200 }\">[{{row.code}}]</span>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Message</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Date</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div><small *ngIf=\"row.length\">Duration: {{ row.length | fsDateDuration }}</small></div>\n </ng-template>\n </fs-list-column>\n </fs-list>\n", styles: [".code.success{color:green}.code.error{color:red}.direction{font-size:14px;height:14px;line-height:14px;width:14px}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe } });
423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogsComponent, decorators: [{
424
+ type: Component,
425
+ args: [{ selector: 'fs-system-api-logs', template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a href=\"javascript:;\" (click)=\"open(row)\">\n {{row.type || 'Unknown'}}\n <mat-icon class=\"direction\" *ngIf=\"row.direction=='outgoing'\">arrow_upward</mat-icon>\n <mat-icon class=\"direction\" *ngIf=\"row.direction=='incoming'\">arrow_downward</mat-icon>\n </a>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{apiLogStates[row.state]}}\n <span *ngIf=\"row.code\" class=\"code\" [ngClass]=\"{'success': row.code==200,'error': row.code!=200 }\">[{{row.code}}]</span>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Message</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Date</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div><small *ngIf=\"row.length\">Duration: {{ row.length | fsDateDuration }}</small></div>\n </ng-template>\n </fs-list-column>\n </fs-list>\n", styles: [".code.success{color:green}.code.error{color:red}.direction{font-size:14px;height:14px;line-height:14px;width:14px}\n"] }]
426
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
427
+ type: ViewChild,
428
+ args: [FsListComponent, { static: true }]
429
+ }], loadApiLogs: [{
430
+ type: Input
431
+ }] } });
432
+
433
+ const CronLogStates = [
434
+ { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
435
+ { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
436
+ { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
437
+ { name: 'Enabled', value: CronLogState.Enabled, color: '#29B7FF' },
438
+ { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
439
+ { name: 'Started', value: CronLogState.Started, color: '#D17333' },
440
+ { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
441
+ { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
442
+ { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
443
+ { name: 'Killed', value: CronLogState.Killed, color: '#FA7567' },
444
+ { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
445
+ { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
446
+ ];
447
+
448
+ class CronLogComponent {
449
+ constructor(_data) {
450
+ this._data = _data;
451
+ this.CronLogStates = indexNameValue(CronLogStates);
452
+ this.CronLogStateColors = {};
453
+ }
454
+ ngOnInit() {
455
+ this.cronLog = this._data.cronLog;
456
+ this.CronLogStateColors = CronLogStates
457
+ .reduce((accum, cronLogState) => {
458
+ accum[cronLogState.value] = cronLogState.color;
459
+ return accum;
460
+ }, {});
461
+ }
462
+ }
463
+ CronLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
464
+ CronLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"cronLog\">\r\n <div mat-dialog-title>Cron Log</div>\r\n <mat-dialog-content>\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n <div [ngStyle]=\"{ color: CronLogStateColors[cronLog.state]}\">\r\n {{CronLogStates[cronLog.state] || cronLog.state}}\r\n </div>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n <fs-date-ago [date]=\"cronLog.createDate\"></fs-date-ago>\r\n </fs-label-field>\r\n </div>\r\n \r\n <fs-label-field *ngIf=\"cronLog.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n <div class=\"message\">\r\n {{cronLog.message}}\r\n </div>\r\n </fs-label-field>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronLogComponent, decorators: [{
466
+ type: Component,
467
+ args: [{ template: "<fs-dialog *fsSkeleton=\"cronLog\">\r\n <div mat-dialog-title>Cron Log</div>\r\n <mat-dialog-content>\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n <div [ngStyle]=\"{ color: CronLogStateColors[cronLog.state]}\">\r\n {{CronLogStates[cronLog.state] || cronLog.state}}\r\n </div>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n <fs-date-ago [date]=\"cronLog.createDate\"></fs-date-ago>\r\n </fs-label-field>\r\n </div>\r\n \r\n <fs-label-field *ngIf=\"cronLog.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n <div class=\"message\">\r\n {{cronLog.message}}\r\n </div>\r\n </fs-label-field>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}\n"] }]
468
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
469
+ type: Inject,
470
+ args: [MAT_DIALOG_DATA]
471
+ }] }]; } });
472
+
473
+ class CronComponent {
474
+ constructor(_data, _dialog, _cdRef) {
475
+ this._data = _data;
476
+ this._dialog = _dialog;
477
+ this._cdRef = _cdRef;
478
+ this.tabIndex = 0;
479
+ this.CronStates = indexNameValue(CronStates);
480
+ this.CronLogStates = indexNameValue(CronLogStates);
481
+ this.CronLogStateColors = {};
482
+ }
483
+ ngOnInit() {
484
+ this.load();
485
+ this.CronLogStateColors = CronLogStates
486
+ .reduce((accum, cronLogState) => {
487
+ accum[cronLogState.value] = cronLogState.color;
488
+ return accum;
489
+ }, {});
490
+ }
491
+ cronLogOpen(cronLog) {
492
+ this._dialog.open(CronLogComponent, {
493
+ data: {
494
+ cronLog,
495
+ },
496
+ width: '85%'
497
+ });
498
+ }
499
+ cronActionClick(cronAction) {
500
+ cronAction.action(this.cron)
501
+ .subscribe(() => {
502
+ this.load();
503
+ });
504
+ }
505
+ selectedIndexChange(index) {
506
+ this.tabIndex = index;
507
+ }
508
+ load() {
509
+ this._data.loadCron(this._data.cron)
510
+ .subscribe((cron) => {
511
+ this.cron = {
512
+ ...this._data.cron,
513
+ ...cron,
514
+ };
515
+ if (this._data.loadCronLogs) {
516
+ this.config = {
517
+ filters: [
518
+ {
519
+ type: ItemType.Select,
520
+ name: 'state',
521
+ label: 'Status',
522
+ values: [
523
+ { name: 'All', value: null },
524
+ ...CronLogStates,
525
+ ],
526
+ },
527
+ {
528
+ type: ItemType.DateRange,
529
+ name: 'date',
530
+ label: ['From Date', 'To Date'],
531
+ },
532
+ ],
533
+ fetch: (query) => {
534
+ query = {
535
+ ...query,
536
+ cronId: this.cron.id,
537
+ };
538
+ return this._data.loadCronLogs(query);
539
+ },
540
+ };
541
+ }
542
+ this.cronActions = this._data.cronActions
543
+ .filter((cronLogAction) => {
544
+ return cronLogAction.show(this.cron);
545
+ });
546
+ this._cdRef.markForCheck();
547
+ });
548
+ }
549
+ }
550
+ CronComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
551
+ CronComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"cron\">\r\n <h1 mat-dialog-title>\r\n Cron\r\n <div class=\"small\">{{cron.name}}</div>\r\n </h1>\r\n <mat-dialog-content>\r\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\r\n <mat-tab label=\"Overview\">\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{CronStates[cron.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"cron.cronSetting\">\r\n <fs-label>\r\n Run Frequency\r\n </fs-label>\r\n {{cron.cronSetting.summary}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Last Ran\r\n </fs-label>\r\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\r\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\r\n </ng-template>\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"cron.message\">\r\n <fs-label>\r\n Last Message\r\n </fs-label>\r\n <div class=\"message\">{{cron.message}}</div>\r\n </fs-label-field>\r\n </mat-tab>\r\n <mat-tab label=\"Logs\" *ngIf=\"config\">\r\n <ng-template matTabContent>\r\n <fs-list [config]=\"config\">\r\n <fs-list-column name=\"state\" title=\"Status\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a \r\n (click)=\"cronLogOpen(row)\"\r\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\r\n {{CronLogStates[row.state] || row.state}}\r\n </a>\r\n </ng-template>\r\n </fs-list-column>\r\n \r\n <fs-list-column title=\"Message\" class=\"col-message\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <div class=\"message\">{{row.message}}</div>\r\n </ng-template>\r\n </fs-list-column>\r\n \r\n <fs-list-column title=\"Duration\" class=\"col-message\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.duration\">\r\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\r\n </ng-container>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list> \r\n </ng-template>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n </mat-dialog-content>\r\n <mat-dialog-actions> \r\n <button \r\n mat-button \r\n [mat-dialog-close]=\"true\" \r\n color=\"primary\">\r\n Done\r\n </button>\r\n <ng-container *ngIf=\"tabIndex === 0\">\r\n <button \r\n *ngFor=\"let cronAction of cronActions\"\r\n mat-button \r\n (click)=\"cronActionClick(cronAction)\">\r\n {{cronAction.label}}\r\n </button> \r\n </ng-container>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [":host ::ng-deep .col-message .message{white-space:break-spaces;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}:host ::ng-deep .col-date{white-space:nowrap}h1 .small{line-height:normal}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}.message{white-space:pre-line}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.MatTabContent, selector: "[matTabContent]" }, { type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
552
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronComponent, decorators: [{
553
+ type: Component,
554
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"cron\">\r\n <h1 mat-dialog-title>\r\n Cron\r\n <div class=\"small\">{{cron.name}}</div>\r\n </h1>\r\n <mat-dialog-content>\r\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\r\n <mat-tab label=\"Overview\">\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{CronStates[cron.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"cron.cronSetting\">\r\n <fs-label>\r\n Run Frequency\r\n </fs-label>\r\n {{cron.cronSetting.summary}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Last Ran\r\n </fs-label>\r\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\r\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\r\n </ng-template>\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"cron.message\">\r\n <fs-label>\r\n Last Message\r\n </fs-label>\r\n <div class=\"message\">{{cron.message}}</div>\r\n </fs-label-field>\r\n </mat-tab>\r\n <mat-tab label=\"Logs\" *ngIf=\"config\">\r\n <ng-template matTabContent>\r\n <fs-list [config]=\"config\">\r\n <fs-list-column name=\"state\" title=\"Status\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a \r\n (click)=\"cronLogOpen(row)\"\r\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\r\n {{CronLogStates[row.state] || row.state}}\r\n </a>\r\n </ng-template>\r\n </fs-list-column>\r\n \r\n <fs-list-column title=\"Message\" class=\"col-message\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <div class=\"message\">{{row.message}}</div>\r\n </ng-template>\r\n </fs-list-column>\r\n \r\n <fs-list-column title=\"Duration\" class=\"col-message\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.duration\">\r\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\r\n </ng-container>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list> \r\n </ng-template>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n </mat-dialog-content>\r\n <mat-dialog-actions> \r\n <button \r\n mat-button \r\n [mat-dialog-close]=\"true\" \r\n color=\"primary\">\r\n Done\r\n </button>\r\n <ng-container *ngIf=\"tabIndex === 0\">\r\n <button \r\n *ngFor=\"let cronAction of cronActions\"\r\n mat-button \r\n (click)=\"cronActionClick(cronAction)\">\r\n {{cronAction.label}}\r\n </button> \r\n </ng-container>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [":host ::ng-deep .col-message .message{white-space:break-spaces;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}:host ::ng-deep .col-date{white-space:nowrap}h1 .small{line-height:normal}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}.message{white-space:pre-line}\n"] }]
555
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
556
+ type: Inject,
557
+ args: [MAT_DIALOG_DATA]
558
+ }] }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }]; } });
559
+
560
+ class CronsComponent {
561
+ constructor(_message, _dialog, _prompt) {
562
+ this._message = _message;
563
+ this._dialog = _dialog;
564
+ this._prompt = _prompt;
565
+ this.config = null;
566
+ this.cronStates = indexNameValue(CronStates);
567
+ this.CronState = CronState;
568
+ this._destroy$ = new Subject();
569
+ }
570
+ ngOnInit() {
571
+ this._configList();
572
+ }
573
+ _configList() {
574
+ this.config = {
575
+ paging: false,
576
+ filters: [
577
+ {
578
+ type: ItemType.Keyword,
579
+ name: 'keyword',
580
+ label: 'Search',
581
+ },
582
+ ],
583
+ rowActions: this.getCronActions()
584
+ .map((rowAction) => {
585
+ return {
586
+ ...rowAction,
587
+ click: (cron) => {
588
+ rowAction.action(cron)
589
+ .subscribe();
590
+ },
591
+ };
592
+ }),
593
+ fetch: (query) => {
594
+ query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
595
+ return this.loadCrons(query)
596
+ .pipe(map((crons) => ({
597
+ data: crons
598
+ .map((cron) => {
599
+ return {
600
+ ...cron,
601
+ runningDuration: differenceInSeconds(parse(cron.createDate), new Date()),
602
+ };
603
+ }),
604
+ })));
605
+ },
606
+ };
607
+ if (this.bulk) {
608
+ this.config.selection = {
609
+ selectAll: false,
610
+ actions: [
611
+ {
612
+ type: SelectionActionType.Action,
613
+ name: 'disable',
614
+ label: 'Disable',
615
+ },
616
+ {
617
+ type: SelectionActionType.Action,
618
+ name: 'enable',
619
+ label: 'Enable',
620
+ },
621
+ ],
622
+ actionSelected: (action) => {
623
+ return this.bulk(action.action.name, action.selected)
624
+ .pipe(tap(() => {
625
+ this.list.reload();
626
+ this._message.success('Applied Changes');
627
+ }));
628
+ },
629
+ };
630
+ }
631
+ }
632
+ open(cron) {
633
+ this._dialog.open(CronComponent, {
634
+ data: {
635
+ cron,
636
+ loadCronLogs: this.loadCronLogs,
637
+ loadCron: this.loadCron,
638
+ cronActions: this.getCronActions(),
639
+ },
640
+ width: '85%',
641
+ });
642
+ }
643
+ getCronActions() {
644
+ return [
645
+ {
646
+ action: (data) => {
647
+ return this.queue(data)
648
+ .pipe(tap(() => {
649
+ this._message.success('Queued cron');
650
+ this.list.reload();
651
+ }));
652
+ },
653
+ label: 'Queue',
654
+ show: (cron) => {
655
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
656
+ },
657
+ },
658
+ {
659
+ action: (data) => {
660
+ return this.run(data)
661
+ .pipe(tap(() => {
662
+ this._message.success('Cron ran');
663
+ this.list.reload();
664
+ }));
665
+ },
666
+ label: 'Run',
667
+ show: (cron) => {
668
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
669
+ },
670
+ },
671
+ {
672
+ action: (data) => {
673
+ return this.enable(data)
674
+ .pipe(tap(() => {
675
+ this._message.success('Enabled cron');
676
+ this.list.reload();
677
+ }));
678
+ },
679
+ label: 'Enable',
680
+ show: (cron) => {
681
+ return cron.state === CronState.Disabled;
682
+ },
683
+ },
684
+ {
685
+ action: (data) => {
686
+ return this.disable(data)
687
+ .pipe(tap(() => {
688
+ this._message.success('Disabled cron');
689
+ this.list.reload();
690
+ }));
691
+ },
692
+ label: 'Disable',
693
+ show: (cron) => {
694
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
695
+ },
696
+ },
697
+ {
698
+ action: (data) => {
699
+ return this._prompt.confirm({
700
+ title: 'Confirm',
701
+ template: 'Are you sure you would like to kill the cron?',
702
+ })
703
+ .pipe(switchMap(() => {
704
+ return this.kill(data);
705
+ }), tap(() => {
706
+ this._message.success('Killed cron');
707
+ this.list.reload();
708
+ }), takeUntil(this._destroy$));
709
+ },
710
+ label: 'Kill',
711
+ show: (cron) => {
712
+ return cron.state === CronState.Running;
713
+ },
714
+ },
715
+ {
716
+ action: (data) => {
717
+ return this._prompt.confirm({
718
+ title: 'Confirm',
719
+ template: 'Are you sure you would like to reset the cron?',
720
+ })
721
+ .pipe(switchMap(() => {
722
+ return this.enable(data);
723
+ }), tap(() => {
724
+ this._message.success('Reset cron');
725
+ this.list.reload();
726
+ }), takeUntil(this._destroy$));
727
+ },
728
+ label: 'Reset',
729
+ show: (cron) => {
730
+ return cron.state === CronState.Killing || cron.state === CronState.Running || cron.state === CronState.Failed || cron.state === CronState.Queued;
731
+ },
732
+ },
733
+ ];
734
+ }
735
+ ngOnDestroy() {
736
+ this._destroy$.next();
737
+ this._destroy$.complete();
738
+ }
739
+ }
740
+ CronsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronsComponent, deps: [{ token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i3$3.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
741
+ CronsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronsComponent, selector: "fs-system-crons", inputs: { enable: "enable", disable: "disable", kill: "kill", queue: "queue", run: "run", loadCrons: "loadCrons", loadCron: "loadCron", loadCronLogs: "loadCronLogs", bulk: "bulk" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.name}}</a>\r\n <div *ngIf=\"row.cronSetting\">\r\n <small>{{row.cronSetting.summary}}</small>\r\n </div>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column align=\"center\">\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.host || row.processId; else status\">\r\n <fs-popover \r\n [maxWidth]=\"null\"\r\n [template]=\"statusPopover\" \r\n size=\"small\">\r\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\r\n </fs-popover>\r\n <ng-template #statusPopover>\r\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\r\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #status>\r\n {{cronStates[row.state]}}\r\n </ng-template>\r\n <ng-container *ngIf=\"row.state === CronState.Running\">\r\n <div class=\"small\">\r\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\r\n </div>\r\n </ng-container> \r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Last Ran</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n <div class=\"small\" *ngIf=\"row.duration\">\r\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i7.FsPopoverComponent, selector: "fs-popover" }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe } });
742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronsComponent, decorators: [{
743
+ type: Component,
744
+ args: [{ selector: 'fs-system-crons', template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.name}}</a>\r\n <div *ngIf=\"row.cronSetting\">\r\n <small>{{row.cronSetting.summary}}</small>\r\n </div>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column align=\"center\">\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.host || row.processId; else status\">\r\n <fs-popover \r\n [maxWidth]=\"null\"\r\n [template]=\"statusPopover\" \r\n size=\"small\">\r\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\r\n </fs-popover>\r\n <ng-template #statusPopover>\r\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\r\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #status>\r\n {{cronStates[row.state]}}\r\n </ng-template>\r\n <ng-container *ngIf=\"row.state === CronState.Running\">\r\n <div class=\"small\">\r\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\r\n </div>\r\n </ng-container> \r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Last Ran</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n <div class=\"small\" *ngIf=\"row.duration\">\r\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""] }]
745
+ }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i1.MatDialog }, { type: i3$3.FsPrompt }]; }, propDecorators: { list: [{
746
+ type: ViewChild,
747
+ args: [FsListComponent, { static: true }]
748
+ }], enable: [{
749
+ type: Input
750
+ }], disable: [{
751
+ type: Input
752
+ }], kill: [{
753
+ type: Input
754
+ }], queue: [{
755
+ type: Input
756
+ }], run: [{
757
+ type: Input
758
+ }], loadCrons: [{
759
+ type: Input
760
+ }], loadCron: [{
761
+ type: Input
762
+ }], loadCronLogs: [{
763
+ type: Input
764
+ }], bulk: [{
765
+ type: Input
766
+ }] } });
767
+
768
+ class DashboardComponent {
769
+ constructor(_message, _cdRef, _buildService) {
770
+ this._message = _message;
771
+ this._cdRef = _cdRef;
772
+ this._buildService = _buildService;
773
+ this.buttonActions = [];
774
+ this.menuActions = [];
775
+ this._destroy$ = new Subject();
776
+ this.actions = [];
777
+ }
778
+ ngOnInit() {
779
+ this._load();
780
+ this.buttonActions = this.actions.filter(item => { return !item.menu; });
781
+ this.menuActions = this.actions.filter(item => { return item.menu; });
782
+ this.build = this._buildService.build;
783
+ this._buildService.build$
784
+ .pipe(takeUntil(this._destroy$))
785
+ .subscribe((build) => {
786
+ this.build = build;
787
+ this._cdRef.markForCheck();
788
+ });
789
+ }
790
+ _load() {
791
+ this.load()
792
+ .subscribe((dashboard) => {
793
+ this.dashboard = dashboard;
794
+ this.dashboard.cronRanAttention = !dashboard.cronRan ||
795
+ differenceInMinutes(new Date(), new Date(dashboard.cronRan)) > 15;
796
+ this._cdRef.markForCheck();
797
+ });
798
+ }
799
+ ngOnDestroy() {
800
+ this._destroy$.next();
801
+ this._destroy$.complete();
802
+ }
803
+ actionClick(action) {
804
+ action.click();
805
+ }
806
+ initClick() {
807
+ this.init()
808
+ .subscribe(() => {
809
+ this._message.success('Successfully initialized the system');
810
+ });
811
+ }
812
+ upgradeClick() {
813
+ this.upgrade()
814
+ .subscribe(() => {
815
+ this._load();
816
+ this._message.success('Successfully upgraded the system');
817
+ });
818
+ }
819
+ }
820
+ DashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DashboardComponent, deps: [{ token: i1$1.FsMessage }, { token: i0.ChangeDetectorRef }, { token: i2$3.FsBuildService }], target: i0.ɵɵFactoryTarget.Component });
821
+ DashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DashboardComponent, selector: "fs-system-dashboard", inputs: { init: "init", upgrade: "upgrade", load: "load", actions: "actions" }, ngImport: i0, template: "<div *fsSkeleton=\"dashboard\">\r\n <div class=\"fs-row.gap-large.wrap.align-start\">\r\n <div>\r\n <h2>Server</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.serverTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.serverTimezone}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Hostname</fs-label>\r\n {{dashboard.serverHostname}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Directory</fs-label>\r\n {{dashboard.appDirectory}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>System</h2>\r\n <fs-label-field>\r\n <fs-label>Mode</fs-label>\r\n {{dashboard.appMode}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Notification Recipients</fs-label>\r\n {{dashboard.notifyRecipients.join(', ')}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Database</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Name</fs-label>\r\n {{dashboard.databaseName}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.databaseTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.databaseTimezone}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div *ngIf=\"build || dashboard.upgrades.length\">\r\n <ng-container *ngIf=\"build\">\r\n <h2>Build</h2>\r\n <fs-label-field>\r\n <fs-label>Version</fs-label>\r\n {{build.version || 'Unknown'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date</fs-label>\r\n {{ (build.date | fsDateFormat: 'date-time') || 'Unknown' }}\r\n </fs-label-field>\r\n </ng-container>\r\n\r\n <fs-label-field *ngIf=\"dashboard.upgrades.length\">\r\n <fs-label>Pending Upgrades</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': !!dashboard.upgrades.length }\">\r\n {{dashboard.upgrades.length}}\r\n <mat-icon\r\n [matTooltip]=\"dashboard.upgrades.join('\\n')\"\r\n matTooltipClass=\"tooltip-pending-upgrades\"\r\n >\r\n warning\r\n </mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Cron</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Last Ran</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': dashboard.cronRanAttention }\">\r\n <span *ngIf=\"!dashboard.cronRan\">Never</span>\r\n <span *ngIf=\"dashboard.cronRan\">{{dashboard.cronRan | fsDateFormat: 'date-time'}}</span>\r\n <mat-icon>warning</mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n </div>\r\n \r\n\r\n <div>\r\n <div class=\"actions\">\r\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\r\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\r\n <button\r\n *ngFor=\"let action of buttonActions\"\r\n mat-raised-button\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </button>\r\n\r\n <ng-container *ngIf=\"menuActions.length\">\r\n <fs-menu buttonClass=\"mat-raised-button menu-button\">\r\n <ng-template\r\n *ngFor=\"let action of menuActions\"\r\n fs-menu-item\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </ng-template>\r\n </fs-menu>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host ::ng-deep .menu-button{box-shadow:none}h2{margin-top:0}.actions{display:flex;align-items:center;flex-wrap:wrap}.actions button,.actions fs-menu{margin-bottom:10px;margin-right:5px}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width: 1000px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}\n"], components: [{ type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }], pipes: { "fsDateFormat": i4$2.FsDateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DashboardComponent, decorators: [{
823
+ type: Component,
824
+ args: [{ selector: 'fs-system-dashboard', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *fsSkeleton=\"dashboard\">\r\n <div class=\"fs-row.gap-large.wrap.align-start\">\r\n <div>\r\n <h2>Server</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.serverTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.serverTimezone}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Hostname</fs-label>\r\n {{dashboard.serverHostname}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Directory</fs-label>\r\n {{dashboard.appDirectory}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>System</h2>\r\n <fs-label-field>\r\n <fs-label>Mode</fs-label>\r\n {{dashboard.appMode}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Notification Recipients</fs-label>\r\n {{dashboard.notifyRecipients.join(', ')}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Database</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Name</fs-label>\r\n {{dashboard.databaseName}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.databaseTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.databaseTimezone}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div *ngIf=\"build || dashboard.upgrades.length\">\r\n <ng-container *ngIf=\"build\">\r\n <h2>Build</h2>\r\n <fs-label-field>\r\n <fs-label>Version</fs-label>\r\n {{build.version || 'Unknown'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date</fs-label>\r\n {{ (build.date | fsDateFormat: 'date-time') || 'Unknown' }}\r\n </fs-label-field>\r\n </ng-container>\r\n\r\n <fs-label-field *ngIf=\"dashboard.upgrades.length\">\r\n <fs-label>Pending Upgrades</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': !!dashboard.upgrades.length }\">\r\n {{dashboard.upgrades.length}}\r\n <mat-icon\r\n [matTooltip]=\"dashboard.upgrades.join('\\n')\"\r\n matTooltipClass=\"tooltip-pending-upgrades\"\r\n >\r\n warning\r\n </mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Cron</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Last Ran</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': dashboard.cronRanAttention }\">\r\n <span *ngIf=\"!dashboard.cronRan\">Never</span>\r\n <span *ngIf=\"dashboard.cronRan\">{{dashboard.cronRan | fsDateFormat: 'date-time'}}</span>\r\n <mat-icon>warning</mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n </div>\r\n \r\n\r\n <div>\r\n <div class=\"actions\">\r\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\r\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\r\n <button\r\n *ngFor=\"let action of buttonActions\"\r\n mat-raised-button\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </button>\r\n\r\n <ng-container *ngIf=\"menuActions.length\">\r\n <fs-menu buttonClass=\"mat-raised-button menu-button\">\r\n <ng-template\r\n *ngFor=\"let action of menuActions\"\r\n fs-menu-item\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </ng-template>\r\n </fs-menu>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host ::ng-deep .menu-button{box-shadow:none}h2{margin-top:0}.actions{display:flex;align-items:center;flex-wrap:wrap}.actions button,.actions fs-menu{margin-bottom:10px;margin-right:5px}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width: 1000px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}\n"] }]
825
+ }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i0.ChangeDetectorRef }, { type: i2$3.FsBuildService }]; }, propDecorators: { init: [{
826
+ type: Input
827
+ }], upgrade: [{
828
+ type: Input
829
+ }], load: [{
830
+ type: Input
831
+ }], actions: [{
832
+ type: Input
833
+ }] } });
834
+
835
+ class InfoComponent {
836
+ ngAfterViewInit() {
837
+ this._load();
838
+ }
839
+ _load() {
840
+ this.load()
841
+ .subscribe((info) => {
842
+ info += '<style>body { background: transparent; }</style>';
843
+ const doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentWindow;
844
+ doc.open();
845
+ doc.write(info);
846
+ doc.close();
847
+ const scrollHeight = (this.iframe.nativeElement.contentWindow.document.documentElement.scrollHeight + 100);
848
+ this.iframe.nativeElement.style.height = `${scrollHeight}px`;
849
+ });
850
+ }
851
+ }
852
+ InfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
853
+ InfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: InfoComponent, selector: "fs-system-info", inputs: { load: "load" }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0, template: "<iframe #iframe></iframe>\r\n", styles: ["iframe{width:100%;border:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
854
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InfoComponent, decorators: [{
855
+ type: Component,
856
+ args: [{ selector: 'fs-system-info', changeDetection: ChangeDetectionStrategy.OnPush, template: "<iframe #iframe></iframe>\r\n", styles: ["iframe{width:100%;border:0}\n"] }]
857
+ }], propDecorators: { iframe: [{
858
+ type: ViewChild,
859
+ args: ['iframe']
860
+ }], load: [{
861
+ type: Input
862
+ }] } });
863
+
864
+ class ProcessComponent {
865
+ constructor(data, _message, _cdRef) {
866
+ this.data = data;
867
+ this._message = _message;
868
+ this._cdRef = _cdRef;
869
+ this.ProcessStates = indexNameValue(ProcessStates);
870
+ this.ProcessState = ProcessState;
871
+ }
872
+ ngOnInit() {
873
+ if (this.data.loadProcess) {
874
+ this.load();
875
+ }
876
+ else {
877
+ this.process = this.data.process;
878
+ }
879
+ }
880
+ load() {
881
+ this.data.loadProcess(this.data.process)
882
+ .subscribe((process) => {
883
+ this.process = process;
884
+ this._cdRef.markForCheck();
885
+ });
886
+ }
887
+ run() {
888
+ this._message.success('Running process');
889
+ this.data.run(this.data.process)
890
+ .subscribe(() => {
891
+ this.load();
892
+ });
893
+ setTimeout(() => {
894
+ this.load();
895
+ }, 1000);
896
+ }
897
+ download() {
898
+ this.data.download(this.data.process);
899
+ }
900
+ }
901
+ ProcessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ProcessComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
902
+ ProcessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ProcessComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"process\">\r\n <div mat-dialog-title>Process</div>\r\n <mat-dialog-content>\r\n <div class=\"column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Name\r\n </fs-label>\r\n {{process.prettyName}}\r\n </fs-label-field>\r\n\r\n <div class=\"fs-row.gap-large.wrap\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{ProcessStates[process.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.notify\">\r\n <fs-label>\r\n Notification Email\r\n </fs-label>\r\n {{process.notify}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.pid\">\r\n <fs-label>\r\n PID\r\n </fs-label>\r\n {{process.pid}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div class=\"fs-row.gap-large.wrap\">\r\n <fs-label-field *ngIf=\"process.createDate\">\r\n <fs-label>\r\n Create Date\r\n </fs-label>\r\n {{ process.createDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.startDate\">\r\n <fs-label>\r\n Start Date\r\n </fs-label>\r\n {{ process.startDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.endDate\">\r\n <fs-label>\r\n Complete Date\r\n </fs-label>\r\n {{ process.endDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.duration\">\r\n <fs-label>\r\n Duration\r\n </fs-label>\r\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"process.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{process.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.log\" class=\"log\">\r\n <fs-label>\r\n Log\r\n </fs-label>{{process.log}}\r\n </fs-label-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button \r\n mat-button \r\n [mat-dialog-close]=\"true\" \r\n color=\"primary\">\r\n Close\r\n </button>\r\n <button\r\n *ngIf=\"process.state === ProcessState.Running && data.loadProcess\"\r\n mat-button\r\n (click)=\"load()\">\r\n Refresh\r\n </button>\r\n <button \r\n *ngIf=\"process.state !== ProcessState.Running && data.run\" \r\n mat-button \r\n (click)=\"run()\">\r\n Run\r\n </button>\r\n <button\r\n *ngIf=\"process.filename\"\r\n mat-button\r\n (click)=\"download()\">\r\n Download\r\n </button> \r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [":host ::ng-deep .log .field-content{white-space:pre-wrap;font-family:monospace;font-size:14px}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i4$2.FsDateFormatPipe, "fsDateDuration": i4$2.FsDateDurationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
903
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ProcessComponent, decorators: [{
904
+ type: Component,
905
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"process\">\r\n <div mat-dialog-title>Process</div>\r\n <mat-dialog-content>\r\n <div class=\"column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Name\r\n </fs-label>\r\n {{process.prettyName}}\r\n </fs-label-field>\r\n\r\n <div class=\"fs-row.gap-large.wrap\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{ProcessStates[process.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.notify\">\r\n <fs-label>\r\n Notification Email\r\n </fs-label>\r\n {{process.notify}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.pid\">\r\n <fs-label>\r\n PID\r\n </fs-label>\r\n {{process.pid}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div class=\"fs-row.gap-large.wrap\">\r\n <fs-label-field *ngIf=\"process.createDate\">\r\n <fs-label>\r\n Create Date\r\n </fs-label>\r\n {{ process.createDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.startDate\">\r\n <fs-label>\r\n Start Date\r\n </fs-label>\r\n {{ process.startDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.endDate\">\r\n <fs-label>\r\n Complete Date\r\n </fs-label>\r\n {{ process.endDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.duration\">\r\n <fs-label>\r\n Duration\r\n </fs-label>\r\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"process.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{process.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.log\" class=\"log\">\r\n <fs-label>\r\n Log\r\n </fs-label>{{process.log}}\r\n </fs-label-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button \r\n mat-button \r\n [mat-dialog-close]=\"true\" \r\n color=\"primary\">\r\n Close\r\n </button>\r\n <button\r\n *ngIf=\"process.state === ProcessState.Running && data.loadProcess\"\r\n mat-button\r\n (click)=\"load()\">\r\n Refresh\r\n </button>\r\n <button \r\n *ngIf=\"process.state !== ProcessState.Running && data.run\" \r\n mat-button \r\n (click)=\"run()\">\r\n Run\r\n </button>\r\n <button\r\n *ngIf=\"process.filename\"\r\n mat-button\r\n (click)=\"download()\">\r\n Download\r\n </button> \r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [":host ::ng-deep .log .field-content{white-space:pre-wrap;font-family:monospace;font-size:14px}\n"] }]
906
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
907
+ type: Inject,
908
+ args: [MAT_DIALOG_DATA]
909
+ }] }, { type: i1$1.FsMessage }, { type: i0.ChangeDetectorRef }]; } });
910
+
911
+ class ProcessesComponent {
912
+ constructor(_dialog, _message) {
913
+ this._dialog = _dialog;
914
+ this._message = _message;
915
+ this.actions = [];
916
+ this.config = null;
917
+ this.ProcessStates = indexNameValue(ProcessStates);
918
+ this.ProcessState = ProcessState;
919
+ this._destroy$ = new Subject();
920
+ }
921
+ ngOnInit() {
922
+ this._configList();
923
+ }
924
+ reload() {
925
+ this.list.reload();
926
+ }
927
+ open(process) {
928
+ this._dialog.open(ProcessComponent, {
929
+ data: {
930
+ process,
931
+ download: this.download,
932
+ run: this.run,
933
+ loadProcess: this.loadProcess,
934
+ },
935
+ width: '85%',
936
+ })
937
+ .afterClosed()
938
+ .pipe(takeUntil(this._destroy$))
939
+ .subscribe(() => {
940
+ this.reload();
941
+ });
942
+ }
943
+ ngOnDestroy() {
944
+ this._destroy$.next();
945
+ this._destroy$.complete();
946
+ }
947
+ _configList() {
948
+ this.config = {
949
+ actions: [],
950
+ rowActions: [],
951
+ filters: [
952
+ {
953
+ type: ItemType.Keyword,
954
+ name: 'keyword',
955
+ label: 'Search',
956
+ },
957
+ {
958
+ type: ItemType.Select,
959
+ name: 'state',
960
+ label: 'Status',
961
+ values: ProcessStates,
962
+ },
963
+ ],
964
+ fetch: (query) => {
965
+ return this.loadProcesses(query)
966
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
967
+ },
968
+ };
969
+ if (this.run) {
970
+ this.config.rowActions
971
+ .push({
972
+ label: 'Run',
973
+ show: (process) => {
974
+ return process.state !== ProcessState.Running;
975
+ },
976
+ click: (data) => {
977
+ this._message.info('Running process...');
978
+ this.run(data)
979
+ .subscribe(() => {
980
+ this.reload();
981
+ this._message.success('Succesfully ran process');
982
+ });
983
+ setTimeout(() => {
984
+ this.reload();
985
+ }, 500);
986
+ },
987
+ });
988
+ }
989
+ if (this.kill) {
990
+ this.config.rowActions.push({
991
+ label: 'Kill',
992
+ show: (data) => {
993
+ return !!data.pid;
994
+ },
995
+ click: (data) => {
996
+ this._message.info('Killing process...');
997
+ this.kill(data)
998
+ .subscribe(() => {
999
+ this.reload();
1000
+ this._message.success('Succesfully killed process');
1001
+ });
1002
+ setTimeout(() => {
1003
+ this.reload();
1004
+ }, 500);
1005
+ },
1006
+ });
1007
+ }
1008
+ if (this.delete) {
1009
+ this.config.rowActions.push({
1010
+ label: 'Delete',
1011
+ click: (data) => {
1012
+ this.delete(data)
1013
+ .subscribe(() => {
1014
+ this.reload();
1015
+ this._message.success('Deleted process');
1016
+ });
1017
+ },
1018
+ });
1019
+ }
1020
+ this.actions.forEach((action) => {
1021
+ this.config.actions.push({
1022
+ primary: false,
1023
+ label: action.label,
1024
+ menu: action.menu,
1025
+ click: (data) => {
1026
+ if (action.click) {
1027
+ action.click(data);
1028
+ }
1029
+ if (action.component) {
1030
+ this._dialog.open(action.component, {
1031
+ width: '800px',
1032
+ })
1033
+ .afterClosed()
1034
+ .pipe(takeUntil(this._destroy$))
1035
+ .subscribe(() => {
1036
+ this.reload();
1037
+ });
1038
+ }
1039
+ },
1040
+ });
1041
+ });
1042
+ }
1043
+ }
1044
+ ProcessesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ProcessesComponent, deps: [{ token: i1.MatDialog }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1045
+ ProcessesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ProcessesComponent, selector: "fs-system-processes", inputs: { loadProcesses: "loadProcesses", loadProcess: "loadProcess", run: "run", kill: "kill", delete: "delete", download: "download", actions: "actions" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.prettyName}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ProcessStates[row.state]}}\r\n <small>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\r\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\r\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\r\n </small>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Duration</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.message}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Completed</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ProcessesComponent, decorators: [{
1047
+ type: Component,
1048
+ args: [{ selector: 'fs-system-processes', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.prettyName}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ProcessStates[row.state]}}\r\n <small>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\r\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\r\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\r\n </small>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Duration</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.message}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Completed</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""] }]
1049
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
1050
+ type: ViewChild,
1051
+ args: [FsListComponent]
1052
+ }], loadProcesses: [{
1053
+ type: Input
1054
+ }], loadProcess: [{
1055
+ type: Input
1056
+ }], run: [{
1057
+ type: Input
1058
+ }], kill: [{
1059
+ type: Input
1060
+ }], delete: [{
1061
+ type: Input
1062
+ }], download: [{
1063
+ type: Input
1064
+ }], actions: [{
1065
+ type: Input
1066
+ }] } });
1067
+
1068
+ class ServerLogComponent {
1069
+ constructor(data) {
1070
+ this.data = data;
1071
+ }
1072
+ ngOnInit() {
1073
+ if (this.data.log) {
1074
+ this.log = this.data.log;
1075
+ try {
1076
+ this.log.backtrace = JSON.parse(this.log.backtrace);
1077
+ }
1078
+ catch (e) { }
1079
+ try {
1080
+ this.log.server = JSON.parse(this.log.server);
1081
+ }
1082
+ catch (e) { }
1083
+ }
1084
+ }
1085
+ }
1086
+ ServerLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1087
+ ServerLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ServerLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"log\">\r\n <div mat-dialog-title>Log</div>\r\n <mat-dialog-content>\r\n <div class=\"fs-column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Error Type\r\n </fs-label>\r\n {{log.type}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{log.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n URL\r\n </fs-label>\r\n {{log.url}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n {{log.createDate|fsDateFormat: 'full-date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n File\r\n </fs-label>\r\n {{log.file}} @ {{log.line}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Backtrace\r\n </fs-label>\r\n <pre>{{log.backtrace|json}}</pre>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n $_SERVER\r\n </fs-label>\r\n <pre>{{log.server|json}}</pre>\r\n </fs-label-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [""], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i4$2.FsDateFormatPipe, "json": i8.JsonPipe } });
1088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogComponent, decorators: [{
1089
+ type: Component,
1090
+ args: [{ template: "<fs-dialog *fsSkeleton=\"log\">\r\n <div mat-dialog-title>Log</div>\r\n <mat-dialog-content>\r\n <div class=\"fs-column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Error Type\r\n </fs-label>\r\n {{log.type}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{log.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n URL\r\n </fs-label>\r\n {{log.url}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n {{log.createDate|fsDateFormat: 'full-date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n File\r\n </fs-label>\r\n {{log.file}} @ {{log.line}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Backtrace\r\n </fs-label>\r\n <pre>{{log.backtrace|json}}</pre>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n $_SERVER\r\n </fs-label>\r\n <pre>{{log.server|json}}</pre>\r\n </fs-label-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n", styles: [""] }]
1091
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1092
+ type: Inject,
1093
+ args: [MAT_DIALOG_DATA]
1094
+ }] }]; } });
1095
+
1096
+ class ServerLogsComponent {
1097
+ constructor(_dialog) {
1098
+ this._dialog = _dialog;
1099
+ this.config = null;
1100
+ this.logTypes = [];
1101
+ }
1102
+ ngOnInit() {
1103
+ this._configList();
1104
+ }
1105
+ _configList() {
1106
+ this.config = {
1107
+ filters: [
1108
+ {
1109
+ type: ItemType.Keyword,
1110
+ name: 'keyword',
1111
+ label: 'Search'
1112
+ }
1113
+ ],
1114
+ fetch: query => {
1115
+ return this.loadLogs(query)
1116
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1117
+ }
1118
+ };
1119
+ }
1120
+ open(log) {
1121
+ this._dialog.open(ServerLogComponent, {
1122
+ data: { log: log },
1123
+ width: '85%'
1124
+ });
1125
+ }
1126
+ }
1127
+ ServerLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1128
+ ServerLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ServerLogsComponent, selector: "fs-system-server-logs", inputs: { loadLogs: "loadLogs" }, viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.message}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Type</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.type}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list>\r\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
1129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogsComponent, decorators: [{
1130
+ type: Component,
1131
+ args: [{ selector: 'fs-system-server-logs', template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.message}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Type</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.type}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list>\r\n", styles: [""] }]
1132
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
1133
+ type: ViewChild,
1134
+ args: ['list', { static: true }]
1135
+ }], loadLogs: [{
1136
+ type: Input
1137
+ }] } });
1138
+
1139
+ class KeyNameValuePipe {
1140
+ transform(values) {
1141
+ return Object.keys(values).map((key) => {
1142
+ return { value: key, name: values[key] };
1143
+ });
1144
+ }
1145
+ }
1146
+ KeyNameValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1147
+ KeyNameValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, name: "keyNameValue" });
1148
+ KeyNameValuePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe });
1149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, decorators: [{
1150
+ type: Pipe,
1151
+ args: [{
1152
+ name: 'keyNameValue',
1153
+ }]
1154
+ }, {
1155
+ type: Injectable
1156
+ }] });
1157
+
1158
+ class SettingsComponent {
1159
+ constructor(_message, _clipboard, _prompt, _cdRef) {
1160
+ this._message = _message;
1161
+ this._clipboard = _clipboard;
1162
+ this._prompt = _prompt;
1163
+ this._cdRef = _cdRef;
1164
+ this.fileRemove = new EventEmitter();
1165
+ this.fileSelect = new EventEmitter();
1166
+ this.groupedSettings = [];
1167
+ this.groups = [];
1168
+ this.SettingInterfaceType = SettingInterfaceType;
1169
+ }
1170
+ ngOnInit() {
1171
+ this.loadSettings({
1172
+ visible: true,
1173
+ })
1174
+ .subscribe((settings) => {
1175
+ settings = settings
1176
+ .filter((setting) => {
1177
+ return setting.interfaceType !== SettingInterfaceType.None;
1178
+ })
1179
+ .map((setting) => {
1180
+ switch (setting.interfaceType) {
1181
+ case SettingInterfaceType.Date:
1182
+ case SettingInterfaceType.Time:
1183
+ return {
1184
+ ...setting,
1185
+ value: parse(setting.value),
1186
+ };
1187
+ case SettingInterfaceType.SelectMultiple:
1188
+ return {
1189
+ ...setting,
1190
+ value: Array.isArray(setting.value) ? setting.value : [],
1191
+ };
1192
+ }
1193
+ return setting;
1194
+ });
1195
+ this.groupedSettings = settings.reduce((accum, item) => {
1196
+ if (accum[item.group] === undefined) {
1197
+ accum[item.group] = [];
1198
+ }
1199
+ accum[item.group].push(item);
1200
+ return accum;
1201
+ }, {});
1202
+ this.groups = Object.keys(this.groupedSettings);
1203
+ this._cdRef.markForCheck();
1204
+ });
1205
+ }
1206
+ export(event, settings) {
1207
+ event.stopPropagation();
1208
+ const data = settings.map((setting) => {
1209
+ return {
1210
+ name: setting.name,
1211
+ value: setting.value,
1212
+ group: setting.group,
1213
+ };
1214
+ });
1215
+ this._clipboard.copy(JSON.stringify(data));
1216
+ this._message.success('Copied to clipboard');
1217
+ }
1218
+ import(event, group) {
1219
+ event.stopPropagation();
1220
+ this._prompt.input({
1221
+ label: 'JSON Import',
1222
+ title: 'Import Settings',
1223
+ commitLabel: 'Import',
1224
+ required: true,
1225
+ }).subscribe((value) => {
1226
+ if (value) {
1227
+ try {
1228
+ const settings = this.groupedSettings[group];
1229
+ const data = JSON.parse(value);
1230
+ data.forEach((item) => {
1231
+ const setting = settings.find((s) => {
1232
+ return item.name === s.name;
1233
+ });
1234
+ if (setting) {
1235
+ Object.assign(setting, item);
1236
+ }
1237
+ });
1238
+ this._cdRef.markForCheck();
1239
+ }
1240
+ catch (e) {
1241
+ this._message.error(e);
1242
+ }
1243
+ }
1244
+ });
1245
+ }
1246
+ saveGroup(group) {
1247
+ const settings = this.groupedSettings[group];
1248
+ const values = settings.reduce((result, value) => {
1249
+ return (result[value.name] = value.value, result);
1250
+ }, {});
1251
+ this.save(group, values)
1252
+ .subscribe(() => {
1253
+ this._message.success('Changes Saved');
1254
+ });
1255
+ }
1256
+ }
1257
+ SettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SettingsComponent, deps: [{ token: i1$1.FsMessage }, { token: i2$1.FsClipboard }, { token: i3$3.FsPrompt }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1258
+ SettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SettingsComponent, selector: "fs-system-settings", inputs: { loadSettings: "loadSettings", save: "save" }, outputs: { fileRemove: "fileRemove", fileSelect: "fileSelect" }, ngImport: i0, template: "\r\n<mat-accordion>\r\n <mat-expansion-panel hideToggle *ngFor=\"let group of groups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n <div class=\"title-row\">\r\n <div class=\"title\">{{group || 'General'}}</div>\r\n <div class=\"actions\">\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Export ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"export($event, groupedSettings[group])\">\r\n <mat-icon>cloud_download</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Import ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"import($event, group)\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div \r\n hideToggle \r\n *ngFor=\"let setting of groupedSettings[group]\" \r\n class=\"setting\"\r\n [ngClass]=\"{ 'has-instruction': !! setting.instruction }\">\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\"\r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <textarea\r\n matInput\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n </textarea>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Select || setting.interfaceType===SettingInterfaceType.SelectMultiple\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <mat-select\r\n [(ngModel)]=\"setting.value\"\r\n [multiple]=\"setting.interfaceType===SettingInterfaceType.SelectMultiple\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-option *ngFor=\"let item of setting.values | keyNameValue\" [value]=\"item.value\">\r\n {{item.name}}\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsDatePicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Color\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsColorPicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsTimePicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <fs-file-picker\r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.File\"\r\n [allowRemove]=\"true\"\r\n [allowDownload]=\"true\"\r\n (select)=\"fileSelect.emit({ setting: setting, file: $event.file })\"\r\n (remove)=\"fileRemove.emit(setting)\"\r\n [url]=\"setting.value\">\r\n <div fsFileLabel>{{setting.label}}</div>\r\n <div fsFileHint>{{setting.instruction}}</div>\r\n </fs-file-picker>\r\n </div>\r\n\r\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"saveGroup(group)\">Save</button>\r\n\r\n </mat-expansion-panel>\r\n\r\n</mat-accordion>\r\n", styles: [".mat-expansion-panel-header{font-size:19px}.full-width{width:100%}.title-row{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-start;align-items:center;width:100%}.title-row .title{display:flex;flex:1}:host ::ng-deep .mat-expansion-panel-header-title{margin:0}:host ::ng-deep .mat-expansion-panel .actions{display:none}:host ::ng-deep .mat-expansion-panel.mat-expanded .actions{display:block}:host ::ng-deep .setting.has-instruction fs-file-picker fs-label-message{display:block;padding-bottom:1em}\n"], components: [{ type: i4$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i4$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i7$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i8$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i9$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i10$1.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes", "weekStartsOn"], outputs: ["change"] }, { type: i11.FsColorPickerComponent, selector: "[fsColorPicker]", inputs: ["showClear"] }, { type: i10$1.FsTimePickerComponent, selector: "[fsTimePicker]", inputs: ["view"] }, { type: i12.FsFilePickerComponent, selector: "fs-file-picker", inputs: ["minWidth", "minHeight", "imageWidth", "imageHeight", "imageQuality", "label", "showFilename", "allowDownload", "allowReupload", "multiple", "allowRemove", "url", "file", "accept", "disabled", "previewWidth", "previewHeight"], outputs: ["select", "remove", "download"] }], directives: [{ type: i4$3.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.MatLabel, selector: "mat-label" }, { type: i15.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i16.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i16.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i16.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i12.FsFileLabelDirective, selector: "[fsFileLabel]" }], pipes: { "keyNameValue": KeyNameValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SettingsComponent, decorators: [{
1260
+ type: Component,
1261
+ args: [{ selector: 'fs-system-settings', changeDetection: ChangeDetectionStrategy.OnPush, template: "\r\n<mat-accordion>\r\n <mat-expansion-panel hideToggle *ngFor=\"let group of groups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n <div class=\"title-row\">\r\n <div class=\"title\">{{group || 'General'}}</div>\r\n <div class=\"actions\">\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Export ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"export($event, groupedSettings[group])\">\r\n <mat-icon>cloud_download</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Import ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"import($event, group)\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div \r\n hideToggle \r\n *ngFor=\"let setting of groupedSettings[group]\" \r\n class=\"setting\"\r\n [ngClass]=\"{ 'has-instruction': !! setting.instruction }\">\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\"\r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <textarea\r\n matInput\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n </textarea>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Select || setting.interfaceType===SettingInterfaceType.SelectMultiple\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <mat-select\r\n [(ngModel)]=\"setting.value\"\r\n [multiple]=\"setting.interfaceType===SettingInterfaceType.SelectMultiple\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-option *ngFor=\"let item of setting.values | keyNameValue\" [value]=\"item.value\">\r\n {{item.name}}\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsDatePicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Color\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsColorPicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field \r\n class=\"full-width form-field-multiline-subscript\" \r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\r\n <mat-label>{{setting.label}}</mat-label>\r\n <input\r\n matInput\r\n fsTimePicker\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <fs-file-picker\r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.File\"\r\n [allowRemove]=\"true\"\r\n [allowDownload]=\"true\"\r\n (select)=\"fileSelect.emit({ setting: setting, file: $event.file })\"\r\n (remove)=\"fileRemove.emit(setting)\"\r\n [url]=\"setting.value\">\r\n <div fsFileLabel>{{setting.label}}</div>\r\n <div fsFileHint>{{setting.instruction}}</div>\r\n </fs-file-picker>\r\n </div>\r\n\r\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"saveGroup(group)\">Save</button>\r\n\r\n </mat-expansion-panel>\r\n\r\n</mat-accordion>\r\n", styles: [".mat-expansion-panel-header{font-size:19px}.full-width{width:100%}.title-row{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-start;align-items:center;width:100%}.title-row .title{display:flex;flex:1}:host ::ng-deep .mat-expansion-panel-header-title{margin:0}:host ::ng-deep .mat-expansion-panel .actions{display:none}:host ::ng-deep .mat-expansion-panel.mat-expanded .actions{display:block}:host ::ng-deep .setting.has-instruction fs-file-picker fs-label-message{display:block;padding-bottom:1em}\n"] }]
1262
+ }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i2$1.FsClipboard }, { type: i3$3.FsPrompt }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loadSettings: [{
1263
+ type: Input
1264
+ }], save: [{
1265
+ type: Input
1266
+ }], fileRemove: [{
1267
+ type: Output
1268
+ }], fileSelect: [{
1269
+ type: Output
1270
+ }] } });
1271
+
1272
+ class UpgradeLogsComponent {
1273
+ constructor() {
1274
+ this.config = null;
1275
+ this.logTypes = [];
1276
+ }
1277
+ ngOnInit() {
1278
+ this._configList();
1279
+ }
1280
+ _configList() {
1281
+ this.config = {
1282
+ paging: false,
1283
+ filters: [
1284
+ {
1285
+ type: ItemType.Keyword,
1286
+ name: 'keyword',
1287
+ label: 'Search'
1288
+ }
1289
+ ],
1290
+ fetch: query => {
1291
+ return this.loadUpgradeLogs(query)
1292
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1293
+ }
1294
+ };
1295
+ }
1296
+ }
1297
+ UpgradeLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpgradeLogsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1298
+ UpgradeLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: UpgradeLogsComponent, selector: "fs-system-upgrade-logs", inputs: { loadUpgradeLogs: "loadUpgradeLogs" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.name}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Function</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.function}}()\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
1299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpgradeLogsComponent, decorators: [{
1300
+ type: Component,
1301
+ args: [{ selector: 'fs-system-upgrade-logs', template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.name}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Function</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.function}}()\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n", styles: [""] }]
1302
+ }], propDecorators: { list: [{
1303
+ type: ViewChild,
1304
+ args: [FsListComponent, { static: true }]
1305
+ }], loadUpgradeLogs: [{
1306
+ type: Input
1307
+ }] } });
1308
+
1309
+ const FS_SYSTEM_CONFIG = new InjectionToken('fs-system-config');
1310
+
1311
+ class FsSystemModule {
1312
+ static forRoot(config) {
1313
+ return {
1314
+ ngModule: FsSystemModule,
1315
+ providers: [
1316
+ { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1317
+ ],
1318
+ };
1319
+ }
1320
+ }
1321
+ FsSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1322
+ FsSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, declarations: [DashboardComponent,
1323
+ CronsComponent,
1324
+ SettingsComponent,
1325
+ KeyNameValuePipe,
1326
+ ProcessesComponent,
1327
+ ServerLogComponent,
1328
+ ServerLogsComponent,
1329
+ UpgradeLogsComponent,
1330
+ ApiLogsComponent,
1331
+ ApiLogComponent,
1332
+ InfoComponent,
1333
+ ProcessComponent,
1334
+ CronComponent,
1335
+ CronLogComponent], imports: [CommonModule,
1336
+ FormsModule,
1337
+ MatButtonModule,
1338
+ MatExpansionModule,
1339
+ MatTooltipModule,
1340
+ MatIconModule,
1341
+ MatFormFieldModule,
1342
+ MatInputModule,
1343
+ MatSelectModule,
1344
+ MatDialogModule,
1345
+ MatTabsModule,
1346
+ FsDateModule,
1347
+ FsSkeletonModule,
1348
+ FsListModule,
1349
+ FsFileModule,
1350
+ FsFileManagerModule,
1351
+ FsLabelModule,
1352
+ FsDialogModule,
1353
+ FsDatePickerModule,
1354
+ FsMenuModule,
1355
+ FsPopoverModule,
1356
+ FsColorPickerModule], exports: [DashboardComponent,
1357
+ CronsComponent,
1358
+ SettingsComponent,
1359
+ ProcessesComponent,
1360
+ ServerLogsComponent,
1361
+ UpgradeLogsComponent,
1362
+ ApiLogsComponent,
1363
+ InfoComponent] });
1364
+ FsSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, imports: [[
1365
+ CommonModule,
1366
+ FormsModule,
1367
+ MatButtonModule,
1368
+ MatExpansionModule,
1369
+ MatTooltipModule,
1370
+ MatIconModule,
1371
+ MatFormFieldModule,
1372
+ MatInputModule,
1373
+ MatSelectModule,
1374
+ MatDialogModule,
1375
+ MatTabsModule,
1376
+ FsDateModule,
1377
+ FsSkeletonModule,
1378
+ FsListModule,
1379
+ FsFileModule,
1380
+ FsFileManagerModule,
1381
+ FsLabelModule,
1382
+ FsDialogModule,
1383
+ FsDatePickerModule,
1384
+ FsMenuModule,
1385
+ FsPopoverModule,
1386
+ FsColorPickerModule,
1387
+ ]] });
1388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, decorators: [{
1389
+ type: NgModule,
1390
+ args: [{
1391
+ imports: [
1392
+ CommonModule,
1393
+ FormsModule,
1394
+ MatButtonModule,
1395
+ MatExpansionModule,
1396
+ MatTooltipModule,
1397
+ MatIconModule,
1398
+ MatFormFieldModule,
1399
+ MatInputModule,
1400
+ MatSelectModule,
1401
+ MatDialogModule,
1402
+ MatTabsModule,
1403
+ FsDateModule,
1404
+ FsSkeletonModule,
1405
+ FsListModule,
1406
+ FsFileModule,
1407
+ FsFileManagerModule,
1408
+ FsLabelModule,
1409
+ FsDialogModule,
1410
+ FsDatePickerModule,
1411
+ FsMenuModule,
1412
+ FsPopoverModule,
1413
+ FsColorPickerModule,
1414
+ ],
1415
+ exports: [
1416
+ DashboardComponent,
1417
+ CronsComponent,
1418
+ SettingsComponent,
1419
+ ProcessesComponent,
1420
+ ServerLogsComponent,
1421
+ UpgradeLogsComponent,
1422
+ ApiLogsComponent,
1423
+ InfoComponent,
1424
+ ],
1425
+ declarations: [
1426
+ DashboardComponent,
1427
+ CronsComponent,
1428
+ SettingsComponent,
1429
+ KeyNameValuePipe,
1430
+ ProcessesComponent,
1431
+ ServerLogComponent,
1432
+ ServerLogsComponent,
1433
+ UpgradeLogsComponent,
1434
+ ApiLogsComponent,
1435
+ ApiLogComponent,
1436
+ InfoComponent,
1437
+ ProcessComponent,
1438
+ CronComponent,
1439
+ CronLogComponent,
1440
+ ],
1441
+ }]
1442
+ }] });
1443
+
1444
+ /**
1445
+ * Generated bundle index. Do not edit.
1446
+ */
1447
+
1448
+ export { ApiLogComponent, ApiLogState, ApiLogStates, ApiLogsComponent, CronComponent, CronLogComponent, CronState, CronStates, CronsComponent, DashboardComponent, FS_SYSTEM_CONFIG, FsSystemModule, FsSystemQueryLogsModule, InfoComponent, KeyNameValuePipe, ProcessComponent, ProcessState, ProcessStates, ProcessesComponent, QueryLogsComponent, ServerLogComponent, ServerLogsComponent, SettingsComponent, UpgradeLogsComponent };
1449
+ //# sourceMappingURL=firestitch-system.mjs.map