@firestitch/system 12.5.6 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,1447 @@
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$4 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 i6 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 i4$3 from '@firestitch/menu';
52
+ import { FsMenuModule } from '@firestitch/menu';
53
+ import * as i5 from '@firestitch/skeleton';
54
+ import { FsSkeletonModule } from '@firestitch/skeleton';
55
+ import { SelectionActionType } from '@firestitch/selection';
56
+ import { Subject } from 'rxjs';
57
+ import { differenceInSeconds, differenceInMinutes } from 'date-fns';
58
+ import * as i1$1 from '@firestitch/message';
59
+ import * as i3$2 from '@firestitch/prompt';
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 () {
75
+ return [{ type: undefined, decorators: [{
76
+ type: Inject,
77
+ args: [MAT_DIALOG_DATA]
78
+ }] }];
79
+ } });
80
+
81
+ class QueryLogComponent {
82
+ constructor(_data, _dialog) {
83
+ this._data = _data;
84
+ this._dialog = _dialog;
85
+ this.accessTypes = {
86
+ 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.',
87
+ system: 'The table is empty or has one row.',
88
+ 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',
89
+ 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)',
90
+ 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.',
91
+ fulltext: 'Operation (JOIN) is using the table’s fulltext index',
92
+ 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.',
93
+ 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.',
94
+ 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)',
95
+ unique_subquery: '',
96
+ ALL: 'MySQL scans the entire table to satisfy the query',
97
+ };
98
+ this.queryLog = _data.queryLog;
99
+ }
100
+ openExplain() {
101
+ this._dialog.open(ExplainComponent, {
102
+ data: { explain: this.explain },
103
+ });
104
+ }
105
+ get explain() {
106
+ return this.queryLog.explain;
107
+ }
108
+ get queryBlock() {
109
+ var _a;
110
+ return (_a = this.explain) === null || _a === void 0 ? void 0 : _a.queryBlock;
111
+ }
112
+ get orderingOperation() {
113
+ var _a;
114
+ return (_a = this.queryBlock) === null || _a === void 0 ? void 0 : _a.orderingOperation;
115
+ }
116
+ }
117
+ 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 });
118
+ 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 });
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogComponent, decorators: [{
120
+ type: Component,
121
+ 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"] }]
122
+ }], ctorParameters: function () {
123
+ return [{ type: undefined, decorators: [{
124
+ type: Inject,
125
+ args: [MAT_DIALOG_DATA]
126
+ }] }, { type: i1.MatDialog }];
127
+ } });
128
+
129
+ class QueryLogsComponent {
130
+ constructor(_dialog) {
131
+ this._dialog = _dialog;
132
+ }
133
+ openQueryLog(queryLog) {
134
+ this._dialog.open(QueryLogComponent, {
135
+ data: { queryLog },
136
+ width: '100%',
137
+ });
138
+ }
139
+ ngOnInit() {
140
+ this.listConfig = {
141
+ filters: [
142
+ {
143
+ name: 'keyword',
144
+ type: ItemType.Keyword,
145
+ label: 'Search',
146
+ },
147
+ {
148
+ name: 'optimized',
149
+ type: ItemType.Select,
150
+ label: 'Optimization',
151
+ values: [
152
+ { name: 'Any', value: undefined },
153
+ { name: 'Yes', value: 'true' },
154
+ { name: 'No', value: 'false' },
155
+ ],
156
+ },
157
+ {
158
+ name: 'createDate',
159
+ type: ItemType.DateTimeRange,
160
+ label: ['From Date', 'To Date'],
161
+ },
162
+ {
163
+ name: 'duration',
164
+ type: ItemType.Range,
165
+ label: ['Min Duration', 'Max Duration'],
166
+ },
167
+ ],
168
+ actions: [
169
+ {
170
+ label: 'Purge',
171
+ primary: false,
172
+ click: () => {
173
+ this.purgeQueryLogs()
174
+ .subscribe(() => {
175
+ this.list.reload();
176
+ });
177
+ },
178
+ },
179
+ ],
180
+ fetch: (query) => {
181
+ return this.loadQueryLogs(query)
182
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
183
+ },
184
+ };
185
+ }
186
+ }
187
+ QueryLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
188
+ 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 });
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueryLogsComponent, decorators: [{
190
+ type: Component,
191
+ 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"] }]
192
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
193
+ type: ViewChild,
194
+ args: [FsListComponent]
195
+ }], loadQueryLogs: [{
196
+ type: Input
197
+ }], purgeQueryLogs: [{
198
+ type: Input
199
+ }] } });
200
+
201
+ class FsSystemQueryLogsModule {
202
+ }
203
+ FsSystemQueryLogsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
204
+ FsSystemQueryLogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, declarations: [QueryLogsComponent,
205
+ QueryLogComponent,
206
+ ExplainComponent], imports: [CommonModule,
207
+ RouterModule,
208
+ CommonModule,
209
+ FormsModule,
210
+ MatTabsModule,
211
+ MatButtonModule,
212
+ MatDialogModule,
213
+ FsFormModule,
214
+ FsLabelModule,
215
+ FsPopoverModule,
216
+ FsCommonModule,
217
+ FsDateModule,
218
+ FsDialogModule,
219
+ FsListModule,
220
+ FsClipboardModule], exports: [QueryLogsComponent] });
221
+ FsSystemQueryLogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, imports: [[
222
+ CommonModule,
223
+ RouterModule,
224
+ CommonModule,
225
+ FormsModule,
226
+ MatTabsModule,
227
+ MatButtonModule,
228
+ MatDialogModule,
229
+ FsFormModule,
230
+ FsLabelModule,
231
+ FsPopoverModule,
232
+ FsCommonModule,
233
+ FsDateModule,
234
+ FsDialogModule,
235
+ FsListModule,
236
+ FsClipboardModule,
237
+ ]] });
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemQueryLogsModule, decorators: [{
239
+ type: NgModule,
240
+ args: [{
241
+ imports: [
242
+ CommonModule,
243
+ RouterModule,
244
+ CommonModule,
245
+ FormsModule,
246
+ MatTabsModule,
247
+ MatButtonModule,
248
+ MatDialogModule,
249
+ FsFormModule,
250
+ FsLabelModule,
251
+ FsPopoverModule,
252
+ FsCommonModule,
253
+ FsDateModule,
254
+ FsDialogModule,
255
+ FsListModule,
256
+ FsClipboardModule,
257
+ ],
258
+ declarations: [
259
+ QueryLogsComponent,
260
+ QueryLogComponent,
261
+ ExplainComponent,
262
+ ],
263
+ exports: [
264
+ QueryLogsComponent,
265
+ ],
266
+ }]
267
+ }] });
268
+
269
+ var CronState;
270
+ (function (CronState) {
271
+ CronState["Running"] = "running";
272
+ CronState["Idle"] = "idle";
273
+ CronState["Failed"] = "failed";
274
+ CronState["Queued"] = "queued";
275
+ CronState["Disabled"] = "disabled";
276
+ CronState["Enabled"] = "enabled";
277
+ CronState["Killing"] = "killing";
278
+ })(CronState || (CronState = {}));
279
+
280
+ var SettingInterfaceType;
281
+ (function (SettingInterfaceType) {
282
+ SettingInterfaceType["RadioButton"] = "R";
283
+ SettingInterfaceType["InputBox"] = "I";
284
+ SettingInterfaceType["Textarea"] = "T";
285
+ SettingInterfaceType["Select"] = "D";
286
+ SettingInterfaceType["SelectMultiple"] = "W";
287
+ SettingInterfaceType["Date"] = "A";
288
+ SettingInterfaceType["File"] = "F";
289
+ SettingInterfaceType["Static"] = "S";
290
+ SettingInterfaceType["Password"] = "P";
291
+ SettingInterfaceType["Time"] = "M";
292
+ SettingInterfaceType["None"] = "N";
293
+ SettingInterfaceType["Color"] = "C";
294
+ })(SettingInterfaceType || (SettingInterfaceType = {}));
295
+
296
+ var ApiLogState;
297
+ (function (ApiLogState) {
298
+ ApiLogState["Success"] = "success";
299
+ ApiLogState["Failed"] = "failed";
300
+ ApiLogState["Deleted"] = "deleted";
301
+ })(ApiLogState || (ApiLogState = {}));
302
+
303
+ var ProcessState;
304
+ (function (ProcessState) {
305
+ ProcessState["Queued"] = "Q";
306
+ ProcessState["Running"] = "R";
307
+ ProcessState["Completed"] = "C";
308
+ ProcessState["Killed"] = "K";
309
+ ProcessState["Deleted"] = "D";
310
+ ProcessState["Failed"] = "F";
311
+ })(ProcessState || (ProcessState = {}));
312
+
313
+ var CronLogState;
314
+ (function (CronLogState) {
315
+ CronLogState["Message"] = "message";
316
+ CronLogState["Disabled"] = "disabled";
317
+ CronLogState["Enabled"] = "enabled";
318
+ CronLogState["Started"] = "started";
319
+ CronLogState["Running"] = "running";
320
+ CronLogState["Completed"] = "completed";
321
+ CronLogState["Failed"] = "failed";
322
+ CronLogState["Killed"] = "killed";
323
+ CronLogState["Queued"] = "queued";
324
+ CronLogState["Reset"] = "reset";
325
+ CronLogState["Stagnant"] = "stagnant";
326
+ CronLogState["LongRunning"] = "long_running";
327
+ })(CronLogState || (CronLogState = {}));
328
+
329
+ const CronStates = [
330
+ { name: 'Running', value: CronState.Running },
331
+ { name: 'Idle', value: CronState.Idle },
332
+ { name: 'Failed', value: CronState.Failed },
333
+ { name: 'Queued', value: CronState.Queued },
334
+ { name: 'Disabled', value: CronState.Disabled },
335
+ { name: 'Killing', value: CronState.Killing },
336
+ { name: 'Enabled', value: CronState.Enabled },
337
+ ];
338
+
339
+ const ApiLogStates = [
340
+ { name: 'Success', value: ApiLogState.Success },
341
+ { name: 'Failed', value: ApiLogState.Failed },
342
+ { name: 'Deleted', value: ApiLogState.Deleted }
343
+ ];
344
+
345
+ const ProcessStates = [
346
+ { name: 'Queued', value: ProcessState.Queued },
347
+ { name: 'Running', value: ProcessState.Running },
348
+ { name: 'Completed', value: ProcessState.Completed },
349
+ { name: 'Killed', value: ProcessState.Killed },
350
+ { name: 'Failed', value: ProcessState.Failed },
351
+ { name: 'Deleted', value: ProcessState.Deleted }
352
+ ];
353
+
354
+ function indexNameValue(arry) {
355
+ const obj = {};
356
+ arry.forEach(item => {
357
+ obj[item.value] = item.name;
358
+ });
359
+ return obj;
360
+ }
361
+
362
+ class ApiLogComponent {
363
+ constructor(_dialogRef, data) {
364
+ this._dialogRef = _dialogRef;
365
+ this.data = data;
366
+ }
367
+ ngOnInit() {
368
+ this.apiLogStates = indexNameValue(ApiLogStates);
369
+ if (this.data.apiLog) {
370
+ this.apiLog = this.data.apiLog;
371
+ }
372
+ }
373
+ }
374
+ 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 });
375
+ 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 } });
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogComponent, decorators: [{
377
+ type: Component,
378
+ 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: [""] }]
379
+ }], ctorParameters: function () {
380
+ return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
381
+ type: Inject,
382
+ args: [MAT_DIALOG_DATA]
383
+ }] }];
384
+ } });
385
+
386
+ class ApiLogsComponent {
387
+ constructor(_dialog) {
388
+ this._dialog = _dialog;
389
+ this.config = null;
390
+ this.apiLogStates = indexNameValue(ApiLogStates);
391
+ }
392
+ ngOnInit() {
393
+ this._configList();
394
+ }
395
+ _configList() {
396
+ this.config = {
397
+ filters: [
398
+ {
399
+ type: ItemType.Keyword,
400
+ name: 'keyword',
401
+ label: 'Search',
402
+ },
403
+ {
404
+ type: ItemType.Select,
405
+ name: 'state',
406
+ label: 'Status',
407
+ values: ApiLogStates,
408
+ },
409
+ {
410
+ name: 'createDate',
411
+ type: ItemType.DateRange,
412
+ label: ['From Date', 'To Date'],
413
+ },
414
+ ],
415
+ fetch: (query) => {
416
+ Object.assign(query, {});
417
+ return this.loadApiLogs(query)
418
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
419
+ },
420
+ };
421
+ }
422
+ open(apiLog) {
423
+ this._dialog.open(ApiLogComponent, {
424
+ data: { apiLog },
425
+ width: '85%',
426
+ });
427
+ }
428
+ }
429
+ ApiLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
430
+ 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: i6.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 } });
431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiLogsComponent, decorators: [{
432
+ type: Component,
433
+ 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"] }]
434
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
435
+ type: ViewChild,
436
+ args: [FsListComponent, { static: true }]
437
+ }], loadApiLogs: [{
438
+ type: Input
439
+ }] } });
440
+
441
+ const CronLogStates = [
442
+ { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
443
+ { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
444
+ { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
445
+ { name: 'Enabled', value: CronLogState.Enabled, color: '#29B7FF' },
446
+ { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
447
+ { name: 'Started', value: CronLogState.Started, color: '#D17333' },
448
+ { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
449
+ { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
450
+ { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
451
+ { name: 'Killed', value: CronLogState.Killed, color: '#FA7567' },
452
+ { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
453
+ { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
454
+ ];
455
+
456
+ class CronLogComponent {
457
+ constructor(_data) {
458
+ this._data = _data;
459
+ this.CronLogStates = indexNameValue(CronLogStates);
460
+ this.CronLogStateColors = {};
461
+ }
462
+ ngOnInit() {
463
+ this.cronLog = this._data.cronLog;
464
+ this.CronLogStateColors = CronLogStates
465
+ .reduce((accum, cronLogState) => {
466
+ accum[cronLogState.value] = cronLogState.color;
467
+ return accum;
468
+ }, {});
469
+ }
470
+ }
471
+ 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 });
472
+ 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"] }] });
473
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronLogComponent, decorators: [{
474
+ type: Component,
475
+ 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"] }]
476
+ }], ctorParameters: function () {
477
+ return [{ type: undefined, decorators: [{
478
+ type: Inject,
479
+ args: [MAT_DIALOG_DATA]
480
+ }] }];
481
+ } });
482
+
483
+ class CronComponent {
484
+ constructor(_data, _dialog, _cdRef) {
485
+ this._data = _data;
486
+ this._dialog = _dialog;
487
+ this._cdRef = _cdRef;
488
+ this.tabIndex = 0;
489
+ this.CronStates = indexNameValue(CronStates);
490
+ this.CronLogStates = indexNameValue(CronLogStates);
491
+ this.CronLogStateColors = {};
492
+ }
493
+ ngOnInit() {
494
+ this.load();
495
+ this.CronLogStateColors = CronLogStates
496
+ .reduce((accum, cronLogState) => {
497
+ accum[cronLogState.value] = cronLogState.color;
498
+ return accum;
499
+ }, {});
500
+ }
501
+ cronLogOpen(cronLog) {
502
+ this._dialog.open(CronLogComponent, {
503
+ data: {
504
+ cronLog,
505
+ },
506
+ width: '85%'
507
+ });
508
+ }
509
+ cronActionClick(cronAction) {
510
+ cronAction.action(this.cron)
511
+ .subscribe(() => {
512
+ this.load();
513
+ });
514
+ }
515
+ selectedIndexChange(index) {
516
+ this.tabIndex = index;
517
+ }
518
+ load() {
519
+ this._data.loadCron(this._data.cron)
520
+ .subscribe((cron) => {
521
+ this.cron = Object.assign(Object.assign({}, this._data.cron), cron);
522
+ if (this._data.loadCronLogs) {
523
+ this.config = {
524
+ filters: [
525
+ {
526
+ type: ItemType.Select,
527
+ name: 'state',
528
+ label: 'Status',
529
+ values: [
530
+ { name: 'All', value: null },
531
+ ...CronLogStates,
532
+ ],
533
+ },
534
+ {
535
+ type: ItemType.DateRange,
536
+ name: 'date',
537
+ label: ['From Date', 'To Date'],
538
+ },
539
+ ],
540
+ fetch: (query) => {
541
+ query = Object.assign(Object.assign({}, query), { cronId: this.cron.id });
542
+ return this._data.loadCronLogs(query);
543
+ },
544
+ };
545
+ }
546
+ this.cronActions = this._data.cronActions
547
+ .filter((cronLogAction) => {
548
+ return cronLogAction.show(this.cron);
549
+ });
550
+ this._cdRef.markForCheck();
551
+ });
552
+ }
553
+ }
554
+ 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 });
555
+ 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 });
556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronComponent, decorators: [{
557
+ type: Component,
558
+ 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"] }]
559
+ }], ctorParameters: function () {
560
+ return [{ type: undefined, decorators: [{
561
+ type: Inject,
562
+ args: [MAT_DIALOG_DATA]
563
+ }] }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }];
564
+ } });
565
+
566
+ class CronsComponent {
567
+ constructor(_message, _dialog, _prompt) {
568
+ this._message = _message;
569
+ this._dialog = _dialog;
570
+ this._prompt = _prompt;
571
+ this.config = null;
572
+ this.cronStates = indexNameValue(CronStates);
573
+ this.CronState = CronState;
574
+ this._destroy$ = new Subject();
575
+ }
576
+ ngOnInit() {
577
+ this._configList();
578
+ }
579
+ _configList() {
580
+ this.config = {
581
+ paging: false,
582
+ filters: [
583
+ {
584
+ type: ItemType.Keyword,
585
+ name: 'keyword',
586
+ label: 'Search',
587
+ },
588
+ ],
589
+ rowActions: this.getCronActions()
590
+ .map((rowAction) => {
591
+ return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
592
+ rowAction.action(cron)
593
+ .subscribe();
594
+ } });
595
+ }),
596
+ fetch: (query) => {
597
+ query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
598
+ return this.loadCrons(query)
599
+ .pipe(map((crons) => ({
600
+ data: crons
601
+ .map((cron) => {
602
+ return Object.assign(Object.assign({}, cron), { runningDuration: differenceInSeconds(parse(cron.createDate), new Date()) });
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$2.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$2.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\r\n <div class=\"h2-container\">\r\n\r\n <div class=\"actions\">\r\n <h2>Actions</h2>\r\n <div class=\"fs-row.gap-tiny.wrap\">\r\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\r\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\r\n\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\r\n <div class=\"fs-row.gap-large.wrap\">\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 <h2>Build</h2>\r\n\r\n <ng-container *ngIf=\"build\">\r\n <fs-label-field>\r\n <fs-label>Version</fs-label>\r\n {{build.version}}\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' }}\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</div>\r\n", styles: [".actions{margin-bottom:1.25em}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: 600px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}@media (min-width: 600px){:host ::ng-deep .menu-button{box-shadow:none}}\n"], components: [{ 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: i4$3.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$3.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], 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\r\n <div class=\"h2-container\">\r\n\r\n <div class=\"actions\">\r\n <h2>Actions</h2>\r\n <div class=\"fs-row.gap-tiny.wrap\">\r\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\r\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\r\n\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\r\n <div class=\"fs-row.gap-large.wrap\">\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 <h2>Build</h2>\r\n\r\n <ng-container *ngIf=\"build\">\r\n <fs-label-field>\r\n <fs-label>Version</fs-label>\r\n {{build.version}}\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' }}\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</div>\r\n", styles: [".actions{margin-bottom:1.25em}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: 600px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}@media (min-width: 600px){:host ::ng-deep .menu-button{box-shadow:none}}\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 () {
907
+ return [{ type: undefined, decorators: [{
908
+ type: Inject,
909
+ args: [MAT_DIALOG_DATA]
910
+ }] }, { type: i1$1.FsMessage }, { type: i0.ChangeDetectorRef }];
911
+ } });
912
+
913
+ class ProcessesComponent {
914
+ constructor(_dialog, _message) {
915
+ this._dialog = _dialog;
916
+ this._message = _message;
917
+ this.actions = [];
918
+ this.config = null;
919
+ this.ProcessStates = indexNameValue(ProcessStates);
920
+ this.ProcessState = ProcessState;
921
+ this._destroy$ = new Subject();
922
+ }
923
+ ngOnInit() {
924
+ this._configList();
925
+ }
926
+ reload() {
927
+ this.list.reload();
928
+ }
929
+ open(process) {
930
+ this._dialog.open(ProcessComponent, {
931
+ data: {
932
+ process,
933
+ download: this.download,
934
+ run: this.run,
935
+ loadProcess: this.loadProcess,
936
+ },
937
+ width: '85%',
938
+ })
939
+ .afterClosed()
940
+ .pipe(takeUntil(this._destroy$))
941
+ .subscribe(() => {
942
+ this.reload();
943
+ });
944
+ }
945
+ ngOnDestroy() {
946
+ this._destroy$.next();
947
+ this._destroy$.complete();
948
+ }
949
+ _configList() {
950
+ this.config = {
951
+ actions: [],
952
+ rowActions: [],
953
+ filters: [
954
+ {
955
+ type: ItemType.Keyword,
956
+ name: 'keyword',
957
+ label: 'Search',
958
+ },
959
+ {
960
+ type: ItemType.Select,
961
+ name: 'state',
962
+ label: 'Status',
963
+ values: ProcessStates,
964
+ },
965
+ ],
966
+ fetch: (query) => {
967
+ return this.loadProcesses(query)
968
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
969
+ },
970
+ };
971
+ if (this.run) {
972
+ this.config.rowActions
973
+ .push({
974
+ label: 'Run',
975
+ show: (process) => {
976
+ return process.state !== ProcessState.Running;
977
+ },
978
+ click: (data) => {
979
+ this._message.info('Running process...');
980
+ this.run(data)
981
+ .subscribe(() => {
982
+ this.reload();
983
+ this._message.success('Succesfully ran process');
984
+ });
985
+ setTimeout(() => {
986
+ this.reload();
987
+ }, 500);
988
+ },
989
+ });
990
+ }
991
+ if (this.kill) {
992
+ this.config.rowActions.push({
993
+ label: 'Kill',
994
+ show: (data) => {
995
+ return !!data.pid;
996
+ },
997
+ click: (data) => {
998
+ this._message.info('Killing process...');
999
+ this.kill(data)
1000
+ .subscribe(() => {
1001
+ this.reload();
1002
+ this._message.success('Succesfully killed process');
1003
+ });
1004
+ setTimeout(() => {
1005
+ this.reload();
1006
+ }, 500);
1007
+ },
1008
+ });
1009
+ }
1010
+ if (this.delete) {
1011
+ this.config.rowActions.push({
1012
+ label: 'Delete',
1013
+ click: (data) => {
1014
+ this.delete(data)
1015
+ .subscribe(() => {
1016
+ this.reload();
1017
+ this._message.success('Deleted process');
1018
+ });
1019
+ },
1020
+ });
1021
+ }
1022
+ this.actions.forEach((action) => {
1023
+ this.config.actions.push({
1024
+ primary: false,
1025
+ label: action.label,
1026
+ menu: action.menu,
1027
+ click: (data) => {
1028
+ if (action.click) {
1029
+ action.click(data);
1030
+ }
1031
+ if (action.component) {
1032
+ this._dialog.open(action.component, {
1033
+ width: '800px',
1034
+ })
1035
+ .afterClosed()
1036
+ .pipe(takeUntil(this._destroy$))
1037
+ .subscribe(() => {
1038
+ this.reload();
1039
+ });
1040
+ }
1041
+ },
1042
+ });
1043
+ });
1044
+ }
1045
+ }
1046
+ 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 });
1047
+ 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 });
1048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ProcessesComponent, decorators: [{
1049
+ type: Component,
1050
+ 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: [""] }]
1051
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
1052
+ type: ViewChild,
1053
+ args: [FsListComponent]
1054
+ }], loadProcesses: [{
1055
+ type: Input
1056
+ }], loadProcess: [{
1057
+ type: Input
1058
+ }], run: [{
1059
+ type: Input
1060
+ }], kill: [{
1061
+ type: Input
1062
+ }], delete: [{
1063
+ type: Input
1064
+ }], download: [{
1065
+ type: Input
1066
+ }], actions: [{
1067
+ type: Input
1068
+ }] } });
1069
+
1070
+ class ServerLogComponent {
1071
+ constructor(data) {
1072
+ this.data = data;
1073
+ }
1074
+ ngOnInit() {
1075
+ if (this.data.log) {
1076
+ this.log = this.data.log;
1077
+ try {
1078
+ this.log.backtrace = JSON.parse(this.log.backtrace);
1079
+ }
1080
+ catch (e) { }
1081
+ try {
1082
+ this.log.server = JSON.parse(this.log.server);
1083
+ }
1084
+ catch (e) { }
1085
+ }
1086
+ }
1087
+ }
1088
+ 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 });
1089
+ 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 } });
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogComponent, decorators: [{
1091
+ type: Component,
1092
+ 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: [""] }]
1093
+ }], ctorParameters: function () {
1094
+ return [{ type: undefined, decorators: [{
1095
+ type: Inject,
1096
+ args: [MAT_DIALOG_DATA]
1097
+ }] }];
1098
+ } });
1099
+
1100
+ class ServerLogsComponent {
1101
+ constructor(_dialog) {
1102
+ this._dialog = _dialog;
1103
+ this.config = null;
1104
+ this.logTypes = [];
1105
+ }
1106
+ ngOnInit() {
1107
+ this._configList();
1108
+ }
1109
+ _configList() {
1110
+ this.config = {
1111
+ filters: [
1112
+ {
1113
+ type: ItemType.Keyword,
1114
+ name: 'keyword',
1115
+ label: 'Search'
1116
+ }
1117
+ ],
1118
+ fetch: query => {
1119
+ return this.loadLogs(query)
1120
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1121
+ }
1122
+ };
1123
+ }
1124
+ open(log) {
1125
+ this._dialog.open(ServerLogComponent, {
1126
+ data: { log: log },
1127
+ width: '85%'
1128
+ });
1129
+ }
1130
+ }
1131
+ ServerLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1132
+ 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"] }] });
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ServerLogsComponent, decorators: [{
1134
+ type: Component,
1135
+ 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: [""] }]
1136
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
1137
+ type: ViewChild,
1138
+ args: ['list', { static: true }]
1139
+ }], loadLogs: [{
1140
+ type: Input
1141
+ }] } });
1142
+
1143
+ class KeyNameValuePipe {
1144
+ transform(values) {
1145
+ return Object.keys(values).map((key) => {
1146
+ return { value: key, name: values[key] };
1147
+ });
1148
+ }
1149
+ }
1150
+ KeyNameValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1151
+ KeyNameValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, name: "keyNameValue" });
1152
+ KeyNameValuePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe });
1153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyNameValuePipe, decorators: [{
1154
+ type: Pipe,
1155
+ args: [{
1156
+ name: 'keyNameValue',
1157
+ }]
1158
+ }, {
1159
+ type: Injectable
1160
+ }] });
1161
+
1162
+ class SettingsComponent {
1163
+ constructor(_message, _clipboard, _prompt, _cdRef) {
1164
+ this._message = _message;
1165
+ this._clipboard = _clipboard;
1166
+ this._prompt = _prompt;
1167
+ this._cdRef = _cdRef;
1168
+ this.fileRemove = new EventEmitter();
1169
+ this.fileSelect = new EventEmitter();
1170
+ this.groupedSettings = [];
1171
+ this.groups = [];
1172
+ this.SettingInterfaceType = SettingInterfaceType;
1173
+ }
1174
+ ngOnInit() {
1175
+ this.loadSettings({
1176
+ visible: true,
1177
+ })
1178
+ .subscribe((settings) => {
1179
+ settings = settings
1180
+ .filter((setting) => {
1181
+ return setting.interfaceType !== SettingInterfaceType.None;
1182
+ })
1183
+ .map((setting) => {
1184
+ switch (setting.interfaceType) {
1185
+ case SettingInterfaceType.Date:
1186
+ case SettingInterfaceType.Time:
1187
+ return Object.assign(Object.assign({}, setting), { value: parse(setting.value) });
1188
+ case SettingInterfaceType.SelectMultiple:
1189
+ return Object.assign(Object.assign({}, setting), { value: Array.isArray(setting.value) ? setting.value : [] });
1190
+ }
1191
+ return setting;
1192
+ });
1193
+ this.groupedSettings = settings.reduce((accum, item) => {
1194
+ if (accum[item.group] === undefined) {
1195
+ accum[item.group] = [];
1196
+ }
1197
+ accum[item.group].push(item);
1198
+ return accum;
1199
+ }, {});
1200
+ this.groups = Object.keys(this.groupedSettings);
1201
+ this._cdRef.markForCheck();
1202
+ });
1203
+ }
1204
+ export(event, settings) {
1205
+ event.stopPropagation();
1206
+ const data = settings.map((setting) => {
1207
+ return {
1208
+ name: setting.name,
1209
+ value: setting.value,
1210
+ group: setting.group,
1211
+ };
1212
+ });
1213
+ this._clipboard.copy(JSON.stringify(data));
1214
+ this._message.success('Copied to clipboard');
1215
+ }
1216
+ import(event, group) {
1217
+ event.stopPropagation();
1218
+ this._prompt.input({
1219
+ label: 'JSON Import',
1220
+ title: 'Import Settings',
1221
+ commitLabel: 'Import',
1222
+ required: true,
1223
+ }).subscribe((value) => {
1224
+ if (value) {
1225
+ try {
1226
+ const settings = this.groupedSettings[group];
1227
+ const data = JSON.parse(value);
1228
+ data.forEach((item) => {
1229
+ const setting = settings.find((s) => {
1230
+ return item.name === s.name;
1231
+ });
1232
+ if (setting) {
1233
+ Object.assign(setting, item);
1234
+ }
1235
+ });
1236
+ this._cdRef.markForCheck();
1237
+ }
1238
+ catch (e) {
1239
+ this._message.error(e);
1240
+ }
1241
+ }
1242
+ });
1243
+ }
1244
+ saveGroup(group) {
1245
+ const settings = this.groupedSettings[group];
1246
+ const values = settings.reduce((result, value) => {
1247
+ return (result[value.name] = value.value, result);
1248
+ }, {});
1249
+ this.save(group, values)
1250
+ .subscribe(() => {
1251
+ this._message.success('Changes Saved');
1252
+ });
1253
+ }
1254
+ }
1255
+ 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$2.FsPrompt }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1256
+ 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$4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i4$4.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: i6.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$4.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$4.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 });
1257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SettingsComponent, decorators: [{
1258
+ type: Component,
1259
+ 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"] }]
1260
+ }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i2$1.FsClipboard }, { type: i3$2.FsPrompt }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loadSettings: [{
1261
+ type: Input
1262
+ }], save: [{
1263
+ type: Input
1264
+ }], fileRemove: [{
1265
+ type: Output
1266
+ }], fileSelect: [{
1267
+ type: Output
1268
+ }] } });
1269
+
1270
+ class UpgradeLogsComponent {
1271
+ constructor() {
1272
+ this.config = null;
1273
+ this.logTypes = [];
1274
+ }
1275
+ ngOnInit() {
1276
+ this._configList();
1277
+ }
1278
+ _configList() {
1279
+ this.config = {
1280
+ paging: false,
1281
+ filters: [
1282
+ {
1283
+ type: ItemType.Keyword,
1284
+ name: 'keyword',
1285
+ label: 'Search'
1286
+ }
1287
+ ],
1288
+ fetch: query => {
1289
+ return this.loadUpgradeLogs(query)
1290
+ .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1291
+ }
1292
+ };
1293
+ }
1294
+ }
1295
+ UpgradeLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpgradeLogsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1296
+ 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"] }] });
1297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpgradeLogsComponent, decorators: [{
1298
+ type: Component,
1299
+ 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: [""] }]
1300
+ }], propDecorators: { list: [{
1301
+ type: ViewChild,
1302
+ args: [FsListComponent, { static: true }]
1303
+ }], loadUpgradeLogs: [{
1304
+ type: Input
1305
+ }] } });
1306
+
1307
+ const FS_SYSTEM_CONFIG = new InjectionToken('fs-system-config');
1308
+
1309
+ class FsSystemModule {
1310
+ static forRoot(config) {
1311
+ return {
1312
+ ngModule: FsSystemModule,
1313
+ providers: [
1314
+ { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1315
+ ],
1316
+ };
1317
+ }
1318
+ }
1319
+ FsSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1320
+ FsSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, declarations: [DashboardComponent,
1321
+ CronsComponent,
1322
+ SettingsComponent,
1323
+ KeyNameValuePipe,
1324
+ ProcessesComponent,
1325
+ ServerLogComponent,
1326
+ ServerLogsComponent,
1327
+ UpgradeLogsComponent,
1328
+ ApiLogsComponent,
1329
+ ApiLogComponent,
1330
+ InfoComponent,
1331
+ ProcessComponent,
1332
+ CronComponent,
1333
+ CronLogComponent], imports: [CommonModule,
1334
+ FormsModule,
1335
+ MatButtonModule,
1336
+ MatExpansionModule,
1337
+ MatTooltipModule,
1338
+ MatIconModule,
1339
+ MatFormFieldModule,
1340
+ MatInputModule,
1341
+ MatSelectModule,
1342
+ MatDialogModule,
1343
+ MatTabsModule,
1344
+ FsDateModule,
1345
+ FsSkeletonModule,
1346
+ FsListModule,
1347
+ FsFileModule,
1348
+ FsFileManagerModule,
1349
+ FsLabelModule,
1350
+ FsDialogModule,
1351
+ FsDatePickerModule,
1352
+ FsMenuModule,
1353
+ FsPopoverModule,
1354
+ FsColorPickerModule], exports: [DashboardComponent,
1355
+ CronsComponent,
1356
+ SettingsComponent,
1357
+ ProcessesComponent,
1358
+ ServerLogsComponent,
1359
+ UpgradeLogsComponent,
1360
+ ApiLogsComponent,
1361
+ InfoComponent] });
1362
+ FsSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, imports: [[
1363
+ CommonModule,
1364
+ FormsModule,
1365
+ MatButtonModule,
1366
+ MatExpansionModule,
1367
+ MatTooltipModule,
1368
+ MatIconModule,
1369
+ MatFormFieldModule,
1370
+ MatInputModule,
1371
+ MatSelectModule,
1372
+ MatDialogModule,
1373
+ MatTabsModule,
1374
+ FsDateModule,
1375
+ FsSkeletonModule,
1376
+ FsListModule,
1377
+ FsFileModule,
1378
+ FsFileManagerModule,
1379
+ FsLabelModule,
1380
+ FsDialogModule,
1381
+ FsDatePickerModule,
1382
+ FsMenuModule,
1383
+ FsPopoverModule,
1384
+ FsColorPickerModule,
1385
+ ]] });
1386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsSystemModule, decorators: [{
1387
+ type: NgModule,
1388
+ args: [{
1389
+ imports: [
1390
+ CommonModule,
1391
+ FormsModule,
1392
+ MatButtonModule,
1393
+ MatExpansionModule,
1394
+ MatTooltipModule,
1395
+ MatIconModule,
1396
+ MatFormFieldModule,
1397
+ MatInputModule,
1398
+ MatSelectModule,
1399
+ MatDialogModule,
1400
+ MatTabsModule,
1401
+ FsDateModule,
1402
+ FsSkeletonModule,
1403
+ FsListModule,
1404
+ FsFileModule,
1405
+ FsFileManagerModule,
1406
+ FsLabelModule,
1407
+ FsDialogModule,
1408
+ FsDatePickerModule,
1409
+ FsMenuModule,
1410
+ FsPopoverModule,
1411
+ FsColorPickerModule,
1412
+ ],
1413
+ exports: [
1414
+ DashboardComponent,
1415
+ CronsComponent,
1416
+ SettingsComponent,
1417
+ ProcessesComponent,
1418
+ ServerLogsComponent,
1419
+ UpgradeLogsComponent,
1420
+ ApiLogsComponent,
1421
+ InfoComponent,
1422
+ ],
1423
+ declarations: [
1424
+ DashboardComponent,
1425
+ CronsComponent,
1426
+ SettingsComponent,
1427
+ KeyNameValuePipe,
1428
+ ProcessesComponent,
1429
+ ServerLogComponent,
1430
+ ServerLogsComponent,
1431
+ UpgradeLogsComponent,
1432
+ ApiLogsComponent,
1433
+ ApiLogComponent,
1434
+ InfoComponent,
1435
+ ProcessComponent,
1436
+ CronComponent,
1437
+ CronLogComponent,
1438
+ ],
1439
+ }]
1440
+ }] });
1441
+
1442
+ /**
1443
+ * Generated bundle index. Do not edit.
1444
+ */
1445
+
1446
+ 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 };
1447
+ //# sourceMappingURL=firestitch-system.mjs.map