@firestitch/system 15.0.0 → 16.0.0

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 (93) hide show
  1. package/app/modules/query-logs/components/query-logs/query-logs.component.d.ts +1 -1
  2. package/app/modules/system/components/api-logs/api-logs.component.d.ts +1 -1
  3. package/app/modules/system/components/cron-next-run/cron-next-run.component.d.ts +1 -1
  4. package/app/modules/system/components/crons/crons.component.d.ts +1 -1
  5. package/app/modules/system/components/dashboard/dashboard.component.d.ts +1 -1
  6. package/app/modules/system/components/info/info.component.d.ts +1 -1
  7. package/app/modules/system/components/processes/processes.component.d.ts +1 -1
  8. package/app/modules/system/components/server-logs/server-logs.component.d.ts +1 -1
  9. package/app/modules/system/components/settings/settings.component.d.ts +1 -1
  10. package/app/modules/system/components/upgrade-logs/upgrade-logs.component.d.ts +1 -1
  11. package/esm2022/app/modules/query-logs/components/explain/explain.component.mjs +26 -0
  12. package/esm2022/app/modules/query-logs/components/query-log/query-log.component.mjs +61 -0
  13. package/esm2022/app/modules/query-logs/components/query-logs/query-logs.component.mjs +89 -0
  14. package/{esm2020 → esm2022}/app/modules/query-logs/query-logs.module.mjs +35 -35
  15. package/esm2022/app/modules/system/components/api-log/api-log.component.mjs +38 -0
  16. package/esm2022/app/modules/system/components/api-logs/api-logs.component.mjs +72 -0
  17. package/esm2022/app/modules/system/components/cron/cron.component.mjs +111 -0
  18. package/esm2022/app/modules/system/components/cron-log/cron-log.component.mjs +39 -0
  19. package/esm2022/app/modules/system/components/cron-next-run/cron-next-run.component.mjs +102 -0
  20. package/esm2022/app/modules/system/components/crons/crons.component.mjs +249 -0
  21. package/esm2022/app/modules/system/components/dashboard/dashboard.component.mjs +92 -0
  22. package/esm2022/app/modules/system/components/info/info.component.mjs +33 -0
  23. package/esm2022/app/modules/system/components/process/process.component.mjs +103 -0
  24. package/esm2022/app/modules/system/components/processes/processes.component.mjs +188 -0
  25. package/esm2022/app/modules/system/components/server-log/server-log.component.mjs +40 -0
  26. package/esm2022/app/modules/system/components/server-logs/server-logs.component.mjs +56 -0
  27. package/esm2022/app/modules/system/components/settings/settings.component.mjs +144 -0
  28. package/esm2022/app/modules/system/components/upgrade-logs/upgrade-logs.component.mjs +44 -0
  29. package/{esm2020 → esm2022}/app/modules/system/fs-system.module.mjs +70 -70
  30. package/{esm2020 → esm2022}/app/modules/system/pipes/key-name-value.pipe.mjs +5 -5
  31. package/{fesm2020 → fesm2022}/firestitch-system.mjs +287 -210
  32. package/{fesm2020 → fesm2022}/firestitch-system.mjs.map +1 -1
  33. package/package.json +5 -11
  34. package/esm2020/app/modules/query-logs/components/explain/explain.component.mjs +0 -24
  35. package/esm2020/app/modules/query-logs/components/query-log/query-log.component.mjs +0 -58
  36. package/esm2020/app/modules/query-logs/components/query-logs/query-logs.component.mjs +0 -84
  37. package/esm2020/app/modules/system/components/api-log/api-log.component.mjs +0 -34
  38. package/esm2020/app/modules/system/components/api-logs/api-logs.component.mjs +0 -69
  39. package/esm2020/app/modules/system/components/cron/cron.component.mjs +0 -105
  40. package/esm2020/app/modules/system/components/cron-log/cron-log.component.mjs +0 -37
  41. package/esm2020/app/modules/system/components/cron-next-run/cron-next-run.component.mjs +0 -99
  42. package/esm2020/app/modules/system/components/crons/crons.component.mjs +0 -236
  43. package/esm2020/app/modules/system/components/dashboard/dashboard.component.mjs +0 -84
  44. package/esm2020/app/modules/system/components/info/info.component.mjs +0 -31
  45. package/esm2020/app/modules/system/components/process/process.component.mjs +0 -98
  46. package/esm2020/app/modules/system/components/processes/processes.component.mjs +0 -178
  47. package/esm2020/app/modules/system/components/server-log/server-log.component.mjs +0 -38
  48. package/esm2020/app/modules/system/components/server-logs/server-logs.component.mjs +0 -53
  49. package/esm2020/app/modules/system/components/settings/settings.component.mjs +0 -138
  50. package/esm2020/app/modules/system/components/upgrade-logs/upgrade-logs.component.mjs +0 -44
  51. package/fesm2015/firestitch-system.mjs +0 -1600
  52. package/fesm2015/firestitch-system.mjs.map +0 -1
  53. /package/{esm2020 → esm2022}/app/modules/query-logs/components/explain/index.mjs +0 -0
  54. /package/{esm2020 → esm2022}/app/modules/query-logs/components/index.mjs +0 -0
  55. /package/{esm2020 → esm2022}/app/modules/query-logs/components/query-log/index.mjs +0 -0
  56. /package/{esm2020 → esm2022}/app/modules/query-logs/components/query-logs/index.mjs +0 -0
  57. /package/{esm2020 → esm2022}/app/modules/system/components/api-log/index.mjs +0 -0
  58. /package/{esm2020 → esm2022}/app/modules/system/components/api-logs/index.mjs +0 -0
  59. /package/{esm2020 → esm2022}/app/modules/system/components/cron/index.mjs +0 -0
  60. /package/{esm2020 → esm2022}/app/modules/system/components/cron-log/index.mjs +0 -0
  61. /package/{esm2020 → esm2022}/app/modules/system/components/cron-next-run/index.mjs +0 -0
  62. /package/{esm2020 → esm2022}/app/modules/system/components/crons/index.mjs +0 -0
  63. /package/{esm2020 → esm2022}/app/modules/system/components/dashboard/index.mjs +0 -0
  64. /package/{esm2020 → esm2022}/app/modules/system/components/info/index.mjs +0 -0
  65. /package/{esm2020 → esm2022}/app/modules/system/components/process/index.mjs +0 -0
  66. /package/{esm2020 → esm2022}/app/modules/system/components/processes/index.mjs +0 -0
  67. /package/{esm2020 → esm2022}/app/modules/system/components/server-log/index.mjs +0 -0
  68. /package/{esm2020 → esm2022}/app/modules/system/components/server-logs/index.mjs +0 -0
  69. /package/{esm2020 → esm2022}/app/modules/system/components/settings/index.mjs +0 -0
  70. /package/{esm2020 → esm2022}/app/modules/system/components/upgrade-logs/index.mjs +0 -0
  71. /package/{esm2020 → esm2022}/app/modules/system/consts/api-log-states.const.mjs +0 -0
  72. /package/{esm2020 → esm2022}/app/modules/system/consts/cron-log-states.const.mjs +0 -0
  73. /package/{esm2020 → esm2022}/app/modules/system/consts/cron-process-states.const.mjs +0 -0
  74. /package/{esm2020 → esm2022}/app/modules/system/consts/cron-states.const.mjs +0 -0
  75. /package/{esm2020 → esm2022}/app/modules/system/consts/index.mjs +0 -0
  76. /package/{esm2020 → esm2022}/app/modules/system/consts/process-process-states.const.mjs +0 -0
  77. /package/{esm2020 → esm2022}/app/modules/system/consts/process-states.const.mjs +0 -0
  78. /package/{esm2020 → esm2022}/app/modules/system/consts/setting-interface-types.const.mjs +0 -0
  79. /package/{esm2020 → esm2022}/app/modules/system/enums/api-log-state.enum.mjs +0 -0
  80. /package/{esm2020 → esm2022}/app/modules/system/enums/cron-log-state.enum.mjs +0 -0
  81. /package/{esm2020 → esm2022}/app/modules/system/enums/cron-state.enum.mjs +0 -0
  82. /package/{esm2020 → esm2022}/app/modules/system/enums/index.mjs +0 -0
  83. /package/{esm2020 → esm2022}/app/modules/system/enums/process-state.enum.mjs +0 -0
  84. /package/{esm2020 → esm2022}/app/modules/system/enums/setting-interface-type.enum.mjs +0 -0
  85. /package/{esm2020 → esm2022}/app/modules/system/helpers/index-name-value.mjs +0 -0
  86. /package/{esm2020 → esm2022}/app/modules/system/injectors/system-config.injector.mjs +0 -0
  87. /package/{esm2020 → esm2022}/app/modules/system/interfaces/dashboard-action.mjs +0 -0
  88. /package/{esm2020 → esm2022}/app/modules/system/interfaces/index.mjs +0 -0
  89. /package/{esm2020 → esm2022}/app/modules/system/interfaces/process-action.mjs +0 -0
  90. /package/{esm2020 → esm2022}/app/modules/system/interfaces/process.mjs +0 -0
  91. /package/{esm2020 → esm2022}/app/modules/system/interfaces/system-config.mjs +0 -0
  92. /package/{esm2020 → esm2022}/firestitch-system.mjs +0 -0
  93. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
@@ -1,1600 +0,0 @@
1
- import * as i2 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 i5$2 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 i4$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 i9 from '@firestitch/dialog';
21
- import { FsDialogModule } from '@firestitch/dialog';
22
- import * as i3 from '@firestitch/form';
23
- import { FsFormModule } from '@firestitch/form';
24
- import * as i8 from '@firestitch/label';
25
- import { FsLabelModule } from '@firestitch/label';
26
- import * as i5 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, takeUntil, switchMap, takeWhile } from 'rxjs/operators';
32
- import * as i7$2 from '@angular/material/expansion';
33
- import { MatExpansionModule } from '@angular/material/expansion';
34
- import * as i10$1 from '@angular/material/form-field';
35
- import { MatFormFieldModule } from '@angular/material/form-field';
36
- import * as i3$1 from '@angular/material/icon';
37
- import { MatIconModule } from '@angular/material/icon';
38
- import * as i11 from '@angular/material/input';
39
- import { MatInputModule } from '@angular/material/input';
40
- import * as i6 from '@angular/material/progress-spinner';
41
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
42
- import * as i12 from '@angular/material/select';
43
- import { MatSelectModule } from '@angular/material/select';
44
- import * as i5$1 from '@angular/material/tooltip';
45
- import { MatTooltipModule } from '@angular/material/tooltip';
46
- import * as i16 from '@firestitch/colorpicker';
47
- import { FsColorPickerModule } from '@firestitch/colorpicker';
48
- import * as i15 from '@firestitch/datepicker';
49
- import { FsDatePickerModule } from '@firestitch/datepicker';
50
- import * as i14 from '@firestitch/file';
51
- import { FsFileModule } from '@firestitch/file';
52
- import { FsFileManagerModule } from '@firestitch/file-manager';
53
- import * as i9$1 from '@firestitch/menu';
54
- import { FsMenuModule } from '@firestitch/menu';
55
- import * as i7$1 from '@firestitch/skeleton';
56
- import { FsSkeletonModule } from '@firestitch/skeleton';
57
- import { Subject, timer } from 'rxjs';
58
- import { addMinutes, addHours, addDays, subSeconds, differenceInSeconds, getDaysInMonth, differenceInMinutes } from 'date-fns';
59
- import { SelectionActionType } from '@firestitch/selection';
60
- import * as i1$1 from '@firestitch/message';
61
- import * as i3$2 from '@firestitch/prompt';
62
- import * as i2$2 from '@firestitch/build';
63
- import * as i13 from '@angular/material/core';
64
-
65
- class ExplainComponent {
66
- constructor(_data) {
67
- this._data = _data;
68
- this.explain = _data.explain;
69
- }
70
- }
71
- ExplainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExplainComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
72
- ExplainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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"], dependencies: [{ kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i2.JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExplainComponent, decorators: [{
74
- type: Component,
75
- 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"] }]
76
- }], ctorParameters: function () {
77
- return [{ type: undefined, decorators: [{
78
- type: Inject,
79
- args: [MAT_DIALOG_DATA]
80
- }] }];
81
- } });
82
-
83
- class QueryLogComponent {
84
- constructor(_data, _dialog) {
85
- this._data = _data;
86
- this._dialog = _dialog;
87
- this.accessTypes = {
88
- 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.',
89
- system: 'The table is empty or has one row.',
90
- 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',
91
- 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)',
92
- 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.',
93
- fulltext: 'Operation (JOIN) is using the table’s fulltext index',
94
- 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.',
95
- 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.',
96
- 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)',
97
- unique_subquery: '',
98
- ALL: 'MySQL scans the entire table to satisfy the query',
99
- };
100
- this.queryLog = _data.queryLog;
101
- }
102
- openExplain() {
103
- this._dialog.open(ExplainComponent, {
104
- data: { explain: this.explain },
105
- });
106
- }
107
- get explain() {
108
- return this.queryLog.explain;
109
- }
110
- get queryBlock() {
111
- var _a;
112
- return (_a = this.explain) === null || _a === void 0 ? void 0 : _a.queryBlock;
113
- }
114
- get orderingOperation() {
115
- var _a;
116
- return (_a = this.queryBlock) === null || _a === void 0 ? void 0 : _a.orderingOperation;
117
- }
118
- }
119
- QueryLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryLogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
120
- QueryLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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-lg.wrap.align-start\">\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-lg.wrap.align-start\">\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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i4$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i7.FsPopoverComponent, selector: "fs-popover" }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "component", type: i2$1.FsClipboardButtonComponent, selector: "fs-clipboard-button", inputs: ["content", "tooltip"] }, { kind: "pipe", type: i10.FsFormatTruncatePipe, name: "fsFormatTruncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryLogComponent, decorators: [{
122
- type: Component,
123
- 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-lg.wrap.align-start\">\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-lg.wrap.align-start\">\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"] }]
124
- }], ctorParameters: function () {
125
- return [{ type: undefined, decorators: [{
126
- type: Inject,
127
- args: [MAT_DIALOG_DATA]
128
- }] }, { type: i1.MatDialog }];
129
- } });
130
-
131
- class QueryLogsComponent {
132
- constructor(_dialog) {
133
- this._dialog = _dialog;
134
- }
135
- openQueryLog(queryLog) {
136
- this._dialog.open(QueryLogComponent, {
137
- data: { queryLog },
138
- width: '100%',
139
- });
140
- }
141
- ngOnInit() {
142
- this.listConfig = {
143
- filters: [
144
- {
145
- name: 'keyword',
146
- type: ItemType.Keyword,
147
- label: 'Search',
148
- },
149
- {
150
- name: 'optimized',
151
- type: ItemType.Select,
152
- label: 'Optimization',
153
- values: [
154
- { name: 'Any', value: undefined },
155
- { name: 'Yes', value: 'true' },
156
- { name: 'No', value: 'false' },
157
- ],
158
- },
159
- {
160
- name: 'createDate',
161
- type: ItemType.DateTimeRange,
162
- label: ['From Date', 'To Date'],
163
- },
164
- {
165
- name: 'duration',
166
- type: ItemType.Range,
167
- label: ['Min Duration', 'Max Duration'],
168
- },
169
- ],
170
- actions: [
171
- {
172
- label: 'Purge',
173
- primary: false,
174
- click: () => {
175
- this.purgeQueryLogs()
176
- .subscribe(() => {
177
- this.list.reload();
178
- });
179
- },
180
- },
181
- ],
182
- fetch: (query) => {
183
- return this.loadQueryLogs(query)
184
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
185
- },
186
- };
187
- }
188
- }
189
- QueryLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
190
- QueryLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i10.FsFormatTruncatePipe, name: "fsFormatTruncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryLogsComponent, decorators: [{
192
- type: Component,
193
- 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"] }]
194
- }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
195
- type: ViewChild,
196
- args: [FsListComponent]
197
- }], loadQueryLogs: [{
198
- type: Input
199
- }], purgeQueryLogs: [{
200
- type: Input
201
- }] } });
202
-
203
- class FsSystemQueryLogsModule {
204
- }
205
- FsSystemQueryLogsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsSystemQueryLogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
206
- FsSystemQueryLogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsSystemQueryLogsModule, declarations: [QueryLogsComponent,
207
- QueryLogComponent,
208
- ExplainComponent], imports: [CommonModule,
209
- RouterModule,
210
- CommonModule,
211
- FormsModule,
212
- MatTabsModule,
213
- MatButtonModule,
214
- MatDialogModule,
215
- FsFormModule,
216
- FsLabelModule,
217
- FsPopoverModule,
218
- FsCommonModule,
219
- FsDateModule,
220
- FsDialogModule,
221
- FsListModule,
222
- FsClipboardModule], exports: [QueryLogsComponent] });
223
- FsSystemQueryLogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsSystemQueryLogsModule, imports: [CommonModule,
224
- RouterModule,
225
- CommonModule,
226
- FormsModule,
227
- MatTabsModule,
228
- MatButtonModule,
229
- MatDialogModule,
230
- FsFormModule,
231
- FsLabelModule,
232
- FsPopoverModule,
233
- FsCommonModule,
234
- FsDateModule,
235
- FsDialogModule,
236
- FsListModule,
237
- FsClipboardModule] });
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", 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 ApiLogStates = [
330
- { name: 'Success', value: ApiLogState.Success },
331
- { name: 'Failed', value: ApiLogState.Failed },
332
- { name: 'Deleted', value: ApiLogState.Deleted }
333
- ];
334
-
335
- const CronLogStates = [
336
- { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
337
- { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
338
- { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
339
- { name: 'Enabled', value: CronLogState.Enabled, color: '#29B7FF' },
340
- { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
341
- { name: 'Started', value: CronLogState.Started, color: '#D17333' },
342
- { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
343
- { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
344
- { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
345
- { name: 'Killed', value: CronLogState.Killed, color: '#FA7567' },
346
- { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
347
- { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
348
- ];
349
-
350
- const CronProcessStates = [
351
- { name: 'Running', value: 'running' },
352
- { name: 'Stopped', value: 'stopped' },
353
- ];
354
-
355
- const CronStates = [
356
- { name: 'Running', value: CronState.Running },
357
- { name: 'Idle', value: CronState.Idle },
358
- { name: 'Failed', value: CronState.Failed },
359
- { name: 'Queued', value: CronState.Queued },
360
- { name: 'Disabled', value: CronState.Disabled },
361
- { name: 'Killing', value: CronState.Killing },
362
- { name: 'Enabled', value: CronState.Enabled },
363
- ];
364
-
365
- const ProcessProcessStates = [
366
- { name: 'Missing', value: 'missing' },
367
- { name: 'Running', value: 'running' },
368
- { name: 'Stopped', value: 'stopped' },
369
- ];
370
-
371
- const ProcessStates = [
372
- { name: 'Queued', value: ProcessState.Queued },
373
- { name: 'Running', value: ProcessState.Running },
374
- { name: 'Completed', value: ProcessState.Completed },
375
- { name: 'Killed', value: ProcessState.Killed },
376
- { name: 'Failed', value: ProcessState.Failed },
377
- { name: 'Deleted', value: ProcessState.Deleted }
378
- ];
379
-
380
- const SettingInterfaceTypes = [
381
- { name: 'RadioButton', value: SettingInterfaceType.RadioButton },
382
- { name: 'InputBox', value: SettingInterfaceType.InputBox },
383
- { name: 'Textarea', value: SettingInterfaceType.Textarea },
384
- { name: 'DropDown', value: SettingInterfaceType.Select },
385
- { name: 'File', value: SettingInterfaceType.File },
386
- { name: 'Static', value: SettingInterfaceType.Static },
387
- { name: 'Password', value: SettingInterfaceType.Password },
388
- { name: 'Color', value: SettingInterfaceType.Color }
389
- ];
390
-
391
- function indexNameValue(arry) {
392
- const obj = {};
393
- arry.forEach(item => {
394
- obj[item.value] = item.name;
395
- });
396
- return obj;
397
- }
398
-
399
- class ApiLogComponent {
400
- constructor(_dialogRef, data) {
401
- this._dialogRef = _dialogRef;
402
- this.data = data;
403
- }
404
- ngOnInit() {
405
- this.apiLogStates = indexNameValue(ApiLogStates);
406
- if (this.data.apiLog) {
407
- this.apiLog = this.data.apiLog;
408
- }
409
- }
410
- }
411
- ApiLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiLogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
412
- ApiLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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-lg.wrap.align-start\">\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 <fs-label-field *ngIf=\"apiLog.code\">\n <fs-label>\n Code\n </fs-label>\n {{apiLog.code}}\n </fs-label-field>\n\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 <fs-label-field *ngIf=\"apiLog.direction\">\n <fs-label>\n Direction\n </fs-label>\n {{apiLog.direction}}\n </fs-label-field>\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\n <ng-container *ngIf=\"apiLog.method\">\n <fs-label-field *ngIf=\"apiLog.method\">\n <fs-label>\n Method\n </fs-label>\n {{apiLog.method}}\n </fs-label-field>\n </ng-container>\n \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\n <fs-label-field *ngIf=\"apiLog.message\">\n <fs-label>\n Message\n </fs-label>\n {{apiLog.message}}\n </fs-label-field>\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 <mat-dialog-actions>\n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i2.JsonPipe, name: "json" }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }, { kind: "pipe", type: i4$2.FsDateFormatPipe, name: "fsDateFormat" }] });
413
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiLogComponent, decorators: [{
414
- type: Component,
415
- 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-lg.wrap.align-start\">\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 <fs-label-field *ngIf=\"apiLog.code\">\n <fs-label>\n Code\n </fs-label>\n {{apiLog.code}}\n </fs-label-field>\n\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 <fs-label-field *ngIf=\"apiLog.direction\">\n <fs-label>\n Direction\n </fs-label>\n {{apiLog.direction}}\n </fs-label-field>\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\n <ng-container *ngIf=\"apiLog.method\">\n <fs-label-field *ngIf=\"apiLog.method\">\n <fs-label>\n Method\n </fs-label>\n {{apiLog.method}}\n </fs-label-field>\n </ng-container>\n \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\n <fs-label-field *ngIf=\"apiLog.message\">\n <fs-label>\n Message\n </fs-label>\n {{apiLog.message}}\n </fs-label-field>\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 <mat-dialog-actions>\n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n" }]
416
- }], ctorParameters: function () {
417
- return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
418
- type: Inject,
419
- args: [MAT_DIALOG_DATA]
420
- }] }];
421
- } });
422
-
423
- class ApiLogsComponent {
424
- constructor(_dialog) {
425
- this._dialog = _dialog;
426
- this.config = null;
427
- this.apiLogStates = indexNameValue(ApiLogStates);
428
- }
429
- ngOnInit() {
430
- this._configList();
431
- }
432
- _configList() {
433
- this.config = {
434
- filters: [
435
- {
436
- type: ItemType.Keyword,
437
- name: 'keyword',
438
- label: 'Search',
439
- },
440
- {
441
- type: ItemType.Select,
442
- name: 'state',
443
- label: 'Status',
444
- values: ApiLogStates,
445
- },
446
- {
447
- name: 'createDate',
448
- type: ItemType.DateRange,
449
- label: ['From Date', 'To Date'],
450
- },
451
- ],
452
- fetch: (query) => {
453
- Object.assign(query, {});
454
- return this.loadApiLogs(query)
455
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
456
- },
457
- };
458
- }
459
- open(apiLog) {
460
- this._dialog.open(ApiLogComponent, {
461
- data: { apiLog },
462
- width: '85%',
463
- });
464
- }
465
- }
466
- ApiLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
467
- ApiLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }] });
468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiLogsComponent, decorators: [{
469
- type: Component,
470
- 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"] }]
471
- }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
472
- type: ViewChild,
473
- args: [FsListComponent, { static: true }]
474
- }], loadApiLogs: [{
475
- type: Input
476
- }] } });
477
-
478
- class CronLogComponent {
479
- constructor(_data) {
480
- this._data = _data;
481
- this.CronLogStates = indexNameValue(CronLogStates);
482
- this.CronLogStateColors = {};
483
- }
484
- ngOnInit() {
485
- this.cronLog = this._data.cronLog;
486
- this.CronLogStateColors = CronLogStates
487
- .reduce((accum, cronLogState) => {
488
- accum[cronLogState.value] = cronLogState.color;
489
- return accum;
490
- }, {});
491
- }
492
- }
493
- CronLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
494
- CronLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CronLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"cronLog\">\n <div mat-dialog-title>Cron Log</div>\n <mat-dialog-content>\n <div class=\"row\">\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div [ngStyle]=\"{ color: CronLogStateColors[cronLog.state]}\">\n {{CronLogStates[cronLog.state] || cronLog.state}}\n </div>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n <fs-date-ago [date]=\"cronLog.createDate\"></fs-date-ago>\n </fs-label-field>\n </div>\n \n <fs-label-field *ngIf=\"cronLog.message\">\n <fs-label>\n Message\n </fs-label>\n <div class=\"message\">\n {{cronLog.message}}\n </div>\n </fs-label-field>\n </mat-dialog-content>\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: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }] });
495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronLogComponent, decorators: [{
496
- type: Component,
497
- args: [{ template: "<fs-dialog *fsSkeleton=\"cronLog\">\n <div mat-dialog-title>Cron Log</div>\n <mat-dialog-content>\n <div class=\"row\">\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div [ngStyle]=\"{ color: CronLogStateColors[cronLog.state]}\">\n {{CronLogStates[cronLog.state] || cronLog.state}}\n </div>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n <fs-date-ago [date]=\"cronLog.createDate\"></fs-date-ago>\n </fs-label-field>\n </div>\n \n <fs-label-field *ngIf=\"cronLog.message\">\n <fs-label>\n Message\n </fs-label>\n <div class=\"message\">\n {{cronLog.message}}\n </div>\n </fs-label-field>\n </mat-dialog-content>\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: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}\n"] }]
498
- }], ctorParameters: function () {
499
- return [{ type: undefined, decorators: [{
500
- type: Inject,
501
- args: [MAT_DIALOG_DATA]
502
- }] }];
503
- } });
504
-
505
- class CronComponent {
506
- constructor(_data, _dialog, _cdRef) {
507
- this._data = _data;
508
- this._dialog = _dialog;
509
- this._cdRef = _cdRef;
510
- this.tabIndex = 0;
511
- this.CronStates = indexNameValue(CronStates);
512
- this.CronProcessStates = indexNameValue(CronProcessStates);
513
- this.CronLogStates = indexNameValue(CronLogStates);
514
- this.CronLogStateColors = {};
515
- }
516
- ngOnInit() {
517
- this.load();
518
- this.CronLogStateColors = CronLogStates
519
- .reduce((accum, cronLogState) => {
520
- accum[cronLogState.value] = cronLogState.color;
521
- return accum;
522
- }, {});
523
- }
524
- cronLogOpen(cronLog) {
525
- this._dialog.open(CronLogComponent, {
526
- data: {
527
- cronLog,
528
- },
529
- width: '85%',
530
- });
531
- }
532
- cronActionClick(cronAction) {
533
- cronAction.action(this.cron)
534
- .subscribe(() => {
535
- this.load();
536
- });
537
- }
538
- selectedIndexChange(index) {
539
- this.tabIndex = index;
540
- }
541
- load() {
542
- this._data.loadCron(this._data.cron)
543
- .subscribe((cron) => {
544
- this.cron = Object.assign(Object.assign({}, this._data.cron), cron);
545
- if (this._data.loadCronLogs) {
546
- this.config = {
547
- filters: [
548
- {
549
- type: ItemType.Select,
550
- name: 'state',
551
- label: 'Status',
552
- values: [
553
- { name: 'All', value: null },
554
- ...CronLogStates,
555
- ],
556
- },
557
- {
558
- type: ItemType.DateRange,
559
- name: 'date',
560
- label: ['From Date', 'To Date'],
561
- },
562
- ],
563
- fetch: (query) => {
564
- query = Object.assign(Object.assign({}, query), { cronId: this.cron.id });
565
- return this._data.loadCronLogs(query);
566
- },
567
- };
568
- }
569
- this.cronActions = this._data.cronActions
570
- .filter((cronLogAction) => {
571
- return cronLogAction.show(this.cron);
572
- });
573
- this._cdRef.markForCheck();
574
- });
575
- }
576
- }
577
- CronComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
578
- CronComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CronComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"cron\">\n <h1 mat-dialog-title>\n Cron\n <div class=\"small\">{{cron.name}}</div>\n </h1>\n <mat-dialog-content>\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\n <mat-tab label=\"Overview\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{CronStates[cron.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"cron.cronSetting\">\n <fs-label>\n Run Frequency\n </fs-label>\n {{cron.cronSetting.summary}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{cron.processId || 'None'}}\n <ng-container *ngIf=\"cron.processId\">\n <div class=\"small\">\n {{CronProcessStates[cron.processState] || 'Unknown'}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Last Ran\n </fs-label>\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Timeout hours\n </fs-label>\n {{cron.cronSetting?.timeout || 'N/A'}}\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"cron.message\">\n <fs-label>\n Last Message\n </fs-label>\n <div class=\"message\">{{cron.message}}</div>\n </fs-label-field>\n </mat-tab>\n <mat-tab label=\"Logs\" *ngIf=\"config\">\n <ng-template matTabContent>\n <fs-list [config]=\"config\">\n <fs-list-column name=\"state\" title=\"Status\">\n <ng-template fs-list-cell let-row=\"row\">\n <a \n (click)=\"cronLogOpen(row)\"\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\n {{CronLogStates[row.state] || row.state}}\n </a>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Message\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"message\">{{row.message}}</div>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Duration\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration\">\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\n </ng-container>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\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> \n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions> \n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n <ng-container *ngIf=\"tabIndex === 0\">\n <button \n *ngFor=\"let cronAction of cronActions\"\n mat-button \n (click)=\"cronActionClick(cronAction)\">\n {{cronAction.label}}\n </button> \n </ng-container>\n </mat-dialog-actions>\n</fs-dialog>\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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4$1.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i4$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i4$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronComponent, decorators: [{
580
- type: Component,
581
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"cron\">\n <h1 mat-dialog-title>\n Cron\n <div class=\"small\">{{cron.name}}</div>\n </h1>\n <mat-dialog-content>\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\n <mat-tab label=\"Overview\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{CronStates[cron.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"cron.cronSetting\">\n <fs-label>\n Run Frequency\n </fs-label>\n {{cron.cronSetting.summary}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{cron.processId || 'None'}}\n <ng-container *ngIf=\"cron.processId\">\n <div class=\"small\">\n {{CronProcessStates[cron.processState] || 'Unknown'}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Last Ran\n </fs-label>\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Timeout hours\n </fs-label>\n {{cron.cronSetting?.timeout || 'N/A'}}\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"cron.message\">\n <fs-label>\n Last Message\n </fs-label>\n <div class=\"message\">{{cron.message}}</div>\n </fs-label-field>\n </mat-tab>\n <mat-tab label=\"Logs\" *ngIf=\"config\">\n <ng-template matTabContent>\n <fs-list [config]=\"config\">\n <fs-list-column name=\"state\" title=\"Status\">\n <ng-template fs-list-cell let-row=\"row\">\n <a \n (click)=\"cronLogOpen(row)\"\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\n {{CronLogStates[row.state] || row.state}}\n </a>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Message\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"message\">{{row.message}}</div>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Duration\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration\">\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\n </ng-container>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\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> \n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions> \n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n <ng-container *ngIf=\"tabIndex === 0\">\n <button \n *ngFor=\"let cronAction of cronActions\"\n mat-button \n (click)=\"cronActionClick(cronAction)\">\n {{cronAction.label}}\n </button> \n </ng-container>\n </mat-dialog-actions>\n</fs-dialog>\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"] }]
582
- }], ctorParameters: function () {
583
- return [{ type: undefined, decorators: [{
584
- type: Inject,
585
- args: [MAT_DIALOG_DATA]
586
- }] }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }];
587
- } });
588
-
589
- class CronNextRunComponent {
590
- constructor(_cdRef) {
591
- this._cdRef = _cdRef;
592
- this._destroy$ = new Subject();
593
- }
594
- ngOnInit() {
595
- this.update();
596
- }
597
- calculateDuration() {
598
- const now = new Date();
599
- const nextMinutes = this._getNextMinutes(now);
600
- const nextHours = this._getNextHours(now);
601
- const nextDays = this._getNextDays(now);
602
- if (this.cron.cronSetting.minutes.length ||
603
- this.cron.cronSetting.hours.length ||
604
- this.cron.cronSetting.days.length) {
605
- let next = new Date();
606
- next = addMinutes(next, nextMinutes);
607
- next = addHours(next, nextHours);
608
- next = addDays(next, nextDays);
609
- next = subSeconds(next, next.getSeconds());
610
- this.duration = differenceInSeconds(next, now);
611
- }
612
- else {
613
- this.duration = 60 - now.getSeconds();
614
- }
615
- }
616
- update() {
617
- this.calculateDuration();
618
- timer(0, 1000)
619
- .pipe(tap(() => {
620
- this.duration -= 1;
621
- if (this.duration % 60 === 0 || this.duration < (60 * 5)) {
622
- this._cdRef.markForCheck();
623
- }
624
- if (this.duration <= 0) {
625
- this.calculateDuration();
626
- this._cdRef.markForCheck();
627
- }
628
- }), takeUntil(this._destroy$))
629
- .subscribe();
630
- }
631
- ngOnDestroy() {
632
- this._destroy$.next();
633
- this._destroy$.complete();
634
- }
635
- _getNextMinutes(now) {
636
- const minutes = this.cron.cronSetting.minutes;
637
- if (minutes.length) {
638
- for (let i = minutes.length - 1; i >= 0; i--) {
639
- if (now.getUTCMinutes() >= minutes[i]) {
640
- return (minutes[i + 1] ? minutes[i + 1] - now.getUTCMinutes() : (60 - now.getUTCMinutes() + minutes[i]));
641
- }
642
- }
643
- return minutes[0] - now.getMinutes();
644
- }
645
- return 0;
646
- }
647
- _getNextHours(now) {
648
- const hours = this.cron.cronSetting.hours;
649
- if (hours.length) {
650
- for (let i = hours.length - 1; i >= 0; i--) {
651
- if (now.getUTCHours() >= hours[i]) {
652
- return (hours[i + 1] ? hours[i + 1] - now.getUTCHours() : (24 - now.getUTCHours() + hours[i]));
653
- }
654
- }
655
- return hours[0] - now.getUTCHours();
656
- }
657
- return 0;
658
- }
659
- _getNextDays(now) {
660
- const days = this.cron.cronSetting.days;
661
- if (days.length) {
662
- for (let i = days.length - 1; i >= 0; i--) {
663
- if (now.getDate() >= days[i]) {
664
- return (days[i + 1] ? days[i + 1] : getDaysInMonth(now)) - now.getDate();
665
- }
666
- }
667
- return days[0] - getDaysInMonth(now);
668
- }
669
- return 0;
670
- }
671
- }
672
- CronNextRunComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronNextRunComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
673
- CronNextRunComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CronNextRunComponent, selector: "app-next-run", inputs: { cron: "cron" }, ngImport: i0, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true} }}\n</ng-container>\n\n<ng-template #seconds>\n {{duration}}s\n</ng-template>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
674
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronNextRunComponent, decorators: [{
675
- type: Component,
676
- args: [{ selector: 'app-next-run', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true} }}\n</ng-container>\n\n<ng-template #seconds>\n {{duration}}s\n</ng-template>\n\n" }]
677
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { cron: [{
678
- type: Input
679
- }] } });
680
-
681
- class CronsComponent {
682
- constructor(_message, _dialog, _prompt) {
683
- this._message = _message;
684
- this._dialog = _dialog;
685
- this._prompt = _prompt;
686
- this.config = null;
687
- this.CronStates = indexNameValue(CronStates);
688
- this.CronProcessStates = indexNameValue(CronProcessStates);
689
- this.CronState = CronState;
690
- this._destroy$ = new Subject();
691
- }
692
- ngOnInit() {
693
- this._configList();
694
- }
695
- open(cron) {
696
- this._dialog.open(CronComponent, {
697
- data: {
698
- cron,
699
- loadCronLogs: this.loadCronLogs,
700
- loadCron: this.loadCron,
701
- cronActions: this.getCronActions(),
702
- },
703
- width: '85%',
704
- });
705
- }
706
- getCronActions() {
707
- return [
708
- {
709
- action: (data) => {
710
- return this.queue(data)
711
- .pipe(tap(() => {
712
- this._message.success('Queued cron');
713
- this.list.reload();
714
- }));
715
- },
716
- label: 'Queue',
717
- show: (cron) => {
718
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
719
- },
720
- },
721
- {
722
- action: (data) => {
723
- return this.run(data)
724
- .pipe(tap(() => {
725
- this._message.success('Cron ran');
726
- this.list.reload();
727
- }));
728
- },
729
- label: 'Run',
730
- show: (cron) => {
731
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
732
- },
733
- },
734
- {
735
- action: (data) => {
736
- return this.enable(data)
737
- .pipe(tap(() => {
738
- this._message.success('Enabled cron');
739
- this.list.reload();
740
- }));
741
- },
742
- label: 'Enable',
743
- show: (cron) => {
744
- return cron.state === CronState.Disabled;
745
- },
746
- },
747
- {
748
- action: (data) => {
749
- return this.disable(data)
750
- .pipe(tap(() => {
751
- this._message.success('Disabled cron');
752
- this.list.reload();
753
- }));
754
- },
755
- label: 'Disable',
756
- show: (cron) => {
757
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
758
- },
759
- },
760
- {
761
- action: (data) => {
762
- return this._prompt.confirm({
763
- title: 'Confirm',
764
- template: 'Are you sure you would like to kill the cron?',
765
- })
766
- .pipe(switchMap(() => {
767
- return this.kill(data);
768
- }), tap(() => {
769
- this._message.success('Killed cron');
770
- this.list.reload();
771
- }), takeUntil(this._destroy$));
772
- },
773
- label: 'Kill',
774
- show: (cron) => {
775
- return cron.state === CronState.Running;
776
- },
777
- },
778
- {
779
- action: (data) => {
780
- return this._prompt.confirm({
781
- title: 'Confirm',
782
- template: 'Are you sure you would like to reset the cron?',
783
- })
784
- .pipe(switchMap(() => {
785
- return this.enable(data);
786
- }), tap(() => {
787
- this._message.success('Reset cron');
788
- this.list.reload();
789
- }), takeUntil(this._destroy$));
790
- },
791
- label: 'Reset',
792
- show: (cron) => {
793
- return cron.state === CronState.Killing || cron.state === CronState.Running || cron.state === CronState.Failed || cron.state === CronState.Queued;
794
- },
795
- },
796
- ];
797
- }
798
- ngOnDestroy() {
799
- this._destroy$.next();
800
- this._destroy$.complete();
801
- }
802
- _configList() {
803
- this.config = {
804
- paging: false,
805
- filters: [
806
- {
807
- type: ItemType.Keyword,
808
- name: 'keyword',
809
- label: 'Search',
810
- },
811
- ],
812
- rowActions: this.getCronActions()
813
- .map((rowAction) => {
814
- return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
815
- rowAction.action(cron)
816
- .subscribe();
817
- } });
818
- }),
819
- fetch: (query) => {
820
- query = Object.assign(Object.assign({}, query), { timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
821
- return this.loadCrons(query)
822
- .pipe(map((crons) => ({
823
- data: crons
824
- .map((cron) => {
825
- return Object.assign(Object.assign({}, cron), { runningDuration: differenceInSeconds(parse(cron.createDate), new Date()) });
826
- }),
827
- })));
828
- },
829
- };
830
- if (this.bulk) {
831
- this.config.selection = {
832
- selectAll: false,
833
- actions: [
834
- {
835
- type: SelectionActionType.Action,
836
- name: 'disable',
837
- label: 'Disable',
838
- },
839
- {
840
- type: SelectionActionType.Action,
841
- name: 'enable',
842
- label: 'Enable',
843
- },
844
- ],
845
- actionSelected: (action) => {
846
- return this.bulk(action.action.name, action.selected)
847
- .pipe(tap(() => {
848
- this.list.reload();
849
- this._message.success('Applied Changes');
850
- }));
851
- },
852
- };
853
- }
854
- }
855
- }
856
- CronsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronsComponent, deps: [{ token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
857
- CronsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n <div *ngIf=\"row.cronSetting\">\n <small>{{row.cronSetting.summary}}</small>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column align=\"center\">\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.host || row.processId; else status\">\n <fs-popover \n [maxWidth]=\"null\"\n [template]=\"statusPopover\" \n [indication]=\"true\"\n size=\"small\">\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\n </fs-popover>\n <ng-template #statusPopover>\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\n <div *ngIf=\"row.processState\">Process State: {{CronProcessStates[row.processState]}}</div>\n </ng-template>\n </ng-container>\n <ng-template #status>\n {{CronStates[row.state]}}\n </ng-template>\n <ng-container *ngIf=\"row.state === CronState.Running\">\n <div class=\"small\">\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-container> \n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Last Ran</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div class=\"small\" *ngIf=\"row.duration\">\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-template>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Next Run</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== CronState.Disabled\">\n <app-next-run [cron]=\"row\"></app-next-run>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Timeout Hours</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.cronSetting.timeout}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: i7.FsPopoverComponent, selector: "fs-popover" }, { kind: "component", type: CronNextRunComponent, selector: "app-next-run", inputs: ["cron"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }] });
858
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CronsComponent, decorators: [{
859
- type: Component,
860
- args: [{ selector: 'fs-system-crons', 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 (click)=\"open(row)\">{{row.name}}</a>\n <div *ngIf=\"row.cronSetting\">\n <small>{{row.cronSetting.summary}}</small>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column align=\"center\">\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.host || row.processId; else status\">\n <fs-popover \n [maxWidth]=\"null\"\n [template]=\"statusPopover\" \n [indication]=\"true\"\n size=\"small\">\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\n </fs-popover>\n <ng-template #statusPopover>\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\n <div *ngIf=\"row.processState\">Process State: {{CronProcessStates[row.processState]}}</div>\n </ng-template>\n </ng-container>\n <ng-template #status>\n {{CronStates[row.state]}}\n </ng-template>\n <ng-container *ngIf=\"row.state === CronState.Running\">\n <div class=\"small\">\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-container> \n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Last Ran</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div class=\"small\" *ngIf=\"row.duration\">\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-template>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Next Run</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== CronState.Disabled\">\n <app-next-run [cron]=\"row\"></app-next-run>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Timeout Hours</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.cronSetting.timeout}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
861
- }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i1.MatDialog }, { type: i3$2.FsPrompt }]; }, propDecorators: { list: [{
862
- type: ViewChild,
863
- args: [FsListComponent, { static: true }]
864
- }], enable: [{
865
- type: Input
866
- }], disable: [{
867
- type: Input
868
- }], kill: [{
869
- type: Input
870
- }], queue: [{
871
- type: Input
872
- }], run: [{
873
- type: Input
874
- }], loadCrons: [{
875
- type: Input
876
- }], loadCron: [{
877
- type: Input
878
- }], loadCronLogs: [{
879
- type: Input
880
- }], bulk: [{
881
- type: Input
882
- }] } });
883
-
884
- class DashboardComponent {
885
- constructor(_message, _cdRef, _buildService) {
886
- this._message = _message;
887
- this._cdRef = _cdRef;
888
- this._buildService = _buildService;
889
- this.buttonActions = [];
890
- this.menuActions = [];
891
- this._destroy$ = new Subject();
892
- this.actions = [];
893
- }
894
- ngOnInit() {
895
- this._load();
896
- this.buttonActions = this.actions.filter(item => { return !item.menu; });
897
- this.menuActions = this.actions.filter(item => { return item.menu; });
898
- this.build = this._buildService.build;
899
- this._buildService.build$
900
- .pipe(takeUntil(this._destroy$))
901
- .subscribe((build) => {
902
- this.build = build;
903
- this._cdRef.markForCheck();
904
- });
905
- }
906
- _load() {
907
- this.load()
908
- .subscribe((dashboard) => {
909
- this.dashboard = dashboard;
910
- this.dashboard.cronRanAttention = !dashboard.cronRan ||
911
- differenceInMinutes(new Date(), new Date(dashboard.cronRan)) > 15;
912
- this._cdRef.markForCheck();
913
- });
914
- }
915
- ngOnDestroy() {
916
- this._destroy$.next();
917
- this._destroy$.complete();
918
- }
919
- actionClick(action) {
920
- action.click();
921
- }
922
- initClick() {
923
- this.init()
924
- .subscribe(() => {
925
- this._message.success('Successfully initialized the system');
926
- });
927
- }
928
- upgradeClick() {
929
- this.upgrade()
930
- .subscribe(() => {
931
- this._load();
932
- this._message.success('Successfully upgraded the system');
933
- });
934
- }
935
- }
936
- DashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardComponent, deps: [{ token: i1$1.FsMessage }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsBuildService }], target: i0.ɵɵFactoryTarget.Component });
937
- DashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardComponent, selector: "fs-system-dashboard", inputs: { init: "init", upgrade: "upgrade", load: "load", actions: "actions" }, ngImport: i0, template: "<div *fsSkeleton=\"dashboard\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <div>\n <h2>Server</h2>\n\n <fs-label-field>\n <fs-label>Date/Time</fs-label>\n {{dashboard.serverTime | fsDateFormat: 'date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Timezone</fs-label>\n {{dashboard.serverTimezone}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Hostname</fs-label>\n {{dashboard.serverHostname}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Directory</fs-label>\n {{dashboard.appDirectory}}\n </fs-label-field>\n </div>\n\n <div>\n <h2>System</h2>\n <fs-label-field>\n <fs-label>Mode</fs-label>\n {{dashboard.appMode}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Notification Recipients</fs-label>\n {{dashboard.notifyRecipients.join(', ')}}\n </fs-label-field>\n </div>\n\n <div>\n <h2>Database</h2>\n\n <fs-label-field>\n <fs-label>Name</fs-label>\n {{dashboard.databaseName}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Date/Time</fs-label>\n {{dashboard.databaseTime | fsDateFormat: 'date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Timezone</fs-label>\n {{dashboard.databaseTimezone}}\n </fs-label-field>\n </div>\n\n <div *ngIf=\"build || dashboard.upgrades.length\">\n <ng-container *ngIf=\"build\">\n <h2>Build</h2>\n <fs-label-field>\n <fs-label>Version</fs-label>\n {{build.version || 'Unknown'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Date</fs-label>\n {{ (build.date | fsDateFormat: 'date-time') || 'Unknown' }}\n </fs-label-field>\n </ng-container>\n\n <fs-label-field *ngIf=\"dashboard.upgrades.length\">\n <fs-label>Pending Upgrades</fs-label>\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': !!dashboard.upgrades.length }\">\n {{dashboard.upgrades.length}}\n <mat-icon\n [matTooltip]=\"dashboard.upgrades.join('\\n')\"\n matTooltipClass=\"tooltip-pending-upgrades\"\n >\n warning\n </mat-icon>\n </span>\n </fs-label-field>\n </div>\n\n <div>\n <h2>Cron</h2>\n\n <fs-label-field>\n <fs-label>Last Ran</fs-label>\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': dashboard.cronRanAttention }\">\n <span *ngIf=\"!dashboard.cronRan\">Never</span>\n <span *ngIf=\"dashboard.cronRan\">{{dashboard.cronRan | fsDateFormat: 'date-time'}}</span>\n <mat-icon>warning</mat-icon>\n </span>\n </fs-label-field>\n </div>\n </div>\n \n\n <div>\n <div class=\"actions\">\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\n <button\n *ngFor=\"let action of buttonActions\"\n mat-raised-button\n (click)=\"actionClick(action)\">\n {{action.label}}\n </button>\n\n <ng-container *ngIf=\"menuActions.length\">\n <fs-menu buttonClass=\"mat-raised-button menu-button\">\n <ng-template\n *ngFor=\"let action of menuActions\"\n fs-menu-item\n (click)=\"actionClick(action)\">\n {{action.label}}\n </ng-template>\n </fs-menu>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .menu-button{box-shadow:none}h2{margin-top:0}.actions{display:flex;align-items:center;flex-wrap:wrap}.actions button,.actions fs-menu{margin-bottom:10px;margin-right:5px}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width: 1000px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9$1.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { kind: "directive", type: i9$1.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { kind: "pipe", type: i4$2.FsDateFormatPipe, name: "fsDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
938
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardComponent, decorators: [{
939
- type: Component,
940
- args: [{ selector: 'fs-system-dashboard', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *fsSkeleton=\"dashboard\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <div>\n <h2>Server</h2>\n\n <fs-label-field>\n <fs-label>Date/Time</fs-label>\n {{dashboard.serverTime | fsDateFormat: 'date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Timezone</fs-label>\n {{dashboard.serverTimezone}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Hostname</fs-label>\n {{dashboard.serverHostname}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Directory</fs-label>\n {{dashboard.appDirectory}}\n </fs-label-field>\n </div>\n\n <div>\n <h2>System</h2>\n <fs-label-field>\n <fs-label>Mode</fs-label>\n {{dashboard.appMode}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Notification Recipients</fs-label>\n {{dashboard.notifyRecipients.join(', ')}}\n </fs-label-field>\n </div>\n\n <div>\n <h2>Database</h2>\n\n <fs-label-field>\n <fs-label>Name</fs-label>\n {{dashboard.databaseName}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Date/Time</fs-label>\n {{dashboard.databaseTime | fsDateFormat: 'date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Timezone</fs-label>\n {{dashboard.databaseTimezone}}\n </fs-label-field>\n </div>\n\n <div *ngIf=\"build || dashboard.upgrades.length\">\n <ng-container *ngIf=\"build\">\n <h2>Build</h2>\n <fs-label-field>\n <fs-label>Version</fs-label>\n {{build.version || 'Unknown'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Date</fs-label>\n {{ (build.date | fsDateFormat: 'date-time') || 'Unknown' }}\n </fs-label-field>\n </ng-container>\n\n <fs-label-field *ngIf=\"dashboard.upgrades.length\">\n <fs-label>Pending Upgrades</fs-label>\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': !!dashboard.upgrades.length }\">\n {{dashboard.upgrades.length}}\n <mat-icon\n [matTooltip]=\"dashboard.upgrades.join('\\n')\"\n matTooltipClass=\"tooltip-pending-upgrades\"\n >\n warning\n </mat-icon>\n </span>\n </fs-label-field>\n </div>\n\n <div>\n <h2>Cron</h2>\n\n <fs-label-field>\n <fs-label>Last Ran</fs-label>\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': dashboard.cronRanAttention }\">\n <span *ngIf=\"!dashboard.cronRan\">Never</span>\n <span *ngIf=\"dashboard.cronRan\">{{dashboard.cronRan | fsDateFormat: 'date-time'}}</span>\n <mat-icon>warning</mat-icon>\n </span>\n </fs-label-field>\n </div>\n </div>\n \n\n <div>\n <div class=\"actions\">\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\n <button\n *ngFor=\"let action of buttonActions\"\n mat-raised-button\n (click)=\"actionClick(action)\">\n {{action.label}}\n </button>\n\n <ng-container *ngIf=\"menuActions.length\">\n <fs-menu buttonClass=\"mat-raised-button menu-button\">\n <ng-template\n *ngFor=\"let action of menuActions\"\n fs-menu-item\n (click)=\"actionClick(action)\">\n {{action.label}}\n </ng-template>\n </fs-menu>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .menu-button{box-shadow:none}h2{margin-top:0}.actions{display:flex;align-items:center;flex-wrap:wrap}.actions button,.actions fs-menu{margin-bottom:10px;margin-right:5px}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width: 1000px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}\n"] }]
941
- }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsBuildService }]; }, propDecorators: { init: [{
942
- type: Input
943
- }], upgrade: [{
944
- type: Input
945
- }], load: [{
946
- type: Input
947
- }], actions: [{
948
- type: Input
949
- }] } });
950
-
951
- class InfoComponent {
952
- ngAfterViewInit() {
953
- this._load();
954
- }
955
- _load() {
956
- this.load()
957
- .subscribe((info) => {
958
- info += '<style>body { background: transparent; }</style>';
959
- const doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentWindow;
960
- doc.open();
961
- doc.write(info);
962
- doc.close();
963
- const scrollHeight = (this.iframe.nativeElement.contentWindow.document.documentElement.scrollHeight + 100);
964
- this.iframe.nativeElement.style.height = `${scrollHeight}px`;
965
- });
966
- }
967
- }
968
- InfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
969
- InfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: InfoComponent, selector: "fs-system-info", inputs: { load: "load" }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0, template: "<iframe #iframe></iframe>\n", styles: ["iframe{width:100%;border:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
970
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InfoComponent, decorators: [{
971
- type: Component,
972
- args: [{ selector: 'fs-system-info', changeDetection: ChangeDetectionStrategy.OnPush, template: "<iframe #iframe></iframe>\n", styles: ["iframe{width:100%;border:0}\n"] }]
973
- }], propDecorators: { iframe: [{
974
- type: ViewChild,
975
- args: ['iframe']
976
- }], load: [{
977
- type: Input
978
- }] } });
979
-
980
- class ProcessComponent {
981
- constructor(data, _message, _cdRef, _prompt) {
982
- this.data = data;
983
- this._message = _message;
984
- this._cdRef = _cdRef;
985
- this._prompt = _prompt;
986
- this.ProcessStates = indexNameValue(ProcessStates);
987
- this.ProcessProcessStates = indexNameValue(ProcessProcessStates);
988
- this.ProcessState = ProcessState;
989
- this._destroy$ = new Subject();
990
- }
991
- ngOnInit() {
992
- if (this.data.loadProcess) {
993
- this.load$()
994
- .subscribe(() => {
995
- this.runningRefresh();
996
- });
997
- }
998
- else {
999
- this.process = this.data.process;
1000
- }
1001
- }
1002
- load$() {
1003
- return this.data
1004
- .loadProcess(this.data.process)
1005
- .pipe(tap((process) => {
1006
- this.process = process;
1007
- this._cdRef.markForCheck();
1008
- }));
1009
- }
1010
- runningRefresh() {
1011
- timer(0, 2000)
1012
- .pipe(takeWhile(() => this.process.state === ProcessState.Running), switchMap(() => this.load$()), takeUntil(this._destroy$))
1013
- .subscribe();
1014
- }
1015
- kill() {
1016
- this._prompt.confirm({
1017
- title: 'Kill process',
1018
- template: 'Are you sure you would like to kill the process?',
1019
- })
1020
- .pipe(switchMap(() => this.data.kill(this.data.process)), switchMap(() => this.load$()))
1021
- .subscribe(() => {
1022
- this._message.success('Killed process');
1023
- });
1024
- }
1025
- run() {
1026
- this._message.success('Running process');
1027
- this.data.run(this.data.process)
1028
- .pipe(switchMap(() => this.load$()))
1029
- .subscribe(() => {
1030
- this.runningRefresh();
1031
- });
1032
- }
1033
- queue() {
1034
- this._message.success('Running process');
1035
- this.data.queue(this.data.process)
1036
- .pipe(switchMap(() => this.load$()))
1037
- .subscribe();
1038
- }
1039
- download() {
1040
- this.data.download(this.data.process);
1041
- }
1042
- ngOnDestroy() {
1043
- this._destroy$.next();
1044
- this._destroy$.complete();
1045
- }
1046
- }
1047
- ProcessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProcessComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
1048
- ProcessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ProcessComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title>Process</div>\n <mat-dialog-content>\n <div class=\"column\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Name\n </fs-label>\n {{process.prettyName}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div class=\"status\" [ngClass]=\"{ 'running': process.state === ProcessState.Running }\">\n {{ProcessStates[process.state]}} \n <ng-container *ngIf=\"process.state === ProcessState.Running\">\n <mat-progress-spinner [diameter]=\"20\" [mode]=\"'indeterminate'\"></mat-progress-spinner>\n </ng-container>\n </div>\n \n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.notify\">\n <fs-label>\n Notification Email\n </fs-label>\n {{process.notify}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{process.pid || 'None'}}\n <ng-container *ngIf=\"process.pid\">\n <div class=\"small\">\n {{ProcessProcessStates[process.processState] || 'Unknown'}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.createDate\">\n <fs-label>\n Create Date\n </fs-label>\n {{ process.createDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.startDate\">\n <fs-label>\n Start Date\n </fs-label>\n {{ process.startDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.endDate\">\n <fs-label>\n Complete Date\n </fs-label>\n {{ process.endDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.duration\">\n <fs-label>\n Duration\n </fs-label>\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"process.message\">\n <fs-label>\n Message\n </fs-label>\n {{process.message}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.log\">\n <fs-label>\n Log\n </fs-label>\n <div class=\"log\">\n {{process.log}}\n </div>\n </fs-label-field>\n\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Close\n </button>\n <button\n *ngIf=\"process.state === ProcessState.Running && data.kill\"\n mat-button\n (click)=\"kill()\">\n Kill\n </button>\n <button \n *ngIf=\"process.state !== ProcessState.Running && data.run\" \n mat-button \n (click)=\"run()\">\n Run\n </button>\n <button \n *ngIf=\"(\n process.state !== ProcessState.Running && \n process.state !== ProcessState.Queued\n ) && data.queue\" \n mat-button \n (click)=\"queue()\">\n Queue\n </button>\n <button\n *ngIf=\"process.filename\"\n mat-button\n (click)=\"download()\">\n Download\n </button> \n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".log{white-space:pre-line;font-family:monospace;font-size:95%;line-height:130%}.status{display:flex}.status.running{margin-right:28px}.status.running mat-progress-spinner{position:absolute;right:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }, { kind: "pipe", type: i4$2.FsDateFormatPipe, name: "fsDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProcessComponent, decorators: [{
1050
- type: Component,
1051
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title>Process</div>\n <mat-dialog-content>\n <div class=\"column\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Name\n </fs-label>\n {{process.prettyName}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div class=\"status\" [ngClass]=\"{ 'running': process.state === ProcessState.Running }\">\n {{ProcessStates[process.state]}} \n <ng-container *ngIf=\"process.state === ProcessState.Running\">\n <mat-progress-spinner [diameter]=\"20\" [mode]=\"'indeterminate'\"></mat-progress-spinner>\n </ng-container>\n </div>\n \n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.notify\">\n <fs-label>\n Notification Email\n </fs-label>\n {{process.notify}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{process.pid || 'None'}}\n <ng-container *ngIf=\"process.pid\">\n <div class=\"small\">\n {{ProcessProcessStates[process.processState] || 'Unknown'}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.createDate\">\n <fs-label>\n Create Date\n </fs-label>\n {{ process.createDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.startDate\">\n <fs-label>\n Start Date\n </fs-label>\n {{ process.startDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.endDate\">\n <fs-label>\n Complete Date\n </fs-label>\n {{ process.endDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.duration\">\n <fs-label>\n Duration\n </fs-label>\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"process.message\">\n <fs-label>\n Message\n </fs-label>\n {{process.message}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"process.log\">\n <fs-label>\n Log\n </fs-label>\n <div class=\"log\">\n {{process.log}}\n </div>\n </fs-label-field>\n\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Close\n </button>\n <button\n *ngIf=\"process.state === ProcessState.Running && data.kill\"\n mat-button\n (click)=\"kill()\">\n Kill\n </button>\n <button \n *ngIf=\"process.state !== ProcessState.Running && data.run\" \n mat-button \n (click)=\"run()\">\n Run\n </button>\n <button \n *ngIf=\"(\n process.state !== ProcessState.Running && \n process.state !== ProcessState.Queued\n ) && data.queue\" \n mat-button \n (click)=\"queue()\">\n Queue\n </button>\n <button\n *ngIf=\"process.filename\"\n mat-button\n (click)=\"download()\">\n Download\n </button> \n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".log{white-space:pre-line;font-family:monospace;font-size:95%;line-height:130%}.status{display:flex}.status.running{margin-right:28px}.status.running mat-progress-spinner{position:absolute;right:0}\n"] }]
1052
- }], ctorParameters: function () {
1053
- return [{ type: undefined, decorators: [{
1054
- type: Inject,
1055
- args: [MAT_DIALOG_DATA]
1056
- }] }, { type: i1$1.FsMessage }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }];
1057
- } });
1058
-
1059
- class ProcessesComponent {
1060
- constructor(_dialog, _message) {
1061
- this._dialog = _dialog;
1062
- this._message = _message;
1063
- this.actions = [];
1064
- this.config = null;
1065
- this.ProcessStates = indexNameValue(ProcessStates);
1066
- this.ProcessState = ProcessState;
1067
- this._destroy$ = new Subject();
1068
- }
1069
- ngOnInit() {
1070
- this._configList();
1071
- }
1072
- reload() {
1073
- this.list.reload();
1074
- }
1075
- open(process) {
1076
- this._dialog.open(ProcessComponent, {
1077
- data: {
1078
- process,
1079
- download: this.download,
1080
- run: this.run,
1081
- loadProcess: this.loadProcess,
1082
- queue: this.queue,
1083
- kill: this.kill,
1084
- },
1085
- width: '85%',
1086
- })
1087
- .afterClosed()
1088
- .pipe(takeUntil(this._destroy$))
1089
- .subscribe(() => {
1090
- this.reload();
1091
- });
1092
- }
1093
- ngOnDestroy() {
1094
- this._destroy$.next();
1095
- this._destroy$.complete();
1096
- }
1097
- _configList() {
1098
- this.config = {
1099
- actions: [],
1100
- rowActions: [],
1101
- filters: [
1102
- {
1103
- type: ItemType.Keyword,
1104
- name: 'keyword',
1105
- label: 'Search',
1106
- },
1107
- {
1108
- type: ItemType.Select,
1109
- name: 'state',
1110
- label: 'Status',
1111
- values: ProcessStates,
1112
- },
1113
- ],
1114
- fetch: (query) => {
1115
- return this.loadProcesses(query)
1116
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1117
- },
1118
- };
1119
- if (this.run) {
1120
- this.config.rowActions
1121
- .push({
1122
- label: 'Run',
1123
- show: (process) => {
1124
- return process.state !== ProcessState.Running;
1125
- },
1126
- click: (data) => {
1127
- this._message.info('Running process...');
1128
- this.run(data)
1129
- .subscribe(() => {
1130
- this.reload();
1131
- this._message.success('Succesfully ran process');
1132
- });
1133
- setTimeout(() => {
1134
- this.reload();
1135
- }, 500);
1136
- },
1137
- });
1138
- }
1139
- if (this.kill) {
1140
- this.config.rowActions.push({
1141
- label: 'Kill',
1142
- show: (data) => {
1143
- return !!data.pid;
1144
- },
1145
- click: (data) => {
1146
- this._message.info('Killing process...');
1147
- this.kill(data)
1148
- .subscribe(() => {
1149
- this.reload();
1150
- this._message.success('Succesfully killed process');
1151
- });
1152
- setTimeout(() => {
1153
- this.reload();
1154
- }, 500);
1155
- },
1156
- });
1157
- }
1158
- if (this.delete) {
1159
- this.config.rowActions.push({
1160
- label: 'Delete',
1161
- click: (data) => {
1162
- this.delete(data)
1163
- .subscribe(() => {
1164
- this.reload();
1165
- this._message.success('Deleted process');
1166
- });
1167
- },
1168
- });
1169
- }
1170
- this.actions.forEach((action) => {
1171
- this.config.actions.push({
1172
- primary: false,
1173
- label: action.label,
1174
- menu: action.menu,
1175
- click: (data) => {
1176
- if (action.click) {
1177
- action.click(data);
1178
- }
1179
- if (action.component) {
1180
- this._dialog.open(action.component, {
1181
- width: '800px',
1182
- })
1183
- .afterClosed()
1184
- .pipe(takeUntil(this._destroy$))
1185
- .subscribe(() => {
1186
- this.reload();
1187
- });
1188
- }
1189
- },
1190
- });
1191
- });
1192
- }
1193
- }
1194
- ProcessesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProcessesComponent, deps: [{ token: i1.MatDialog }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1195
- ProcessesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ProcessesComponent, selector: "fs-system-processes", inputs: { loadProcesses: "loadProcesses", loadProcess: "loadProcess", run: "run", kill: "kill", delete: "delete", download: "download", queue: "queue", actions: "actions" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: 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 (click)=\"open(row)\">{{row.prettyName}}</a>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ProcessStates[row.state]}}\n <small>\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\n </small>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Duration</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </ng-template>\n </fs-list-column>\n\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\n <fs-list-column>\n <ng-template fs-list-header>Completed</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProcessesComponent, decorators: [{
1197
- type: Component,
1198
- args: [{ selector: 'fs-system-processes', changeDetection: ChangeDetectionStrategy.OnPush, 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 (click)=\"open(row)\">{{row.prettyName}}</a>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ProcessStates[row.state]}}\n <small>\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\n </small>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Duration</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </ng-template>\n </fs-list-column>\n\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\n <fs-list-column>\n <ng-template fs-list-header>Completed</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
1199
- }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
1200
- type: ViewChild,
1201
- args: [FsListComponent]
1202
- }], loadProcesses: [{
1203
- type: Input
1204
- }], loadProcess: [{
1205
- type: Input
1206
- }], run: [{
1207
- type: Input
1208
- }], kill: [{
1209
- type: Input
1210
- }], delete: [{
1211
- type: Input
1212
- }], download: [{
1213
- type: Input
1214
- }], queue: [{
1215
- type: Input
1216
- }], actions: [{
1217
- type: Input
1218
- }] } });
1219
-
1220
- class ServerLogComponent {
1221
- constructor(data) {
1222
- this.data = data;
1223
- }
1224
- ngOnInit() {
1225
- if (this.data.log) {
1226
- this.log = this.data.log;
1227
- try {
1228
- this.log.backtrace = JSON.parse(this.log.backtrace);
1229
- }
1230
- catch (e) { }
1231
- try {
1232
- this.log.server = JSON.parse(this.log.server);
1233
- }
1234
- catch (e) { }
1235
- }
1236
- }
1237
- }
1238
- ServerLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ServerLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1239
- ServerLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ServerLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"log\">\n <div mat-dialog-title>Log</div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Error Type\n </fs-label>\n {{log.type}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n {{log.message}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"log.url\">\n <fs-label>\n URL\n </fs-label>\n {{log.url}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{log.createDate|fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n \n <fs-label-field>\n <fs-label>\n File\n </fs-label>\n {{log.file}} @ {{log.line}}\n </fs-label-field>\n </div>\n <fs-label-field>\n <fs-label>\n $_SERVER\n </fs-label>\n <pre>{{log.server|json}}</pre>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Backtrace\n </fs-label>\n <pre>{{log.backtrace|json}}</pre>\n </fs-label-field>\n\n\n </mat-dialog-content>\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: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i2.JsonPipe, name: "json" }, { kind: "pipe", type: i4$2.FsDateFormatPipe, name: "fsDateFormat" }] });
1240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ServerLogComponent, decorators: [{
1241
- type: Component,
1242
- args: [{ template: "<fs-dialog *fsSkeleton=\"log\">\n <div mat-dialog-title>Log</div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Error Type\n </fs-label>\n {{log.type}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n {{log.message}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"log.url\">\n <fs-label>\n URL\n </fs-label>\n {{log.url}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{log.createDate|fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n \n <fs-label-field>\n <fs-label>\n File\n </fs-label>\n {{log.file}} @ {{log.line}}\n </fs-label-field>\n </div>\n <fs-label-field>\n <fs-label>\n $_SERVER\n </fs-label>\n <pre>{{log.server|json}}</pre>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Backtrace\n </fs-label>\n <pre>{{log.backtrace|json}}</pre>\n </fs-label-field>\n\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n" }]
1243
- }], ctorParameters: function () {
1244
- return [{ type: undefined, decorators: [{
1245
- type: Inject,
1246
- args: [MAT_DIALOG_DATA]
1247
- }] }];
1248
- } });
1249
-
1250
- class ServerLogsComponent {
1251
- constructor(_dialog) {
1252
- this._dialog = _dialog;
1253
- this.config = null;
1254
- this.logTypes = [];
1255
- }
1256
- ngOnInit() {
1257
- this._configList();
1258
- }
1259
- _configList() {
1260
- this.config = {
1261
- filters: [
1262
- {
1263
- type: ItemType.Keyword,
1264
- name: 'keyword',
1265
- label: 'Search'
1266
- }
1267
- ],
1268
- fetch: query => {
1269
- return this.loadLogs(query)
1270
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1271
- }
1272
- };
1273
- }
1274
- open(log) {
1275
- this._dialog.open(ServerLogComponent, {
1276
- data: { log: log },
1277
- width: '85%'
1278
- });
1279
- }
1280
- }
1281
- ServerLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ServerLogsComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1282
- ServerLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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\">\n <fs-list-column>\n <ng-template fs-list-header>Message</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.message}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Type</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.type}}\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 </ng-template>\n </fs-list-column>\n </fs-list>\n", styles: [""], dependencies: [{ kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }] });
1283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ServerLogsComponent, decorators: [{
1284
- type: Component,
1285
- args: [{ selector: 'fs-system-server-logs', template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Message</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.message}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Type</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.type}}\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 </ng-template>\n </fs-list-column>\n </fs-list>\n" }]
1286
- }], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { list: [{
1287
- type: ViewChild,
1288
- args: ['list', { static: true }]
1289
- }], loadLogs: [{
1290
- type: Input
1291
- }] } });
1292
-
1293
- class KeyNameValuePipe {
1294
- transform(values) {
1295
- return Object.keys(values).map((key) => {
1296
- return { value: key, name: values[key] };
1297
- });
1298
- }
1299
- }
1300
- KeyNameValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: KeyNameValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1301
- KeyNameValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: KeyNameValuePipe, name: "keyNameValue" });
1302
- KeyNameValuePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: KeyNameValuePipe });
1303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: KeyNameValuePipe, decorators: [{
1304
- type: Pipe,
1305
- args: [{
1306
- name: 'keyNameValue',
1307
- }]
1308
- }, {
1309
- type: Injectable
1310
- }] });
1311
-
1312
- class SettingsComponent {
1313
- constructor(_message, _clipboard, _prompt, _cdRef) {
1314
- this._message = _message;
1315
- this._clipboard = _clipboard;
1316
- this._prompt = _prompt;
1317
- this._cdRef = _cdRef;
1318
- this.fileRemove = new EventEmitter();
1319
- this.fileSelect = new EventEmitter();
1320
- this.groupedSettings = [];
1321
- this.groups = [];
1322
- this.SettingInterfaceType = SettingInterfaceType;
1323
- }
1324
- ngOnInit() {
1325
- this.loadSettings({
1326
- visible: true,
1327
- })
1328
- .subscribe((settings) => {
1329
- settings = settings
1330
- .filter((setting) => {
1331
- return setting.interfaceType !== SettingInterfaceType.None;
1332
- })
1333
- .map((setting) => {
1334
- switch (setting.interfaceType) {
1335
- case SettingInterfaceType.Date:
1336
- case SettingInterfaceType.Time:
1337
- return Object.assign(Object.assign({}, setting), { value: parse(setting.value) });
1338
- case SettingInterfaceType.SelectMultiple:
1339
- return Object.assign(Object.assign({}, setting), { value: Array.isArray(setting.value) ? setting.value : [] });
1340
- }
1341
- return setting;
1342
- });
1343
- this.groupedSettings = settings.reduce((accum, item) => {
1344
- if (accum[item.group] === undefined) {
1345
- accum[item.group] = [];
1346
- }
1347
- accum[item.group].push(item);
1348
- return accum;
1349
- }, {});
1350
- this.groups = Object.keys(this.groupedSettings);
1351
- this._cdRef.markForCheck();
1352
- });
1353
- }
1354
- export(event, settings) {
1355
- event.stopPropagation();
1356
- const data = settings.map((setting) => {
1357
- return {
1358
- name: setting.name,
1359
- value: setting.value,
1360
- group: setting.group,
1361
- };
1362
- });
1363
- this._clipboard.copy(JSON.stringify(data));
1364
- this._message.success('Copied to clipboard');
1365
- }
1366
- import(event, group) {
1367
- event.stopPropagation();
1368
- this._prompt.input({
1369
- label: 'JSON Import',
1370
- title: 'Import Settings',
1371
- commitLabel: 'Import',
1372
- required: true,
1373
- }).subscribe((value) => {
1374
- if (value) {
1375
- try {
1376
- const settings = this.groupedSettings[group];
1377
- const data = JSON.parse(value);
1378
- data.forEach((item) => {
1379
- const setting = settings.find((s) => {
1380
- return item.name === s.name;
1381
- });
1382
- if (setting) {
1383
- Object.assign(setting, item);
1384
- }
1385
- });
1386
- this._cdRef.markForCheck();
1387
- }
1388
- catch (e) {
1389
- this._message.error(e);
1390
- }
1391
- }
1392
- });
1393
- }
1394
- saveGroup(group) {
1395
- const settings = this.groupedSettings[group];
1396
- const values = settings.reduce((result, value) => {
1397
- return (result[value.name] = value.value, result);
1398
- }, {});
1399
- this.save(group, values)
1400
- .subscribe(() => {
1401
- this._message.success('Changes Saved');
1402
- });
1403
- }
1404
- }
1405
- SettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SettingsComponent, deps: [{ token: i1$1.FsMessage }, { token: i2$1.FsClipboard }, { token: i3$2.FsPrompt }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1406
- SettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SettingsComponent, selector: "fs-system-settings", inputs: { loadSettings: "loadSettings", save: "save" }, outputs: { fileRemove: "fileRemove", fileSelect: "fileSelect" }, ngImport: i0, template: "\n<mat-accordion>\n <mat-expansion-panel hideToggle *ngFor=\"let group of groups\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <div class=\"title-row\">\n <div class=\"title\">{{group || 'General'}}</div>\n <div class=\"actions\">\n <button\n type=\"button\"\n [matTooltip]=\"'Export ' + (group || 'General') + ' Settings'\"\n mat-icon-button\n (click)=\"export($event, groupedSettings[group])\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n <button\n type=\"button\"\n [matTooltip]=\"'Import ' + (group || 'General') + ' Settings'\"\n mat-icon-button\n (click)=\"import($event, group)\">\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </div>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div \n hideToggle \n *ngFor=\"let setting of groupedSettings[group]\" \n class=\"setting\"\n [ngClass]=\"{ 'has-instruction': !! setting.instruction }\">\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\"\n *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\n <mat-label>{{setting.label}}</mat-label>\n <textarea\n matInput\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n </textarea>\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Select || setting.interfaceType===SettingInterfaceType.SelectMultiple\">\n <mat-label>{{setting.label}}</mat-label>\n <mat-select\n [(ngModel)]=\"setting.value\"\n [multiple]=\"setting.interfaceType===SettingInterfaceType.SelectMultiple\"\n [name]=\"'setting' + setting.id\">\n <mat-option *ngFor=\"let item of setting.values | keyNameValue\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsDatePicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Color\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsColorPicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsTimePicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <fs-file-picker\n *ngIf=\"setting.interfaceType===SettingInterfaceType.File\"\n [allowRemove]=\"true\"\n [allowDownload]=\"true\"\n (select)=\"fileSelect.emit({ setting: setting, file: $event.file })\"\n (remove)=\"fileRemove.emit(setting)\"\n [url]=\"setting.value\">\n <div fsFileLabel>{{setting.label}}</div>\n <div fsFileHint>{{setting.instruction}}</div>\n </fs-file-picker>\n </div>\n\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"saveGroup(group)\">Save</button>\n\n </mat-expansion-panel>\n\n</mat-accordion>\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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i7$2.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i7$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i7$2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i7$2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i10$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i11.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"] }, { kind: "component", type: i12.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i13.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i14.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"] }, { kind: "directive", type: i14.FsFileLabelDirective, selector: "[fsFileLabel]" }, { kind: "component", type: i15.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes", "weekStartsOn"], outputs: ["change"] }, { kind: "component", type: i15.FsTimePickerComponent, selector: "[fsTimePicker]", inputs: ["view"] }, { kind: "component", type: i16.FsColorPickerComponent, selector: "[fsColorPicker]", inputs: ["showClear"] }, { kind: "pipe", type: KeyNameValuePipe, name: "keyNameValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SettingsComponent, decorators: [{
1408
- type: Component,
1409
- args: [{ selector: 'fs-system-settings', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n<mat-accordion>\n <mat-expansion-panel hideToggle *ngFor=\"let group of groups\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <div class=\"title-row\">\n <div class=\"title\">{{group || 'General'}}</div>\n <div class=\"actions\">\n <button\n type=\"button\"\n [matTooltip]=\"'Export ' + (group || 'General') + ' Settings'\"\n mat-icon-button\n (click)=\"export($event, groupedSettings[group])\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n <button\n type=\"button\"\n [matTooltip]=\"'Import ' + (group || 'General') + ' Settings'\"\n mat-icon-button\n (click)=\"import($event, group)\">\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </div>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div \n hideToggle \n *ngFor=\"let setting of groupedSettings[group]\" \n class=\"setting\"\n [ngClass]=\"{ 'has-instruction': !! setting.instruction }\">\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\"\n *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\n <mat-label>{{setting.label}}</mat-label>\n <textarea\n matInput\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n </textarea>\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Select || setting.interfaceType===SettingInterfaceType.SelectMultiple\">\n <mat-label>{{setting.label}}</mat-label>\n <mat-select\n [(ngModel)]=\"setting.value\"\n [multiple]=\"setting.interfaceType===SettingInterfaceType.SelectMultiple\"\n [name]=\"'setting' + setting.id\">\n <mat-option *ngFor=\"let item of setting.values | keyNameValue\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsDatePicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Color\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsColorPicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field \n class=\"full-width form-field-multiline-subscript\" \n *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\n <mat-label>{{setting.label}}</mat-label>\n <input\n matInput\n fsTimePicker\n [(ngModel)]=\"setting.value\"\n [name]=\"'setting' + setting.id\">\n <mat-hint>{{setting.instruction}}</mat-hint>\n </mat-form-field>\n\n <fs-file-picker\n *ngIf=\"setting.interfaceType===SettingInterfaceType.File\"\n [allowRemove]=\"true\"\n [allowDownload]=\"true\"\n (select)=\"fileSelect.emit({ setting: setting, file: $event.file })\"\n (remove)=\"fileRemove.emit(setting)\"\n [url]=\"setting.value\">\n <div fsFileLabel>{{setting.label}}</div>\n <div fsFileHint>{{setting.instruction}}</div>\n </fs-file-picker>\n </div>\n\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"saveGroup(group)\">Save</button>\n\n </mat-expansion-panel>\n\n</mat-accordion>\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"] }]
1410
- }], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i2$1.FsClipboard }, { type: i3$2.FsPrompt }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loadSettings: [{
1411
- type: Input
1412
- }], save: [{
1413
- type: Input
1414
- }], fileRemove: [{
1415
- type: Output
1416
- }], fileSelect: [{
1417
- type: Output
1418
- }] } });
1419
-
1420
- class UpgradeLogsComponent {
1421
- constructor() {
1422
- this.config = null;
1423
- this.logTypes = [];
1424
- }
1425
- ngOnInit() {
1426
- this._configList();
1427
- }
1428
- _configList() {
1429
- this.config = {
1430
- paging: false,
1431
- filters: [
1432
- {
1433
- type: ItemType.Keyword,
1434
- name: 'keyword',
1435
- label: 'Search'
1436
- }
1437
- ],
1438
- fetch: query => {
1439
- return this.loadUpgradeLogs(query)
1440
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1441
- }
1442
- };
1443
- }
1444
- }
1445
- UpgradeLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeLogsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1446
- UpgradeLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Function</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.function}}()\n </ng-template>\n </fs-list-column>\n\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 </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], dependencies: [{ kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }] });
1447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeLogsComponent, decorators: [{
1448
- type: Component,
1449
- args: [{ selector: 'fs-system-upgrade-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 {{row.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Function</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.function}}()\n </ng-template>\n </fs-list-column>\n\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 </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
1450
- }], propDecorators: { list: [{
1451
- type: ViewChild,
1452
- args: [FsListComponent, { static: true }]
1453
- }], loadUpgradeLogs: [{
1454
- type: Input
1455
- }] } });
1456
-
1457
- const FS_SYSTEM_CONFIG = new InjectionToken('fs-system-config');
1458
-
1459
- class FsSystemModule {
1460
- static forRoot(config) {
1461
- return {
1462
- ngModule: FsSystemModule,
1463
- providers: [
1464
- { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1465
- ],
1466
- };
1467
- }
1468
- }
1469
- FsSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1470
- FsSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsSystemModule, declarations: [DashboardComponent,
1471
- CronNextRunComponent,
1472
- CronsComponent,
1473
- SettingsComponent,
1474
- KeyNameValuePipe,
1475
- ProcessesComponent,
1476
- ServerLogComponent,
1477
- ServerLogsComponent,
1478
- UpgradeLogsComponent,
1479
- ApiLogsComponent,
1480
- ApiLogComponent,
1481
- InfoComponent,
1482
- ProcessComponent,
1483
- CronComponent,
1484
- CronLogComponent], imports: [CommonModule,
1485
- FormsModule,
1486
- MatButtonModule,
1487
- MatExpansionModule,
1488
- MatTooltipModule,
1489
- MatIconModule,
1490
- MatFormFieldModule,
1491
- MatInputModule,
1492
- MatSelectModule,
1493
- MatDialogModule,
1494
- MatProgressSpinnerModule,
1495
- MatTabsModule,
1496
- FsDateModule,
1497
- FsSkeletonModule,
1498
- FsListModule,
1499
- FsFileModule,
1500
- FsFileManagerModule,
1501
- FsLabelModule,
1502
- FsDialogModule,
1503
- FsDatePickerModule,
1504
- FsMenuModule,
1505
- FsPopoverModule,
1506
- FsColorPickerModule], exports: [DashboardComponent,
1507
- CronsComponent,
1508
- SettingsComponent,
1509
- ProcessesComponent,
1510
- ServerLogsComponent,
1511
- UpgradeLogsComponent,
1512
- ApiLogsComponent,
1513
- InfoComponent] });
1514
- FsSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsSystemModule, imports: [CommonModule,
1515
- FormsModule,
1516
- MatButtonModule,
1517
- MatExpansionModule,
1518
- MatTooltipModule,
1519
- MatIconModule,
1520
- MatFormFieldModule,
1521
- MatInputModule,
1522
- MatSelectModule,
1523
- MatDialogModule,
1524
- MatProgressSpinnerModule,
1525
- MatTabsModule,
1526
- FsDateModule,
1527
- FsSkeletonModule,
1528
- FsListModule,
1529
- FsFileModule,
1530
- FsFileManagerModule,
1531
- FsLabelModule,
1532
- FsDialogModule,
1533
- FsDatePickerModule,
1534
- FsMenuModule,
1535
- FsPopoverModule,
1536
- FsColorPickerModule] });
1537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsSystemModule, decorators: [{
1538
- type: NgModule,
1539
- args: [{
1540
- imports: [
1541
- CommonModule,
1542
- FormsModule,
1543
- MatButtonModule,
1544
- MatExpansionModule,
1545
- MatTooltipModule,
1546
- MatIconModule,
1547
- MatFormFieldModule,
1548
- MatInputModule,
1549
- MatSelectModule,
1550
- MatDialogModule,
1551
- MatProgressSpinnerModule,
1552
- MatTabsModule,
1553
- FsDateModule,
1554
- FsSkeletonModule,
1555
- FsListModule,
1556
- FsFileModule,
1557
- FsFileManagerModule,
1558
- FsLabelModule,
1559
- FsDialogModule,
1560
- FsDatePickerModule,
1561
- FsMenuModule,
1562
- FsPopoverModule,
1563
- FsColorPickerModule,
1564
- ],
1565
- exports: [
1566
- DashboardComponent,
1567
- CronsComponent,
1568
- SettingsComponent,
1569
- ProcessesComponent,
1570
- ServerLogsComponent,
1571
- UpgradeLogsComponent,
1572
- ApiLogsComponent,
1573
- InfoComponent,
1574
- ],
1575
- declarations: [
1576
- DashboardComponent,
1577
- CronNextRunComponent,
1578
- CronsComponent,
1579
- SettingsComponent,
1580
- KeyNameValuePipe,
1581
- ProcessesComponent,
1582
- ServerLogComponent,
1583
- ServerLogsComponent,
1584
- UpgradeLogsComponent,
1585
- ApiLogsComponent,
1586
- ApiLogComponent,
1587
- InfoComponent,
1588
- ProcessComponent,
1589
- CronComponent,
1590
- CronLogComponent,
1591
- ],
1592
- }]
1593
- }] });
1594
-
1595
- /**
1596
- * Generated bundle index. Do not edit.
1597
- */
1598
-
1599
- 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 };
1600
- //# sourceMappingURL=firestitch-system.mjs.map