@firestitch/system 9.2.0 → 12.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 (149) hide show
  1. package/app/components/api-log/api-log.component.d.ts +13 -10
  2. package/app/components/api-log/index.d.ts +1 -0
  3. package/app/components/api-logs/api-logs.component.d.ts +23 -18
  4. package/app/components/api-logs/index.d.ts +1 -0
  5. package/app/components/cron/cron.component.d.ts +24 -21
  6. package/app/components/cron/index.d.ts +1 -1
  7. package/app/components/cron-log/cron-log.component.d.ts +12 -9
  8. package/app/components/cron-log/index.d.ts +1 -1
  9. package/app/components/crons/crons.component.d.ts +38 -33
  10. package/app/components/crons/index.d.ts +1 -0
  11. package/app/components/dashboard/dashboard.component.d.ts +30 -25
  12. package/app/components/dashboard/index.d.ts +1 -0
  13. package/app/components/file-manager/file-manager.component.d.ts +17 -14
  14. package/app/components/file-manager/index.d.ts +1 -0
  15. package/app/components/info/index.d.ts +1 -0
  16. package/app/components/info/info.component.d.ts +11 -8
  17. package/app/components/process/index.d.ts +1 -0
  18. package/app/components/process/process.component.d.ts +16 -13
  19. package/app/components/processes/index.d.ts +1 -0
  20. package/app/components/processes/processes.component.d.ts +36 -31
  21. package/app/components/server-log/index.d.ts +1 -0
  22. package/app/components/server-log/server-log.component.d.ts +10 -7
  23. package/app/components/server-logs/index.d.ts +1 -0
  24. package/app/components/server-logs/server-logs.component.d.ts +23 -18
  25. package/app/components/settings/index.d.ts +1 -0
  26. package/app/components/settings/settings.component.d.ts +32 -27
  27. package/app/components/upgrade-logs/index.d.ts +1 -0
  28. package/app/components/upgrade-logs/upgrade-logs.component.d.ts +20 -14
  29. package/app/consts/api-log-states.const.d.ts +5 -5
  30. package/app/consts/cron-log-states.const.d.ts +6 -6
  31. package/app/consts/cron-states.const.d.ts +5 -5
  32. package/app/consts/index.d.ts +3 -3
  33. package/app/consts/process-states.const.d.ts +5 -5
  34. package/app/enums/api-log-state.enum.d.ts +5 -5
  35. package/app/enums/cron-log-state.enum.d.ts +13 -13
  36. package/app/enums/cron-state.enum.d.ts +7 -7
  37. package/app/enums/index.d.ts +5 -5
  38. package/app/enums/process-state.enum.d.ts +8 -8
  39. package/app/enums/setting-interface-type.enum.d.ts +11 -12
  40. package/app/fs-system.module.d.ts +46 -5
  41. package/app/helpers/index-name-value.d.ts +1 -1
  42. package/app/injectors/system-config.injector.d.ts +2 -2
  43. package/app/interfaces/dashboard-action.d.ts +5 -5
  44. package/app/interfaces/index.d.ts +3 -3
  45. package/app/interfaces/process-action.d.ts +6 -6
  46. package/app/interfaces/system-config.d.ts +3 -2
  47. package/app/pipes/key-name-value.pipe.d.ts +8 -4
  48. package/app/services/index.d.ts +1 -0
  49. package/app/services/system.service.d.ts +10 -0
  50. package/bundles/firestitch-system.umd.js +1625 -1425
  51. package/bundles/firestitch-system.umd.js.map +1 -1
  52. package/esm2015/app/components/api-log/api-log.component.js +38 -31
  53. package/esm2015/app/components/api-log/index.js +2 -0
  54. package/esm2015/app/components/api-logs/api-logs.component.js +75 -73
  55. package/esm2015/app/components/api-logs/index.js +2 -0
  56. package/esm2015/app/components/cron/cron.component.js +103 -96
  57. package/esm2015/app/components/cron/index.js +2 -2
  58. package/esm2015/app/components/cron-log/cron-log.component.js +41 -33
  59. package/esm2015/app/components/cron-log/index.js +2 -2
  60. package/esm2015/app/components/crons/crons.component.js +191 -206
  61. package/esm2015/app/components/crons/index.js +2 -0
  62. package/esm2015/app/components/dashboard/dashboard.component.js +94 -93
  63. package/esm2015/app/components/dashboard/index.js +2 -0
  64. package/esm2015/app/components/file-manager/file-manager.component.js +54 -64
  65. package/esm2015/app/components/file-manager/index.js +2 -0
  66. package/esm2015/app/components/info/index.js +2 -0
  67. package/esm2015/app/components/info/info.component.js +36 -37
  68. package/esm2015/app/components/process/index.js +2 -0
  69. package/esm2015/app/components/process/process.component.js +49 -42
  70. package/esm2015/app/components/processes/index.js +2 -0
  71. package/esm2015/app/components/processes/processes.component.js +167 -178
  72. package/esm2015/app/components/server-log/index.js +2 -0
  73. package/esm2015/app/components/server-log/server-log.component.js +42 -34
  74. package/esm2015/app/components/server-logs/index.js +2 -0
  75. package/esm2015/app/components/server-logs/server-logs.component.js +60 -59
  76. package/esm2015/app/components/settings/index.js +2 -0
  77. package/esm2015/app/components/settings/settings.component.js +130 -128
  78. package/esm2015/app/components/upgrade-logs/index.js +2 -0
  79. package/esm2015/app/components/upgrade-logs/upgrade-logs.component.js +51 -47
  80. package/esm2015/app/consts/api-log-states.const.js +7 -7
  81. package/esm2015/app/consts/cron-log-states.const.js +15 -15
  82. package/esm2015/app/consts/cron-states.const.js +9 -9
  83. package/esm2015/app/consts/index.js +4 -4
  84. package/esm2015/app/consts/process-states.const.js +10 -10
  85. package/esm2015/app/enums/api-log-state.enum.js +7 -7
  86. package/esm2015/app/enums/cron-log-state.enum.js +15 -15
  87. package/esm2015/app/enums/cron-state.enum.js +9 -9
  88. package/esm2015/app/enums/index.js +6 -6
  89. package/esm2015/app/enums/process-state.enum.js +10 -10
  90. package/esm2015/app/enums/setting-interface-type.enum.js +13 -14
  91. package/esm2015/app/fs-system.module.js +183 -109
  92. package/esm2015/app/helpers/index-name-value.js +8 -8
  93. package/esm2015/app/injectors/system-config.injector.js +3 -3
  94. package/esm2015/app/interfaces/dashboard-action.js +2 -1
  95. package/esm2015/app/interfaces/index.js +4 -1
  96. package/esm2015/app/interfaces/process-action.js +2 -1
  97. package/esm2015/app/interfaces/system-config.js +2 -1
  98. package/esm2015/app/pipes/key-name-value.pipe.js +21 -17
  99. package/esm2015/app/services/index.js +2 -0
  100. package/esm2015/app/services/system.service.js +42 -0
  101. package/esm2015/firestitch-system.js +5 -20
  102. package/esm2015/public_api.js +20 -5
  103. package/fesm2015/firestitch-system.js +1234 -1174
  104. package/fesm2015/firestitch-system.js.map +1 -1
  105. package/firestitch-system.d.ts +5 -19
  106. package/package.json +5 -9
  107. package/public_api.d.ts +20 -5
  108. package/bundles/firestitch-system.umd.min.js +0 -16
  109. package/bundles/firestitch-system.umd.min.js.map +0 -1
  110. package/esm5/app/components/api-log/api-log.component.js +0 -32
  111. package/esm5/app/components/api-logs/api-logs.component.js +0 -75
  112. package/esm5/app/components/cron/cron.component.js +0 -98
  113. package/esm5/app/components/cron/index.js +0 -2
  114. package/esm5/app/components/cron-log/cron-log.component.js +0 -34
  115. package/esm5/app/components/cron-log/index.js +0 -2
  116. package/esm5/app/components/crons/crons.component.js +0 -209
  117. package/esm5/app/components/dashboard/dashboard.component.js +0 -98
  118. package/esm5/app/components/file-manager/file-manager.component.js +0 -67
  119. package/esm5/app/components/info/info.component.js +0 -41
  120. package/esm5/app/components/process/process.component.js +0 -44
  121. package/esm5/app/components/processes/processes.component.js +0 -180
  122. package/esm5/app/components/server-log/server-log.component.js +0 -35
  123. package/esm5/app/components/server-logs/server-logs.component.js +0 -61
  124. package/esm5/app/components/settings/settings.component.js +0 -132
  125. package/esm5/app/components/upgrade-logs/upgrade-logs.component.js +0 -49
  126. package/esm5/app/consts/api-log-states.const.js +0 -7
  127. package/esm5/app/consts/cron-log-states.const.js +0 -15
  128. package/esm5/app/consts/cron-states.const.js +0 -9
  129. package/esm5/app/consts/index.js +0 -4
  130. package/esm5/app/consts/process-states.const.js +0 -10
  131. package/esm5/app/enums/api-log-state.enum.js +0 -7
  132. package/esm5/app/enums/cron-log-state.enum.js +0 -15
  133. package/esm5/app/enums/cron-state.enum.js +0 -9
  134. package/esm5/app/enums/index.js +0 -6
  135. package/esm5/app/enums/process-state.enum.js +0 -10
  136. package/esm5/app/enums/setting-interface-type.enum.js +0 -14
  137. package/esm5/app/fs-system.module.js +0 -113
  138. package/esm5/app/helpers/index-name-value.js +0 -8
  139. package/esm5/app/injectors/system-config.injector.js +0 -3
  140. package/esm5/app/interfaces/dashboard-action.js +0 -1
  141. package/esm5/app/interfaces/index.js +0 -1
  142. package/esm5/app/interfaces/process-action.js +0 -1
  143. package/esm5/app/interfaces/system-config.js +0 -1
  144. package/esm5/app/pipes/key-name-value.pipe.js +0 -20
  145. package/esm5/firestitch-system.js +0 -20
  146. package/esm5/public_api.js +0 -5
  147. package/fesm5/firestitch-system.js +0 -1281
  148. package/fesm5/firestitch-system.js.map +0 -1
  149. package/firestitch-system.metadata.json +0 -1
@@ -1,1240 +1,1300 @@
1
- import { __decorate, __metadata, __param } from 'tslib';
2
- import { InjectionToken, ChangeDetectorRef, Input, Component, ChangeDetectionStrategy, Inject, ViewChild, EventEmitter, Output, Pipe, Injectable, ElementRef, NgModule } from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Inject, Component, ChangeDetectionStrategy, Input, ViewChild, Pipe, EventEmitter, Output, NgModule } from '@angular/core';
3
+ import * as _snakecaseKeys from 'snakecase-keys';
4
+ import * as _camelcaseKeys from 'camelcase-keys';
5
+ import { isArray, groupBy, reduce } from 'lodash-es';
6
+ import * as i7$1 from '@angular/common';
3
7
  import { CommonModule } from '@angular/common';
8
+ import * as i16 from '@angular/forms';
4
9
  import { FormsModule } from '@angular/forms';
10
+ import * as i8 from '@angular/material/form-field';
5
11
  import { MatFormFieldModule } from '@angular/material/form-field';
12
+ import * as i5$3 from '@angular/material/expansion';
6
13
  import { MatExpansionModule } from '@angular/material/expansion';
14
+ import * as i15 from '@angular/material/input';
7
15
  import { MatInputModule } from '@angular/material/input';
16
+ import * as i9 from '@angular/material/select';
8
17
  import { MatSelectModule } from '@angular/material/select';
9
- import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogModule } from '@angular/material/dialog';
18
+ import * as i1$1 from '@angular/material/dialog';
19
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
20
+ import * as i12 from '@angular/material/tooltip';
10
21
  import { MatTooltipModule } from '@angular/material/tooltip';
22
+ import * as i7 from '@angular/material/icon';
11
23
  import { MatIconModule } from '@angular/material/icon';
12
24
  import { FlexLayoutModule } from '@angular/flex-layout';
25
+ import * as i4 from '@angular/material/button';
13
26
  import { MatButtonModule } from '@angular/material/button';
27
+ import * as i5$2 from '@firestitch/date';
14
28
  import { parse, FsDateModule } from '@firestitch/date';
29
+ import * as i11$1 from '@firestitch/datepicker';
15
30
  import { FsDatePickerModule } from '@firestitch/datepicker';
31
+ import * as i5$1 from '@firestitch/skeleton';
16
32
  import { FsSkeletonModule } from '@firestitch/skeleton';
33
+ import * as i4$1 from '@firestitch/list';
17
34
  import { FsListComponent, FsListModule } from '@firestitch/list';
35
+ import * as i1$2 from '@firestitch/file-manager';
18
36
  import { FsFileManagerModule } from '@firestitch/file-manager';
37
+ import * as i2$1 from '@firestitch/dialog';
19
38
  import { FsDialogModule } from '@firestitch/dialog';
39
+ import * as i2 from '@firestitch/label';
20
40
  import { FsLabelModule } from '@firestitch/label';
41
+ import * as i12$1 from '@firestitch/file';
21
42
  import { FsFileModule } from '@firestitch/file';
43
+ import * as i5 from '@firestitch/menu';
22
44
  import { FsMenuModule } from '@firestitch/menu';
23
- import { FsMessage } from '@firestitch/message';
24
- import { FsBuildService } from '@firestitch/build';
45
+ import * as i1 from '@firestitch/message';
46
+ import * as i3 from '@firestitch/build';
25
47
  import { takeUntil, map, tap } from 'rxjs/operators';
26
48
  import { Subject } from 'rxjs';
27
49
  import { differenceInMinutes } from 'date-fns';
50
+ import * as i6 from '@angular/flex-layout/flex';
51
+ import * as i11 from '@angular/flex-layout/extended';
28
52
  import { ItemType } from '@firestitch/filter';
29
- import { SelectionActionType } from '@firestitch/selection';
30
- import { FsPrompt } from '@firestitch/prompt';
31
- import { groupBy, reduce } from 'lodash-es';
32
- import { ClipboardService, ClipboardModule } from 'ngx-clipboard';
53
+ import * as i3$1 from '@angular/material/tabs';
33
54
  import { MatTabsModule } from '@angular/material/tabs';
55
+ import { SelectionActionType } from '@firestitch/selection';
56
+ import * as i4$2 from '@firestitch/prompt';
57
+ import * as i3$2 from 'ngx-clipboard';
58
+ import { ClipboardModule } from 'ngx-clipboard';
59
+ import * as i10 from '@angular/material/core';
34
60
 
35
61
  const FS_SYSTEM_CONFIG = new InjectionToken('fs-system-config');
36
62
 
37
- let DashboardComponent = class DashboardComponent {
38
- constructor(_message, _cdRef, _buildService) {
39
- this._message = _message;
40
- this._cdRef = _cdRef;
41
- this._buildService = _buildService;
42
- this.buttonActions = [];
43
- this.menuActions = [];
44
- this._destroy$ = new Subject();
45
- this.actions = [];
46
- }
47
- ngOnInit() {
48
- this._load();
49
- this.buttonActions = this.actions.filter(item => { return !item.menu; });
50
- this.menuActions = this.actions.filter(item => { return item.menu; });
51
- this.build = this._buildService.build;
52
- this._buildService.buildChange$
53
- .pipe(takeUntil(this._destroy$))
54
- .subscribe((build) => {
55
- this.build = build;
56
- this._cdRef.markForCheck();
57
- });
58
- }
59
- _load() {
60
- this.load()
61
- .subscribe((dashboard) => {
62
- this.dashboard = dashboard;
63
- this.dashboard.cronRanAttention = !dashboard.cronRan ||
64
- differenceInMinutes(new Date(), new Date(dashboard.cronRan)) > 15;
65
- this._cdRef.markForCheck();
66
- });
67
- }
68
- ngOnDestroy() {
69
- this._destroy$.next();
70
- this._destroy$.complete();
71
- }
72
- actionClick(action) {
73
- action.click();
74
- }
75
- initClick() {
76
- this.init()
77
- .subscribe(() => {
78
- this._message.success('Successfully initialized the system');
79
- });
80
- }
81
- upgradeClick() {
82
- this.upgrade()
83
- .subscribe(() => {
84
- this._load();
85
- this._message.success('Successfully upgraded the system');
86
- });
87
- }
88
- };
89
- DashboardComponent.ctorParameters = () => [
90
- { type: FsMessage },
91
- { type: ChangeDetectorRef },
92
- { type: FsBuildService }
93
- ];
94
- __decorate([
95
- Input(),
96
- __metadata("design:type", Function)
97
- ], DashboardComponent.prototype, "init", void 0);
98
- __decorate([
99
- Input(),
100
- __metadata("design:type", Function)
101
- ], DashboardComponent.prototype, "upgrade", void 0);
102
- __decorate([
103
- Input(),
104
- __metadata("design:type", Function)
105
- ], DashboardComponent.prototype, "load", void 0);
106
- __decorate([
107
- Input(),
108
- __metadata("design:type", Array)
109
- ], DashboardComponent.prototype, "actions", void 0);
110
- DashboardComponent = __decorate([
111
- Component({
112
- selector: 'fs-system-dashboard',
113
- template: "<div *fsSkeleton=\"dashboard\">\r\n\r\n <div class=\"h2-container\">\r\n\r\n <div class=\"actions\">\r\n <h2>Actions</h2>\r\n <div fxLayout=\"row\" fxLayoutGap=\"5px\" fxLayout.xs=\"column\">\r\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\r\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\r\n\r\n <button\r\n *ngFor=\"let action of buttonActions\"\r\n mat-raised-button\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </button>\r\n\r\n <ng-container *ngIf=\"menuActions.length\">\r\n\r\n <fs-menu buttonClass=\"mat-raised-button menu-button\">\r\n <ng-template\r\n *ngFor=\"let action of menuActions\"\r\n fs-menu-item\r\n (click)=\"actionClick(action)\">\r\n {{action.label}}\r\n </ng-template>\r\n </fs-menu>\r\n\r\n\r\n </ng-container>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n fxLayout=\"row wrap\"\r\n fxLayout.xs=\"column\"\r\n fxLayoutGap.xs=\"0px\"\r\n fxLayoutAlign=\"start start\"\r\n fxLayoutGap=\"50px\">\r\n\r\n <div>\r\n <h2>Server</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.serverTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.serverTimezone}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Hostname</fs-label>\r\n {{dashboard.serverHostname}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Directory</fs-label>\r\n {{dashboard.appDirectory}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>System</h2>\r\n <fs-label-field>\r\n <fs-label>Mode</fs-label>\r\n {{dashboard.appMode}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Notification Recipients</fs-label>\r\n {{dashboard.notifyRecipients.join(', ')}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Database</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Name</fs-label>\r\n {{dashboard.databaseName}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date/Time</fs-label>\r\n {{dashboard.databaseTime | fsDateFormat: 'date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Timezone</fs-label>\r\n {{dashboard.databaseTimezone}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div *ngIf=\"build || dashboard.upgrades.length\">\r\n <h2>Build</h2>\r\n\r\n <ng-container *ngIf=\"build\">\r\n <fs-label-field>\r\n <fs-label>Version</fs-label>\r\n {{build.version}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>Date</fs-label>\r\n {{ build.date | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n </ng-container>\r\n\r\n <fs-label-field *ngIf=\"dashboard.upgrades.length\">\r\n <fs-label>Pending Upgrades</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': !!dashboard.upgrades.length }\">\r\n {{dashboard.upgrades.length}}\r\n <mat-icon\r\n [matTooltip]=\"dashboard.upgrades.join('\\n')\"\r\n matTooltipClass=\"tooltip-pending-upgrades\"\r\n >\r\n warning\r\n </mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n\r\n <div>\r\n <h2>Cron</h2>\r\n\r\n <fs-label-field>\r\n <fs-label>Last Ran</fs-label>\r\n <span class=\"attention\" [ngClass]=\"{ 'needs-attention': dashboard.cronRanAttention }\">\r\n <span *ngIf=\"!dashboard.cronRan\">Never</span>\r\n <span *ngIf=\"dashboard.cronRan\">{{dashboard.cronRan | fsDateFormat: 'date-time'}}</span>\r\n <mat-icon>warning</mat-icon>\r\n </span>\r\n </fs-label-field>\r\n </div>\r\n </div>\r\n</div>\r\n",
114
- changeDetection: ChangeDetectionStrategy.OnPush,
115
- styles: [".actions{margin-bottom:1.25em}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width:600px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}@media (min-width:600px){:host ::ng-deep .menu-button{box-shadow:none}}"]
116
- }),
117
- __metadata("design:paramtypes", [FsMessage,
118
- ChangeDetectorRef,
119
- FsBuildService])
120
- ], DashboardComponent);
63
+ const snakecaseKeys = _snakecaseKeys;
64
+ const camelcaseKeys = _camelcaseKeys;
65
+ class SystemService {
66
+ constructor(_config) {
67
+ this._config = _config;
68
+ }
69
+ input(data) {
70
+ if (isArray(data)) {
71
+ return data.map(item => {
72
+ return this._config.case === 'snake' ? camelcaseKeys(item, { deep: true }) : item;
73
+ });
74
+ }
75
+ else {
76
+ return this._config.case === 'snake' ? camelcaseKeys(data, { deep: true }) : data;
77
+ }
78
+ }
79
+ output(data) {
80
+ if (isArray(data)) {
81
+ return data.map(item => {
82
+ return this._config.case === 'snake' ? snakecaseKeys(item, { deep: true }) : item;
83
+ });
84
+ }
85
+ else {
86
+ return this._config.case === 'snake' ? snakecaseKeys(data, { deep: true }) : data;
87
+ }
88
+ }
89
+ }
90
+ SystemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SystemService, deps: [{ token: FS_SYSTEM_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
91
+ SystemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SystemService });
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SystemService, decorators: [{
93
+ type: Injectable
94
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
95
+ type: Inject,
96
+ args: [FS_SYSTEM_CONFIG]
97
+ }] }]; } });
98
+
99
+ class DashboardComponent {
100
+ constructor(_message, _cdRef, _systemService, _buildService) {
101
+ this._message = _message;
102
+ this._cdRef = _cdRef;
103
+ this._systemService = _systemService;
104
+ this._buildService = _buildService;
105
+ this.buttonActions = [];
106
+ this.menuActions = [];
107
+ this._destroy$ = new Subject();
108
+ this.actions = [];
109
+ }
110
+ ngOnInit() {
111
+ this._load();
112
+ this.buttonActions = this.actions.filter(item => { return !item.menu; });
113
+ this.menuActions = this.actions.filter(item => { return item.menu; });
114
+ this.build = this._buildService.build;
115
+ this._buildService.buildChange$
116
+ .pipe(takeUntil(this._destroy$))
117
+ .subscribe((build) => {
118
+ this.build = build;
119
+ this._cdRef.markForCheck();
120
+ });
121
+ }
122
+ _load() {
123
+ this.load()
124
+ .subscribe((dashboard) => {
125
+ this.dashboard = this._systemService.input(dashboard);
126
+ this.dashboard.cronRanAttention = !dashboard.cronRan ||
127
+ differenceInMinutes(new Date(), new Date(dashboard.cronRan)) > 15;
128
+ this._cdRef.markForCheck();
129
+ });
130
+ }
131
+ ngOnDestroy() {
132
+ this._destroy$.next();
133
+ this._destroy$.complete();
134
+ }
135
+ actionClick(action) {
136
+ action.click();
137
+ }
138
+ initClick() {
139
+ this.init()
140
+ .subscribe(() => {
141
+ this._message.success('Successfully initialized the system');
142
+ });
143
+ }
144
+ upgradeClick() {
145
+ this.upgrade()
146
+ .subscribe(() => {
147
+ this._load();
148
+ this._message.success('Successfully upgraded the system');
149
+ });
150
+ }
151
+ }
152
+ DashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DashboardComponent, deps: [{ token: i1.FsMessage }, { token: i0.ChangeDetectorRef }, { token: SystemService }, { token: i3.FsBuildService }], target: i0.ɵɵFactoryTarget.Component });
153
+ DashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DashboardComponent, selector: "fs-system-dashboard", inputs: { init: "init", upgrade: "upgrade", load: "load", actions: "actions" }, ngImport: i0, template: "<div *fsSkeleton=\"dashboard\">\n\n <div class=\"h2-container\">\n\n <div class=\"actions\">\n <h2>Actions</h2>\n <div fxLayout=\"row\" fxLayoutGap=\"5px\" fxLayout.xs=\"column\">\n <button mat-raised-button (click)=\"upgradeClick()\">Run Upgrades</button>\n <button mat-raised-button (click)=\"initClick()\">Init System</button>\n\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\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\n\n </ng-container>\n\n </div>\n </div>\n </div>\n\n <div\n fxLayout=\"row wrap\"\n fxLayout.xs=\"column\"\n fxLayoutGap.xs=\"0px\"\n fxLayoutAlign=\"start start\"\n fxLayoutGap=\"50px\">\n\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 <h2>Build</h2>\n\n <ng-container *ngIf=\"build\">\n <fs-label-field>\n <fs-label>Version</fs-label>\n {{build.version}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>Date</fs-label>\n {{ build.date | fsDateFormat: 'date-time' }}\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</div>\n", styles: [".actions{margin-bottom:1.25em}table td{padding:3px}.attention{display:flex;align-items:center}.attention mat-icon{display:none;margin-left:2px}.attention.needs-attention{color:#c00}.attention.needs-attention mat-icon{display:inline}::ng-deep .tooltip-pending-upgrades{white-space:pre-line}@media (max-width: 600px){:host ::ng-deep .menu-button{width:100%;border-radius:4px}}@media (min-width: 600px){:host ::ng-deep .menu-button{box-shadow:none}}\n"], components: [{ type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass"], outputs: ["opened", "closed"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i6.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i6.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]", inputs: ["fsClass", "class", "id", "label", "hidden", "groupHidden", "dismissAfterClick", "link", "target", "queryParams"], outputs: ["click"] }, { type: i6.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i7$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i11.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "fsDateFormat": i5$2.FsDateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DashboardComponent, decorators: [{
155
+ type: Component,
156
+ args: [{
157
+ selector: 'fs-system-dashboard',
158
+ templateUrl: 'dashboard.component.html',
159
+ styleUrls: ['dashboard.component.scss'],
160
+ changeDetection: ChangeDetectionStrategy.OnPush,
161
+ }]
162
+ }], ctorParameters: function () { return [{ type: i1.FsMessage }, { type: i0.ChangeDetectorRef }, { type: SystemService }, { type: i3.FsBuildService }]; }, propDecorators: { init: [{
163
+ type: Input
164
+ }], upgrade: [{
165
+ type: Input
166
+ }], load: [{
167
+ type: Input
168
+ }], actions: [{
169
+ type: Input
170
+ }] } });
121
171
 
122
- function indexNameValue(arry) {
123
- const obj = {};
124
- arry.forEach(item => {
125
- obj[item.value] = item.name;
126
- });
127
- return obj;
172
+ function indexNameValue(arry) {
173
+ const obj = {};
174
+ arry.forEach(item => {
175
+ obj[item.value] = item.name;
176
+ });
177
+ return obj;
128
178
  }
129
179
 
130
- var CronState;
131
- (function (CronState) {
132
- CronState["Running"] = "running";
133
- CronState["Idle"] = "idle";
134
- CronState["Failed"] = "failed";
135
- CronState["Queued"] = "queued";
136
- CronState["Disabled"] = "disabled";
180
+ var CronState;
181
+ (function (CronState) {
182
+ CronState["Running"] = "running";
183
+ CronState["Idle"] = "idle";
184
+ CronState["Failed"] = "failed";
185
+ CronState["Queued"] = "queued";
186
+ CronState["Disabled"] = "disabled";
137
187
  })(CronState || (CronState = {}));
138
188
 
139
- var SettingInterfaceType;
140
- (function (SettingInterfaceType) {
141
- SettingInterfaceType["RadioButton"] = "R";
142
- SettingInterfaceType["InputBox"] = "I";
143
- SettingInterfaceType["Textarea"] = "T";
144
- SettingInterfaceType["Select"] = "D";
145
- SettingInterfaceType["SelectMultiple"] = "W";
146
- SettingInterfaceType["Date"] = "A";
147
- SettingInterfaceType["File"] = "F";
148
- SettingInterfaceType["Static"] = "S";
149
- SettingInterfaceType["Password"] = "P";
150
- SettingInterfaceType["Time"] = "M";
189
+ var SettingInterfaceType;
190
+ (function (SettingInterfaceType) {
191
+ SettingInterfaceType["RadioButton"] = "R";
192
+ SettingInterfaceType["InputBox"] = "I";
193
+ SettingInterfaceType["Textarea"] = "T";
194
+ SettingInterfaceType["DropDown"] = "D";
195
+ SettingInterfaceType["Date"] = "A";
196
+ SettingInterfaceType["File"] = "F";
197
+ SettingInterfaceType["Static"] = "S";
198
+ SettingInterfaceType["Password"] = "P";
199
+ SettingInterfaceType["Time"] = "M";
151
200
  })(SettingInterfaceType || (SettingInterfaceType = {}));
152
201
 
153
- var ApiLogState;
154
- (function (ApiLogState) {
155
- ApiLogState["Success"] = "success";
156
- ApiLogState["Failed"] = "failed";
157
- ApiLogState["Deleted"] = "deleted";
202
+ var ApiLogState;
203
+ (function (ApiLogState) {
204
+ ApiLogState["Success"] = "success";
205
+ ApiLogState["Failed"] = "failed";
206
+ ApiLogState["Deleted"] = "deleted";
158
207
  })(ApiLogState || (ApiLogState = {}));
159
208
 
160
- var ProcessState;
161
- (function (ProcessState) {
162
- ProcessState["Queued"] = "Q";
163
- ProcessState["Running"] = "R";
164
- ProcessState["Completed"] = "C";
165
- ProcessState["Killed"] = "K";
166
- ProcessState["Deleted"] = "D";
167
- ProcessState["Failed"] = "F";
209
+ var ProcessState;
210
+ (function (ProcessState) {
211
+ ProcessState["Queued"] = "Q";
212
+ ProcessState["Running"] = "R";
213
+ ProcessState["Completed"] = "C";
214
+ ProcessState["Killed"] = "K";
215
+ ProcessState["Deleted"] = "D";
216
+ ProcessState["Failed"] = "F";
168
217
  })(ProcessState || (ProcessState = {}));
169
218
 
170
- var CronLogState;
171
- (function (CronLogState) {
172
- CronLogState["Message"] = "message";
173
- CronLogState["Disabled"] = "disabled";
174
- CronLogState["Started"] = "started";
175
- CronLogState["Running"] = "running";
176
- CronLogState["Completed"] = "completed";
177
- CronLogState["Failed"] = "failed";
178
- CronLogState["Killed"] = "killed";
179
- CronLogState["Queued"] = "queued";
180
- CronLogState["Reset"] = "reset";
181
- CronLogState["Stagnant"] = "stagnant";
182
- CronLogState["LongRunning"] = "long_running";
219
+ var CronLogState;
220
+ (function (CronLogState) {
221
+ CronLogState["Message"] = "message";
222
+ CronLogState["Disabled"] = "disabled";
223
+ CronLogState["Started"] = "started";
224
+ CronLogState["Running"] = "running";
225
+ CronLogState["Completed"] = "completed";
226
+ CronLogState["Failed"] = "failed";
227
+ CronLogState["Killed"] = "killed";
228
+ CronLogState["Queued"] = "queued";
229
+ CronLogState["Reset"] = "reset";
230
+ CronLogState["Stagnant"] = "stagnant";
231
+ CronLogState["LongRunning"] = "long_running";
183
232
  })(CronLogState || (CronLogState = {}));
184
233
 
185
- const CronLogStates = [
186
- { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
187
- { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
188
- { name: 'Started', value: CronLogState.Started, color: '#34BD43' },
189
- { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
190
- { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
191
- { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
192
- { name: 'Killed', value: CronLogState.Killed, color: '#29B7FF' },
193
- { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
194
- { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
195
- { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
196
- { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
234
+ const CronLogStates = [
235
+ { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
236
+ { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
237
+ { name: 'Started', value: CronLogState.Started, color: '#34BD43' },
238
+ { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
239
+ { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
240
+ { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
241
+ { name: 'Killed', value: CronLogState.Killed, color: '#29B7FF' },
242
+ { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
243
+ { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
244
+ { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
245
+ { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
197
246
  ];
198
247
 
199
- const CronStates = [
200
- { name: 'Running', value: CronState.Running },
201
- { name: 'Idle', value: CronState.Idle },
202
- { name: 'Failed', value: CronState.Failed },
203
- { name: 'Queued', value: CronState.Queued },
204
- { name: 'Disabled', value: CronState.Disabled }
248
+ const CronStates = [
249
+ { name: 'Running', value: CronState.Running },
250
+ { name: 'Idle', value: CronState.Idle },
251
+ { name: 'Failed', value: CronState.Failed },
252
+ { name: 'Queued', value: CronState.Queued },
253
+ { name: 'Disabled', value: CronState.Disabled }
205
254
  ];
206
255
 
207
- const ApiLogStates = [
208
- { name: 'Success', value: ApiLogState.Success },
209
- { name: 'Failed', value: ApiLogState.Failed },
210
- { name: 'Deleted', value: ApiLogState.Deleted }
256
+ const ApiLogStates = [
257
+ { name: 'Success', value: ApiLogState.Success },
258
+ { name: 'Failed', value: ApiLogState.Failed },
259
+ { name: 'Deleted', value: ApiLogState.Deleted }
211
260
  ];
212
261
 
213
- const ProcessStates = [
214
- { name: 'Queued', value: ProcessState.Queued },
215
- { name: 'Running', value: ProcessState.Running },
216
- { name: 'Completed', value: ProcessState.Completed },
217
- { name: 'Killed', value: ProcessState.Killed },
218
- { name: 'Failed', value: ProcessState.Failed },
219
- { name: 'Deleted', value: ProcessState.Deleted }
262
+ const ProcessStates = [
263
+ { name: 'Queued', value: ProcessState.Queued },
264
+ { name: 'Running', value: ProcessState.Running },
265
+ { name: 'Completed', value: ProcessState.Completed },
266
+ { name: 'Killed', value: ProcessState.Killed },
267
+ { name: 'Failed', value: ProcessState.Failed },
268
+ { name: 'Deleted', value: ProcessState.Deleted }
220
269
  ];
221
270
 
222
- let CronLogComponent = class CronLogComponent {
223
- constructor(_data) {
224
- this._data = _data;
225
- this.CronLogStates = indexNameValue(CronLogStates);
226
- this.CronLogStateColors = {};
227
- }
228
- ngOnInit() {
229
- this.cronLog = this._data.cronLog;
230
- this.CronLogStateColors = CronLogStates
231
- .reduce((accum, cronLogState) => {
232
- accum[cronLogState.value] = cronLogState.color;
233
- return accum;
234
- }, {});
235
- }
236
- };
237
- CronLogComponent.ctorParameters = () => [
238
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
239
- ];
240
- CronLogComponent = __decorate([
241
- Component({
242
- template: "<fs-dialog *fsSkeleton=\"cronLog\">\r\n <div mat-dialog-title>Cron Log</div>\r\n <mat-dialog-content>\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n <div [ngStyle]=\"{ color: CronLogStateColors[cronLog.state]}\">\r\n {{CronLogStates[cronLog.state] || cronLog.state}}\r\n </div>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n <fs-date-ago [date]=\"cronLog.createDate\"></fs-date-ago>\r\n </fs-label-field>\r\n </div>\r\n \r\n <fs-label-field *ngIf=\"cronLog.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n <div class=\"message\">\r\n {{cronLog.message}}\r\n </div>\r\n </fs-label-field>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n",
243
- styles: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}"]
244
- }),
245
- __param(0, Inject(MAT_DIALOG_DATA)),
246
- __metadata("design:paramtypes", [Object])
247
- ], CronLogComponent);
271
+ class CronLogComponent {
272
+ constructor(_data) {
273
+ this._data = _data;
274
+ this.CronLogStates = indexNameValue(CronLogStates);
275
+ this.CronLogStateColors = {};
276
+ }
277
+ ngOnInit() {
278
+ this.cronLog = this._data.cronLog;
279
+ this.CronLogStateColors = CronLogStates
280
+ .reduce((accum, cronLogState) => {
281
+ accum[cronLogState.value] = cronLogState.color;
282
+ return accum;
283
+ }, {});
284
+ }
285
+ }
286
+ CronLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
287
+ CronLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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"], components: [{ type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i11.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronLogComponent, decorators: [{
289
+ type: Component,
290
+ args: [{
291
+ templateUrl: './cron-log.component.html',
292
+ styleUrls: ['./cron-log.component.scss']
293
+ }]
294
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
295
+ type: Inject,
296
+ args: [MAT_DIALOG_DATA]
297
+ }] }]; } });
248
298
 
249
- let CronComponent = class CronComponent {
250
- constructor(_data, _dialog, _cdRef) {
251
- this._data = _data;
252
- this._dialog = _dialog;
253
- this._cdRef = _cdRef;
254
- this.tabIndex = 0;
255
- this.CronStates = indexNameValue(CronStates);
256
- this.CronLogStates = indexNameValue(CronLogStates);
257
- this.CronLogStateColors = {};
258
- }
259
- ngOnInit() {
260
- this.load();
261
- this.CronLogStateColors = CronLogStates
262
- .reduce((accum, cronLogState) => {
263
- accum[cronLogState.value] = cronLogState.color;
264
- return accum;
265
- }, {});
266
- }
267
- cronLogOpen(cronLog) {
268
- this._dialog.open(CronLogComponent, {
269
- data: {
270
- cronLog,
271
- },
272
- width: '85%'
273
- });
274
- }
275
- cronActionClick(cronAction) {
276
- cronAction.action(this.cron)
277
- .subscribe(() => {
278
- this.load();
279
- });
280
- }
281
- selectedIndexChange(index) {
282
- this.tabIndex = index;
283
- }
284
- load() {
285
- this._data.loadCron(this._data.cron)
286
- .subscribe((cron) => {
287
- this.cron = Object.assign(Object.assign({}, this._data.cron), cron);
288
- if (this._data.loadCronLogs) {
289
- this.config = {
290
- filters: [
291
- {
292
- type: ItemType.Select,
293
- name: 'state',
294
- label: 'Status',
295
- values: [
296
- { name: 'All', value: null },
297
- ...CronLogStates,
298
- ],
299
- },
300
- {
301
- type: ItemType.DateRange,
302
- name: 'date',
303
- label: ['From Date', 'To Date'],
304
- },
305
- ],
306
- fetch: (query) => {
307
- query = Object.assign(Object.assign({}, query), { cronId: this.cron.id });
308
- return this._data.loadCronLogs(query);
309
- },
310
- };
311
- }
312
- this.cronActions = this._data.cronActions
313
- .filter((cronLogAction) => {
314
- return cronLogAction.show(this.cron);
315
- });
316
- this._cdRef.markForCheck();
317
- });
318
- }
319
- };
320
- CronComponent.ctorParameters = () => [
321
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
322
- { type: MatDialog },
323
- { type: ChangeDetectorRef }
324
- ];
325
- CronComponent = __decorate([
326
- Component({
327
- template: "<fs-dialog *fsSkeleton=\"cron\">\r\n <h1 mat-dialog-title>\r\n Cron\r\n <div class=\"small\">{{cron.name}}</div>\r\n </h1>\r\n <mat-dialog-content>\r\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\r\n <mat-tab label=\"Overview\">\r\n <div class=\"row\">\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{CronStates[cron.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"cron.cronSetting\">\r\n <fs-label>\r\n Run Frequency\r\n </fs-label>\r\n {{cron.cronSetting.summary}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Last Ran\r\n </fs-label>\r\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\r\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\r\n </ng-template>\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"cron.message\">\r\n <fs-label>\r\n Last Message\r\n </fs-label>\r\n <div class=\"message\">{{cron.message}}</div>\r\n </fs-label-field>\r\n </mat-tab>\r\n <mat-tab label=\"Logs\" *ngIf=\"config\">\r\n <ng-template matTabContent>\r\n <fs-list [config]=\"config\">\r\n <fs-list-column name=\"state\" title=\"Status\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a \r\n (click)=\"cronLogOpen(row)\"\r\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\r\n {{CronLogStates[row.state] || row.state}}\r\n </a>\r\n </ng-template>\r\n </fs-list-column>\r\n \r\n <fs-list-column title=\"Message\" class=\"col-message\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <div class=\"message\">{{row.message}}</div>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list> \r\n </ng-template>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n </mat-dialog-content>\r\n <mat-dialog-actions> \r\n <button \r\n mat-button \r\n [mat-dialog-close]=\"true\" \r\n color=\"primary\">\r\n Done\r\n </button>\r\n <ng-container *ngIf=\"tabIndex === 0\">\r\n <button \r\n *ngFor=\"let cronAction of cronActions\"\r\n mat-button \r\n (click)=\"cronActionClick(cronAction)\">\r\n {{cronAction.label}}\r\n </button> \r\n </ng-container>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n",
328
- changeDetection: ChangeDetectionStrategy.OnPush,
329
- 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}"]
330
- }),
331
- __param(0, Inject(MAT_DIALOG_DATA)),
332
- __metadata("design:paramtypes", [Object, MatDialog,
333
- ChangeDetectorRef])
334
- ], CronComponent);
299
+ class CronComponent {
300
+ constructor(_data, _dialog, _cdRef) {
301
+ this._data = _data;
302
+ this._dialog = _dialog;
303
+ this._cdRef = _cdRef;
304
+ this.tabIndex = 0;
305
+ this.CronStates = indexNameValue(CronStates);
306
+ this.CronLogStates = indexNameValue(CronLogStates);
307
+ this.CronLogStateColors = {};
308
+ }
309
+ ngOnInit() {
310
+ this.load();
311
+ this.CronLogStateColors = CronLogStates
312
+ .reduce((accum, cronLogState) => {
313
+ accum[cronLogState.value] = cronLogState.color;
314
+ return accum;
315
+ }, {});
316
+ }
317
+ cronLogOpen(cronLog) {
318
+ this._dialog.open(CronLogComponent, {
319
+ data: {
320
+ cronLog,
321
+ },
322
+ width: '85%'
323
+ });
324
+ }
325
+ cronActionClick(cronAction) {
326
+ cronAction.action(this.cron)
327
+ .subscribe(() => {
328
+ this.load();
329
+ });
330
+ }
331
+ selectedIndexChange(index) {
332
+ this.tabIndex = index;
333
+ }
334
+ load() {
335
+ this._data.loadCron(this._data.cron)
336
+ .subscribe((cron) => {
337
+ this.cron = Object.assign(Object.assign({}, this._data.cron), cron);
338
+ if (this._data.loadCronLogs) {
339
+ this.config = {
340
+ filters: [
341
+ {
342
+ type: ItemType.Select,
343
+ name: 'state',
344
+ label: 'Status',
345
+ values: [
346
+ { name: 'All', value: null },
347
+ ...CronLogStates,
348
+ ],
349
+ },
350
+ {
351
+ type: ItemType.DateRange,
352
+ name: 'date',
353
+ label: ['From Date', 'To Date'],
354
+ },
355
+ ],
356
+ fetch: (query) => {
357
+ query = Object.assign(Object.assign({}, query), { cronId: this.cron.id });
358
+ return this._data.loadCronLogs(query);
359
+ },
360
+ };
361
+ }
362
+ this.cronActions = this._data.cronActions
363
+ .filter((cronLogAction) => {
364
+ return cronLogAction.show(this.cron);
365
+ });
366
+ this._cdRef.markForCheck();
367
+ });
368
+ }
369
+ }
370
+ CronComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
371
+ CronComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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=\"row\">\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 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 </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 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"], components: [{ type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby"], exportAs: ["matTab"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.MatTabContent, selector: "[matTabContent]" }, { type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i11.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fsDateDuration": i5$2.FsDateDurationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
372
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronComponent, decorators: [{
373
+ type: Component,
374
+ args: [{
375
+ templateUrl: './cron.component.html',
376
+ styleUrls: ['./cron.component.scss'],
377
+ changeDetection: ChangeDetectionStrategy.OnPush,
378
+ }]
379
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
380
+ type: Inject,
381
+ args: [MAT_DIALOG_DATA]
382
+ }] }, { type: i1$1.MatDialog }, { type: i0.ChangeDetectorRef }]; } });
335
383
 
336
- let CronsComponent = class CronsComponent {
337
- constructor(_message, _dialog) {
338
- this._message = _message;
339
- this._dialog = _dialog;
340
- this.config = null;
341
- this.cronStates = indexNameValue(CronStates);
342
- }
343
- ngOnInit() {
344
- this._configList();
345
- }
346
- _configList() {
347
- this.config = {
348
- paging: false,
349
- filters: [
350
- {
351
- type: ItemType.Keyword,
352
- name: 'keyword',
353
- label: 'Search'
354
- }
355
- ],
356
- rowActions: this.getCronActions()
357
- .map((rowAction) => {
358
- return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
359
- rowAction.action(cron)
360
- .subscribe();
361
- } });
362
- }),
363
- fetch: query => {
364
- query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
365
- return this.loadCrons(query)
366
- .pipe(map((response) => ({ data: response })));
367
- },
368
- };
369
- if (this.bulk) {
370
- this.config.selection = {
371
- selectAll: false,
372
- actions: [
373
- {
374
- type: SelectionActionType.Action,
375
- name: 'disable',
376
- label: 'Disable'
377
- },
378
- {
379
- type: SelectionActionType.Action,
380
- name: 'enable',
381
- label: 'Enable'
382
- },
383
- ],
384
- actionSelected: (action) => {
385
- return this.bulk(action.action.name, action.selected)
386
- .pipe(tap(() => {
387
- this.list.reload();
388
- this._message.success('Applied Changes');
389
- }));
390
- },
391
- };
392
- }
393
- }
394
- open(cron) {
395
- this._dialog.open(CronComponent, {
396
- data: {
397
- cron,
398
- loadCronLogs: this.loadCronLogs,
399
- loadCron: this.loadCron,
400
- cronActions: this.getCronActions(),
401
- },
402
- width: '85%'
403
- });
404
- }
405
- getCronActions() {
406
- return [
407
- {
408
- action: (data) => {
409
- return this.queue(data)
410
- .pipe(tap(() => {
411
- this._message.success('Queued cron');
412
- this.list.reload();
413
- }));
414
- },
415
- label: 'Queue',
416
- show: (cron) => {
417
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
418
- },
419
- },
420
- {
421
- action: (data) => {
422
- return this.run(data)
423
- .pipe(tap(() => {
424
- this._message.success('Cron ran');
425
- this.list.reload();
426
- }));
427
- },
428
- label: 'Run',
429
- show: (cron) => {
430
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
431
- },
432
- },
433
- {
434
- action: (data) => {
435
- return this.enable(data)
436
- .pipe(tap(() => {
437
- this._message.success('Enabled cron');
438
- this.list.reload();
439
- }));
440
- },
441
- label: 'Enable',
442
- show: (cron) => {
443
- return cron.state === CronState.Disabled;
444
- },
445
- },
446
- {
447
- action: (data) => {
448
- return this.disable(data)
449
- .pipe(tap(() => {
450
- this._message.success('Disabled cron');
451
- this.list.reload();
452
- }));
453
- },
454
- label: 'Disable',
455
- show: (cron) => {
456
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
457
- },
458
- },
459
- {
460
- action: (data) => {
461
- return this.kill(data)
462
- .pipe(tap(() => {
463
- this._message.success('Killed cron');
464
- this.list.reload();
465
- }));
466
- },
467
- label: 'Kill',
468
- show: (cron) => {
469
- return cron.state === CronState.Running;
470
- },
471
- },
472
- ];
473
- }
474
- };
475
- CronsComponent.ctorParameters = () => [
476
- { type: FsMessage },
477
- { type: MatDialog }
478
- ];
479
- __decorate([
480
- ViewChild(FsListComponent, { static: true }),
481
- __metadata("design:type", FsListComponent)
482
- ], CronsComponent.prototype, "list", void 0);
483
- __decorate([
484
- Input(),
485
- __metadata("design:type", Function)
486
- ], CronsComponent.prototype, "enable", void 0);
487
- __decorate([
488
- Input(),
489
- __metadata("design:type", Function)
490
- ], CronsComponent.prototype, "disable", void 0);
491
- __decorate([
492
- Input(),
493
- __metadata("design:type", Function)
494
- ], CronsComponent.prototype, "kill", void 0);
495
- __decorate([
496
- Input(),
497
- __metadata("design:type", Function)
498
- ], CronsComponent.prototype, "queue", void 0);
499
- __decorate([
500
- Input(),
501
- __metadata("design:type", Function)
502
- ], CronsComponent.prototype, "run", void 0);
503
- __decorate([
504
- Input(),
505
- __metadata("design:type", Function)
506
- ], CronsComponent.prototype, "loadCrons", void 0);
507
- __decorate([
508
- Input(),
509
- __metadata("design:type", Function)
510
- ], CronsComponent.prototype, "loadCron", void 0);
511
- __decorate([
512
- Input(),
513
- __metadata("design:type", Function)
514
- ], CronsComponent.prototype, "loadCronLogs", void 0);
515
- __decorate([
516
- Input(),
517
- __metadata("design:type", Function)
518
- ], CronsComponent.prototype, "bulk", void 0);
519
- CronsComponent = __decorate([
520
- Component({
521
- selector: 'fs-system-crons',
522
- template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.name}}</a>\r\n <div *ngIf=\"row.cronSetting\">\r\n <small>{{row.cronSetting.summary}}</small>\r\n </div>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{cronStates[row.state]}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Last Ran</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\r\n Never\r\n </ng-container>\r\n <ng-template #lastRan>\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n <div><small *ngIf=\"row.duration\">Duration: {{ row.duration | fsDateDuration }}</small></div>\r\n </ng-template>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n",
523
- styles: [""]
524
- }),
525
- __metadata("design:paramtypes", [FsMessage,
526
- MatDialog])
527
- ], CronsComponent);
384
+ class CronsComponent {
385
+ constructor(_message, _systemService, _dialog) {
386
+ this._message = _message;
387
+ this._systemService = _systemService;
388
+ this._dialog = _dialog;
389
+ this.config = null;
390
+ this.cronStates = indexNameValue(CronStates);
391
+ }
392
+ ngOnInit() {
393
+ this._configList();
394
+ }
395
+ _configList() {
396
+ this.config = {
397
+ paging: false,
398
+ filters: [
399
+ {
400
+ type: ItemType.Keyword,
401
+ name: 'keyword',
402
+ label: 'Search'
403
+ }
404
+ ],
405
+ rowActions: this.getCronActions()
406
+ .map((rowAction) => {
407
+ return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
408
+ rowAction.action(cron)
409
+ .subscribe();
410
+ } });
411
+ }),
412
+ fetch: query => {
413
+ query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
414
+ return this.loadCrons(query)
415
+ .pipe(map((response) => ({ data: this._systemService.input(response) })));
416
+ },
417
+ };
418
+ if (this.bulk) {
419
+ this.config.selection = {
420
+ selectAll: false,
421
+ actions: [
422
+ {
423
+ type: SelectionActionType.Action,
424
+ name: 'disable',
425
+ label: 'Disable'
426
+ },
427
+ {
428
+ type: SelectionActionType.Action,
429
+ name: 'enable',
430
+ label: 'Enable'
431
+ },
432
+ ],
433
+ actionSelected: (action) => {
434
+ return this.bulk(action.action.name, action.selected)
435
+ .pipe(tap(() => {
436
+ this.list.reload();
437
+ this._message.success('Applied Changes');
438
+ }));
439
+ },
440
+ };
441
+ }
442
+ }
443
+ open(cron) {
444
+ this._dialog.open(CronComponent, {
445
+ data: {
446
+ cron,
447
+ loadCronLogs: this.loadCronLogs,
448
+ loadCron: this.loadCron,
449
+ cronActions: this.getCronActions(),
450
+ },
451
+ width: '85%'
452
+ });
453
+ }
454
+ getCronActions() {
455
+ return [
456
+ {
457
+ action: (data) => {
458
+ return this.queue(this._systemService.output(data))
459
+ .pipe(tap(() => {
460
+ this._message.success('Queued cron');
461
+ this.list.reload();
462
+ }));
463
+ },
464
+ label: 'Queue',
465
+ show: (cron) => {
466
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
467
+ },
468
+ },
469
+ {
470
+ action: (data) => {
471
+ return this.run(this._systemService.output(data))
472
+ .pipe(tap(() => {
473
+ this._message.success('Cron ran');
474
+ this.list.reload();
475
+ }));
476
+ },
477
+ label: 'Run',
478
+ show: (cron) => {
479
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
480
+ },
481
+ },
482
+ {
483
+ action: (data) => {
484
+ return this.enable(this._systemService.output(data))
485
+ .pipe(tap(() => {
486
+ this._message.success('Enabled cron');
487
+ this.list.reload();
488
+ }));
489
+ },
490
+ label: 'Enable',
491
+ show: (cron) => {
492
+ return cron.state === CronState.Disabled;
493
+ },
494
+ },
495
+ {
496
+ action: (data) => {
497
+ return this.disable(this._systemService.output(data))
498
+ .pipe(tap(() => {
499
+ this._message.success('Disabled cron');
500
+ this.list.reload();
501
+ }));
502
+ },
503
+ label: 'Disable',
504
+ show: (cron) => {
505
+ return cron.state === CronState.Idle || cron.state === CronState.Failed;
506
+ },
507
+ },
508
+ {
509
+ action: (data) => {
510
+ return this.kill(this._systemService.output(data))
511
+ .pipe(tap(() => {
512
+ this._message.success('Killed cron');
513
+ this.list.reload();
514
+ }));
515
+ },
516
+ label: 'Kill',
517
+ show: (cron) => {
518
+ return cron.state === CronState.Running;
519
+ },
520
+ },
521
+ ];
522
+ }
523
+ }
524
+ CronsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronsComponent, deps: [{ token: i1.FsMessage }, { token: SystemService }, { token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
525
+ CronsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{cronStates[row.state]}}\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><small *ngIf=\"row.duration\">Duration: {{ row.duration | fsDateDuration }}</small></div>\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsDateDuration": i5$2.FsDateDurationPipe } });
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CronsComponent, decorators: [{
527
+ type: Component,
528
+ args: [{
529
+ selector: 'fs-system-crons',
530
+ templateUrl: './crons.component.html',
531
+ styleUrls: ['./crons.component.scss'],
532
+ }]
533
+ }], ctorParameters: function () { return [{ type: i1.FsMessage }, { type: SystemService }, { type: i1$1.MatDialog }]; }, propDecorators: { list: [{
534
+ type: ViewChild,
535
+ args: [FsListComponent, { static: true }]
536
+ }], enable: [{
537
+ type: Input
538
+ }], disable: [{
539
+ type: Input
540
+ }], kill: [{
541
+ type: Input
542
+ }], queue: [{
543
+ type: Input
544
+ }], run: [{
545
+ type: Input
546
+ }], loadCrons: [{
547
+ type: Input
548
+ }], loadCron: [{
549
+ type: Input
550
+ }], loadCronLogs: [{
551
+ type: Input
552
+ }], bulk: [{
553
+ type: Input
554
+ }] } });
528
555
 
529
- let SettingsComponent = class SettingsComponent {
530
- constructor(_message, _clipboardService, _prompt, _cdRef) {
531
- this._message = _message;
532
- this._clipboardService = _clipboardService;
533
- this._prompt = _prompt;
534
- this._cdRef = _cdRef;
535
- this.fileRemove = new EventEmitter();
536
- this.fileSelect = new EventEmitter();
537
- this.groupedSettings = [];
538
- this.groups = [];
539
- this.SettingInterfaceType = SettingInterfaceType;
540
- }
541
- ngOnInit() {
542
- this.loadSettings()
543
- .subscribe((settings) => {
544
- settings = settings.map((setting) => {
545
- switch (setting.interfaceType) {
546
- case SettingInterfaceType.Date:
547
- case SettingInterfaceType.Time:
548
- setting.value = parse(setting.value);
549
- case SettingInterfaceType.SelectMultiple:
550
- setting.value = Array.isArray(setting.value) ? setting.value : [];
551
- break;
552
- }
553
- return setting;
554
- });
555
- this.groupedSettings = groupBy(settings, (item) => {
556
- return item.group;
557
- });
558
- this.groups = Object.keys(this.groupedSettings);
559
- this._cdRef.markForCheck();
560
- });
561
- }
562
- export(event, settings) {
563
- event.stopPropagation();
564
- const data = settings.map((setting) => {
565
- return {
566
- name: setting.name,
567
- value: setting.value,
568
- group: setting.group,
569
- };
570
- });
571
- this._clipboardService.copy(JSON.stringify(data));
572
- this._message.success('Copied to clipboard');
573
- }
574
- import(event, group) {
575
- event.stopPropagation();
576
- this._prompt.input({
577
- label: 'JSON Import',
578
- title: 'Import Settings',
579
- commitLabel: 'Import',
580
- required: true,
581
- }).subscribe((value) => {
582
- if (value) {
583
- try {
584
- const settings = this.groupedSettings[group];
585
- const data = JSON.parse(value);
586
- data.forEach((item) => {
587
- const setting = settings.find((s) => {
588
- return item.name === s.name;
589
- });
590
- if (setting) {
591
- Object.assign(setting, item);
592
- }
593
- });
594
- this._cdRef.markForCheck();
595
- }
596
- catch (e) {
597
- this._message.error(e);
598
- }
599
- }
600
- });
601
- }
602
- saveGroup(group) {
603
- const settings = this.groupedSettings[group];
604
- const values = reduce(settings, (result, value, key) => {
605
- return (result[value.name] = value.value, result);
606
- }, {});
607
- this.save(group, values)
608
- .subscribe(() => {
609
- this._message.success('Changes Saved');
610
- });
611
- }
612
- };
613
- SettingsComponent.ctorParameters = () => [
614
- { type: FsMessage },
615
- { type: ClipboardService },
616
- { type: FsPrompt },
617
- { type: ChangeDetectorRef }
618
- ];
619
- __decorate([
620
- Input(),
621
- __metadata("design:type", Function)
622
- ], SettingsComponent.prototype, "loadSettings", void 0);
623
- __decorate([
624
- Input(),
625
- __metadata("design:type", Function)
626
- ], SettingsComponent.prototype, "save", void 0);
627
- __decorate([
628
- Output(),
629
- __metadata("design:type", Object)
630
- ], SettingsComponent.prototype, "fileRemove", void 0);
631
- __decorate([
632
- Output(),
633
- __metadata("design:type", Object)
634
- ], SettingsComponent.prototype, "fileSelect", void 0);
635
- SettingsComponent = __decorate([
636
- Component({
637
- selector: 'fs-system-settings',
638
- template: "\r\n<mat-accordion>\r\n <mat-expansion-panel hideToggle *ngFor=\"let group of groups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n <div class=\"title-row\">\r\n <div class=\"title\">{{group || 'General'}}</div>\r\n <div class=\"actions\">\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Export ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"export($event, groupedSettings[group])\">\r\n <mat-icon>cloud_download</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n [matTooltip]=\"'Import ' + (group || 'General') + ' Settings'\"\r\n mat-icon-button\r\n (click)=\"import($event, group)\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div hideToggle *ngFor=\"let setting of groupedSettings[group]\">\r\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\r\n <input\r\n matInput\r\n [placeholder]=\"setting.label\"\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\r\n <textarea\r\n matInput\r\n [placeholder]=\"setting.label\"\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n </textarea>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Select || setting.interfaceType===SettingInterfaceType.SelectMultiple\">\r\n <mat-select\r\n [placeholder]=\"setting.label\"\r\n [(ngModel)]=\"setting.value\"\r\n [multiple]=\"setting.interfaceType===SettingInterfaceType.SelectMultiple\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-option *ngFor=\"let item of setting.values | keyNameValue\" [value]=\"item.value\">\r\n {{item.name}}\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\r\n <input\r\n matInput\r\n fsDatePicker\r\n [placeholder]=\"setting.label\"\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\r\n <input\r\n matInput\r\n fsTimePicker\r\n [placeholder]=\"setting.label\"\r\n [(ngModel)]=\"setting.value\"\r\n [name]=\"'setting' + setting.id\">\r\n <mat-hint>{{setting.instruction}}</mat-hint>\r\n </mat-form-field>\r\n\r\n <fs-file-picker\r\n *ngIf=\"setting.interfaceType===SettingInterfaceType.File\"\r\n [allowRemove]=\"true\"\r\n [allowDownload]=\"true\"\r\n (select)=\"fileSelect.emit({ setting: setting, file: $event.file })\"\r\n (remove)=\"fileRemove.emit(setting)\"\r\n [url]=\"setting.value\">\r\n <div fsFileLabel>{{setting.label}}</div>\r\n </fs-file-picker>\r\n </div>\r\n\r\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"saveGroup(group)\">Save</button>\r\n\r\n </mat-expansion-panel>\r\n\r\n</mat-accordion>\r\n",
639
- changeDetection: ChangeDetectionStrategy.OnPush,
640
- 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}"]
641
- }),
642
- __metadata("design:paramtypes", [FsMessage,
643
- ClipboardService,
644
- FsPrompt,
645
- ChangeDetectorRef])
646
- ], SettingsComponent);
556
+ class KeyNameValuePipe {
557
+ transform(values) {
558
+ return Object.keys(values).map(key => {
559
+ return { value: key, name: values[key] };
560
+ });
561
+ }
562
+ }
563
+ KeyNameValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyNameValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
564
+ KeyNameValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyNameValuePipe, name: "keyNameValue" });
565
+ KeyNameValuePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyNameValuePipe });
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyNameValuePipe, decorators: [{
567
+ type: Pipe,
568
+ args: [{
569
+ name: 'keyNameValue'
570
+ }]
571
+ }, {
572
+ type: Injectable
573
+ }] });
647
574
 
648
- let FileManagerComponent = class FileManagerComponent {
649
- constructor() { }
650
- ngOnInit() {
651
- this._configFileManager();
652
- }
653
- _configFileManager() {
654
- this.config = {
655
- fetch: (path) => {
656
- return this.fetch(path);
657
- },
658
- deleteFile: (path) => {
659
- return this.deleteFile(path);
660
- },
661
- deleteDirectory: (path) => {
662
- return this.deleteDirectory(path);
663
- },
664
- createDirectory: (path) => {
665
- return this.createDirectory(path);
666
- },
667
- download: (path) => {
668
- return this.download(path);
669
- },
670
- upload: (path, file) => {
671
- return this.upload(path, file);
672
- }
673
- };
674
- }
675
- };
676
- __decorate([
677
- Input(),
678
- __metadata("design:type", Function)
679
- ], FileManagerComponent.prototype, "fetch", void 0);
680
- __decorate([
681
- Input(),
682
- __metadata("design:type", Function)
683
- ], FileManagerComponent.prototype, "deleteFile", void 0);
684
- __decorate([
685
- Input(),
686
- __metadata("design:type", Function)
687
- ], FileManagerComponent.prototype, "deleteDirectory", void 0);
688
- __decorate([
689
- Input(),
690
- __metadata("design:type", Function)
691
- ], FileManagerComponent.prototype, "createDirectory", void 0);
692
- __decorate([
693
- Input(),
694
- __metadata("design:type", Function)
695
- ], FileManagerComponent.prototype, "download", void 0);
696
- __decorate([
697
- Input(),
698
- __metadata("design:type", Function)
699
- ], FileManagerComponent.prototype, "upload", void 0);
700
- FileManagerComponent = __decorate([
701
- Component({
702
- selector: 'fs-system-file-manager',
703
- template: "<fs-file-manager [config]=\"config\"></fs-file-manager>",
704
- styles: [""]
705
- }),
706
- __metadata("design:paramtypes", [])
707
- ], FileManagerComponent);
575
+ class SettingsComponent {
576
+ constructor(_message, _systemService, _clipboardService, _prompt, _cdRef) {
577
+ this._message = _message;
578
+ this._systemService = _systemService;
579
+ this._clipboardService = _clipboardService;
580
+ this._prompt = _prompt;
581
+ this._cdRef = _cdRef;
582
+ this.fileRemove = new EventEmitter();
583
+ this.fileSelect = new EventEmitter();
584
+ this.groupedSettings = [];
585
+ this.groups = [];
586
+ this.SettingInterfaceType = SettingInterfaceType;
587
+ }
588
+ ngOnInit() {
589
+ this.loadSettings()
590
+ .subscribe((settings) => {
591
+ settings = this._systemService.input(settings);
592
+ settings = settings.map((setting) => {
593
+ switch (setting.interfaceType) {
594
+ case SettingInterfaceType.Date:
595
+ case SettingInterfaceType.Time:
596
+ setting.value = parse(setting.value);
597
+ break;
598
+ }
599
+ return setting;
600
+ });
601
+ this.groupedSettings = groupBy(settings, (item) => {
602
+ return item.group;
603
+ });
604
+ this.groups = Object.keys(this.groupedSettings);
605
+ this._cdRef.markForCheck();
606
+ });
607
+ }
608
+ export(event, settings) {
609
+ event.stopPropagation();
610
+ const data = settings.map((setting) => {
611
+ return {
612
+ name: setting.name,
613
+ value: setting.value,
614
+ group: setting.group,
615
+ };
616
+ });
617
+ this._clipboardService.copy(JSON.stringify(data));
618
+ this._message.success('Copied to clipboard');
619
+ }
620
+ import(event, group) {
621
+ event.stopPropagation();
622
+ this._prompt.input({
623
+ label: 'JSON Import',
624
+ title: 'Import Settings',
625
+ commitLabel: 'Import',
626
+ required: true,
627
+ }).subscribe((value) => {
628
+ if (value) {
629
+ try {
630
+ const settings = this.groupedSettings[group];
631
+ const data = JSON.parse(value);
632
+ data.forEach((item) => {
633
+ const setting = settings.find((s) => {
634
+ return item.name === s.name;
635
+ });
636
+ if (setting) {
637
+ Object.assign(setting, item);
638
+ }
639
+ });
640
+ this._cdRef.markForCheck();
641
+ }
642
+ catch (e) {
643
+ this._message.error(e);
644
+ }
645
+ }
646
+ });
647
+ }
648
+ saveGroup(group) {
649
+ const settings = this.groupedSettings[group];
650
+ const values = reduce(settings, (result, value, key) => {
651
+ return (result[value.name] = value.value, result);
652
+ }, {});
653
+ this.save(group, values)
654
+ .subscribe(() => {
655
+ this._message.success('Changes Saved');
656
+ });
657
+ }
658
+ }
659
+ SettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SettingsComponent, deps: [{ token: i1.FsMessage }, { token: SystemService }, { token: i3$2.ClipboardService }, { token: i4$2.FsPrompt }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
660
+ SettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 hideToggle *ngFor=\"let setting of groupedSettings[group]\">\n <mat-form-field class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.InputBox\">\n <input\n matInput\n [placeholder]=\"setting.label\"\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 class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Textarea\">\n <textarea\n matInput\n [placeholder]=\"setting.label\"\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 class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.DropDown\">\n <mat-select\n [placeholder]=\"setting.label\"\n [(ngModel)]=\"setting.value\"\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 class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Date\">\n <input\n matInput\n fsDatePicker\n [placeholder]=\"setting.label\"\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 class=\"full-width\" *ngIf=\"setting.interfaceType===SettingInterfaceType.Time\">\n <input\n matInput\n fsTimePicker\n [placeholder]=\"setting.label\"\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 </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}\n"], components: [{ type: i5$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i5$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i9.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i11$1.FsDatePickerComponent, selector: "[fsDatePicker]", inputs: ["minYear", "maxYear", "minDate", "maxDate", "startOfDay", "view", "format", "minutes"], outputs: ["change"] }, { type: i11$1.FsTimePickerComponent, selector: "[fsTimePicker]", inputs: ["view"] }, { type: i12$1.FsFilePickerComponent, selector: "fs-file-picker", inputs: ["imageWidth", "imageHeight", "imageQuality", "showFilename", "url", "file", "accept", "disabled", "width", "height", "previewWidth", "previewHeight", "allowDownload", "allowReupload", "allowRemove"], outputs: ["select", "remove"] }], directives: [{ type: i5$3.MatAccordion, selector: "mat-accordion", inputs: ["multi", "displayMode", "togglePosition", "hideToggle"], exportAs: ["matAccordion"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i15.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i16.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i16.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i16.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8.MatHint, selector: "mat-hint", inputs: ["align", "id"] }], pipes: { "keyNameValue": KeyNameValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SettingsComponent, decorators: [{
662
+ type: Component,
663
+ args: [{
664
+ selector: 'fs-system-settings',
665
+ templateUrl: './settings.component.html',
666
+ styleUrls: ['./settings.component.scss'],
667
+ changeDetection: ChangeDetectionStrategy.OnPush,
668
+ }]
669
+ }], ctorParameters: function () { return [{ type: i1.FsMessage }, { type: SystemService }, { type: i3$2.ClipboardService }, { type: i4$2.FsPrompt }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loadSettings: [{
670
+ type: Input
671
+ }], save: [{
672
+ type: Input
673
+ }], fileRemove: [{
674
+ type: Output
675
+ }], fileSelect: [{
676
+ type: Output
677
+ }] } });
708
678
 
709
- let KeyNameValuePipe = class KeyNameValuePipe {
710
- transform(values) {
711
- return Object.keys(values).map((key) => {
712
- return { value: key, name: values[key] };
713
- });
714
- }
715
- };
716
- KeyNameValuePipe = __decorate([
717
- Pipe({
718
- name: 'keyNameValue'
719
- }),
720
- Injectable()
721
- ], KeyNameValuePipe);
679
+ class FileManagerComponent {
680
+ constructor() { }
681
+ ngOnInit() {
682
+ this._configFileManager();
683
+ }
684
+ _configFileManager() {
685
+ this.config = {
686
+ fetch: (path) => {
687
+ return this.fetch(path);
688
+ },
689
+ deleteFile: (path) => {
690
+ return this.deleteFile(path);
691
+ },
692
+ deleteDirectory: (path) => {
693
+ return this.deleteDirectory(path);
694
+ },
695
+ createDirectory: (path) => {
696
+ return this.createDirectory(path);
697
+ },
698
+ download: (path) => {
699
+ return this.download(path);
700
+ },
701
+ upload: (path, file) => {
702
+ return this.upload(path, file);
703
+ }
704
+ };
705
+ }
706
+ }
707
+ FileManagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileManagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
708
+ FileManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileManagerComponent, selector: "fs-system-file-manager", inputs: { fetch: "fetch", deleteFile: "deleteFile", deleteDirectory: "deleteDirectory", createDirectory: "createDirectory", download: "download", upload: "upload" }, ngImport: i0, template: "<fs-file-manager [config]=\"config\"></fs-file-manager>", styles: [""], components: [{ type: i1$2.ɵa, selector: "fs-file-manager", inputs: ["config"] }] });
709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileManagerComponent, decorators: [{
710
+ type: Component,
711
+ args: [{
712
+ selector: 'fs-system-file-manager',
713
+ templateUrl: './file-manager.component.html',
714
+ styleUrls: ['./file-manager.component.scss']
715
+ }]
716
+ }], ctorParameters: function () { return []; }, propDecorators: { fetch: [{
717
+ type: Input
718
+ }], deleteFile: [{
719
+ type: Input
720
+ }], deleteDirectory: [{
721
+ type: Input
722
+ }], createDirectory: [{
723
+ type: Input
724
+ }], download: [{
725
+ type: Input
726
+ }], upload: [{
727
+ type: Input
728
+ }] } });
722
729
 
723
- let ProcessComponent = class ProcessComponent {
724
- constructor(_dialogRef, data) {
725
- this._dialogRef = _dialogRef;
726
- this.data = data;
727
- this.ProcessState = ProcessState;
728
- }
729
- ngOnInit() {
730
- this.ProcessStates = indexNameValue(ProcessStates);
731
- if (this.data.loadProcess) {
732
- this.load();
733
- }
734
- else {
735
- this.process = this.data.process;
736
- }
737
- }
738
- load() {
739
- this.data.loadProcess(this.data.process)
740
- .subscribe((process) => {
741
- this.process = process;
742
- });
743
- }
744
- };
745
- ProcessComponent.ctorParameters = () => [
746
- { type: MatDialogRef },
747
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
748
- ];
749
- ProcessComponent = __decorate([
750
- Component({
751
- template: "<fs-dialog *fsSkeleton=\"process\">\r\n <div mat-dialog-title>Process</div>\r\n <mat-dialog-content>\r\n <div fxLayout=\"column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Name\r\n </fs-label>\r\n {{process.prettyName}}\r\n </fs-label-field>\r\n\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\">\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{ProcessStates[process.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.notify\">\r\n <fs-label>\r\n Notification Email\r\n </fs-label>\r\n {{process.notify}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.pid\">\r\n <fs-label>\r\n PID\r\n </fs-label>\r\n {{process.pid}}\r\n </fs-label-field>\r\n </div>\r\n\r\n <div fxLayout=\"row\" fxLayoutGap=\"20px\">\r\n <fs-label-field>\r\n <fs-label>\r\n Create Date\r\n </fs-label>\r\n {{ process.createDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.startDate\">\r\n <fs-label>\r\n Start Date\r\n </fs-label>\r\n {{ process.startDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.endDate\">\r\n <fs-label>\r\n Complete Date\r\n </fs-label>\r\n {{ process.endDate | fsDateFormat: 'date-time' }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.duration\">\r\n <fs-label>\r\n Duration\r\n </fs-label>\r\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </fs-label-field>\r\n </div>\r\n\r\n <fs-label-field *ngIf=\"process.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{process.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"process.log\" class=\"log\">\r\n <fs-label>\r\n Log\r\n </fs-label>{{process.log}}\r\n </fs-label-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n <button\r\n *ngIf=\"process.state===ProcessState.Running && data.loadProcess\"\r\n mat-button\r\n (click)=\"load()\">\r\n Reload\r\n </button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n",
752
- styles: [":host ::ng-deep .log .field-content{white-space:pre-wrap;font-family:monospace;font-size:14px}"]
753
- }),
754
- __param(1, Inject(MAT_DIALOG_DATA)),
755
- __metadata("design:paramtypes", [MatDialogRef, Object])
756
- ], ProcessComponent);
730
+ class ProcessComponent {
731
+ constructor(_dialogRef, data) {
732
+ this._dialogRef = _dialogRef;
733
+ this.data = data;
734
+ this.ProcessState = ProcessState;
735
+ }
736
+ ngOnInit() {
737
+ this.ProcessStates = indexNameValue(ProcessStates);
738
+ if (this.data.loadProcess) {
739
+ this.load();
740
+ }
741
+ else {
742
+ this.process = this.data.process;
743
+ }
744
+ }
745
+ load() {
746
+ this.data.loadProcess(this.data.process)
747
+ .subscribe((process) => {
748
+ this.process = process;
749
+ });
750
+ }
751
+ }
752
+ ProcessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProcessComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
753
+ ProcessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 fxLayout=\"column\">\n <fs-label-field>\n <fs-label>\n Name\n </fs-label>\n {{process.prettyName}}\n </fs-label-field>\n\n <div fxLayout=\"row\" fxLayoutGap=\"20px\">\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{ProcessStates[process.state]}}\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 *ngIf=\"process.pid\">\n <fs-label>\n PID\n </fs-label>\n {{process.pid}}\n </fs-label-field>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"20px\">\n <fs-label-field>\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\" class=\"log\">\n <fs-label>\n Log\n </fs-label>{{process.log}}\n </fs-label-field>\n\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\n <button\n *ngIf=\"process.state===ProcessState.Running && data.loadProcess\"\n mat-button\n (click)=\"load()\">\n Reload\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [":host ::ng-deep .log .field-content{white-space:pre-wrap;font-family:monospace;font-size:14px}\n"], components: [{ type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i6.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i5$2.FsDateFormatPipe, "fsDateDuration": i5$2.FsDateDurationPipe } });
754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProcessComponent, decorators: [{
755
+ type: Component,
756
+ args: [{
757
+ templateUrl: './process.component.html',
758
+ styleUrls: ['./process.component.scss']
759
+ }]
760
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
761
+ type: Inject,
762
+ args: [MAT_DIALOG_DATA]
763
+ }] }]; } });
757
764
 
758
- let ProcessesComponent = class ProcessesComponent {
759
- constructor(_dialog, _message) {
760
- this._dialog = _dialog;
761
- this._message = _message;
762
- this.actions = [];
763
- this.config = null;
764
- this.ProcessStates = indexNameValue(ProcessStates);
765
- this.ProcessState = ProcessState;
766
- this._destroy$ = new Subject();
767
- }
768
- ngOnInit() {
769
- this._configList();
770
- }
771
- _configList() {
772
- this.config = {
773
- actions: [],
774
- rowActions: [],
775
- filters: [
776
- {
777
- type: ItemType.Keyword,
778
- name: 'keyword',
779
- label: 'Search'
780
- },
781
- {
782
- type: ItemType.Select,
783
- name: 'state',
784
- label: 'Status',
785
- values: ProcessStates
786
- },
787
- ],
788
- fetch: query => {
789
- return this.loadProcesses(query)
790
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
791
- }
792
- };
793
- if (this.run) {
794
- this.config.rowActions.push({
795
- label: 'Run',
796
- click: (data) => {
797
- this._message.info('Running process...');
798
- this.run(data)
799
- .subscribe(() => {
800
- this.list.reload();
801
- this._message.success('Succesfully ran process');
802
- });
803
- setTimeout(() => {
804
- this.list.reload();
805
- }, 500);
806
- }
807
- });
808
- }
809
- if (this.kill) {
810
- this.config.rowActions.push({
811
- label: 'Kill',
812
- show: (data) => {
813
- return !!data.pid;
814
- },
815
- click: (data) => {
816
- this._message.info('Killing process...');
817
- this.kill(data)
818
- .subscribe(() => {
819
- this.list.reload();
820
- this._message.success('Succesfully killed process');
821
- });
822
- setTimeout(() => {
823
- this.list.reload();
824
- }, 500);
825
- }
826
- });
827
- }
828
- if (this.delete) {
829
- this.config.rowActions.push({
830
- label: 'Delete',
831
- click: (data) => {
832
- this.delete(data)
833
- .subscribe(() => {
834
- this.list.reload();
835
- this._message.success('Deleted process');
836
- });
837
- }
838
- });
839
- }
840
- this.actions.forEach(action => {
841
- this.config.actions.push({
842
- primary: false,
843
- label: action.label,
844
- menu: action.menu,
845
- click: () => {
846
- if (action.click) {
847
- action.click();
848
- }
849
- if (action.component) {
850
- const dialogRef = this._dialog.open(action.component, {
851
- width: '800px'
852
- });
853
- dialogRef.afterClosed()
854
- .pipe(takeUntil(this._destroy$))
855
- .subscribe(result => {
856
- this.list.reload();
857
- });
858
- }
859
- },
860
- });
861
- });
862
- }
863
- open(process) {
864
- this._dialog.open(ProcessComponent, {
865
- data: {
866
- process,
867
- loadProcess: this.loadProcess,
868
- },
869
- width: '85%'
870
- });
871
- }
872
- ngOnDestroy() {
873
- this._destroy$.next();
874
- this._destroy$.complete();
875
- }
876
- };
877
- ProcessesComponent.ctorParameters = () => [
878
- { type: MatDialog },
879
- { type: FsMessage }
880
- ];
881
- __decorate([
882
- ViewChild(FsListComponent),
883
- __metadata("design:type", FsListComponent)
884
- ], ProcessesComponent.prototype, "list", void 0);
885
- __decorate([
886
- Input(),
887
- __metadata("design:type", Function)
888
- ], ProcessesComponent.prototype, "loadProcesses", void 0);
889
- __decorate([
890
- Input(),
891
- __metadata("design:type", Function)
892
- ], ProcessesComponent.prototype, "loadProcess", void 0);
893
- __decorate([
894
- Input(),
895
- __metadata("design:type", Function)
896
- ], ProcessesComponent.prototype, "run", void 0);
897
- __decorate([
898
- Input(),
899
- __metadata("design:type", Function)
900
- ], ProcessesComponent.prototype, "kill", void 0);
901
- __decorate([
902
- Input(),
903
- __metadata("design:type", Function)
904
- ], ProcessesComponent.prototype, "delete", void 0);
905
- __decorate([
906
- Input(),
907
- __metadata("design:type", Function)
908
- ], ProcessesComponent.prototype, "download", void 0);
909
- __decorate([
910
- Input(),
911
- __metadata("design:type", Array)
912
- ], ProcessesComponent.prototype, "actions", void 0);
913
- ProcessesComponent = __decorate([
914
- Component({
915
- selector: 'fs-system-processes',
916
- template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a (click)=\"open(row)\">{{row.prettyName}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ProcessStates[row.state]}}\r\n <small>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\r\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\r\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\r\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\r\n </small>\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Duration</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.message}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Completed</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n",
917
- styles: [""]
918
- }),
919
- __metadata("design:paramtypes", [MatDialog,
920
- FsMessage])
921
- ], ProcessesComponent);
765
+ class ProcessesComponent {
766
+ constructor(_systemService, _dialog, _message) {
767
+ this._systemService = _systemService;
768
+ this._dialog = _dialog;
769
+ this._message = _message;
770
+ this.actions = [];
771
+ this.config = null;
772
+ this.ProcessStates = indexNameValue(ProcessStates);
773
+ this.ProcessState = ProcessState;
774
+ this._destroy$ = new Subject();
775
+ }
776
+ ngOnInit() {
777
+ this._configList();
778
+ }
779
+ _configList() {
780
+ this.config = {
781
+ actions: [],
782
+ rowActions: [],
783
+ filters: [
784
+ {
785
+ type: ItemType.Keyword,
786
+ name: 'keyword',
787
+ label: 'Search'
788
+ },
789
+ {
790
+ type: ItemType.Select,
791
+ name: 'state',
792
+ label: 'Status',
793
+ values: ProcessStates
794
+ },
795
+ ],
796
+ fetch: query => {
797
+ return this.loadProcesses(query)
798
+ .pipe(map((response) => ({ data: this._systemService.input(response.data), paging: response.paging })));
799
+ }
800
+ };
801
+ if (this.run) {
802
+ this.config.rowActions.push({
803
+ label: 'Run',
804
+ click: (data) => {
805
+ this._message.info('Running process...');
806
+ this.run(data)
807
+ .subscribe(() => {
808
+ this.list.reload();
809
+ this._message.success('Succesfully ran process');
810
+ });
811
+ setTimeout(() => {
812
+ this.list.reload();
813
+ }, 500);
814
+ }
815
+ });
816
+ }
817
+ if (this.kill) {
818
+ this.config.rowActions.push({
819
+ label: 'Kill',
820
+ show: (data) => {
821
+ return !!data.pid;
822
+ },
823
+ click: (data) => {
824
+ this._message.info('Killing process...');
825
+ this.kill(data)
826
+ .subscribe(() => {
827
+ this.list.reload();
828
+ this._message.success('Succesfully killed process');
829
+ });
830
+ setTimeout(() => {
831
+ this.list.reload();
832
+ }, 500);
833
+ }
834
+ });
835
+ }
836
+ if (this.delete) {
837
+ this.config.rowActions.push({
838
+ label: 'Delete',
839
+ click: (data) => {
840
+ this.delete(data)
841
+ .subscribe(() => {
842
+ this.list.reload();
843
+ this._message.success('Deleted process');
844
+ });
845
+ }
846
+ });
847
+ }
848
+ this.actions.forEach(action => {
849
+ this.config.actions.push({
850
+ primary: false,
851
+ label: action.label,
852
+ menu: action.menu,
853
+ click: () => {
854
+ if (action.click) {
855
+ action.click();
856
+ }
857
+ if (action.component) {
858
+ const dialogRef = this._dialog.open(action.component, {
859
+ width: '800px'
860
+ });
861
+ dialogRef.afterClosed()
862
+ .pipe(takeUntil(this._destroy$))
863
+ .subscribe(result => {
864
+ this.list.reload();
865
+ });
866
+ }
867
+ },
868
+ });
869
+ });
870
+ }
871
+ open(process) {
872
+ this._dialog.open(ProcessComponent, {
873
+ data: {
874
+ process,
875
+ loadProcess: this.loadProcess,
876
+ },
877
+ width: '85%'
878
+ });
879
+ }
880
+ ngOnDestroy() {
881
+ this._destroy$.next();
882
+ this._destroy$.complete();
883
+ }
884
+ }
885
+ ProcessesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProcessesComponent, deps: [{ token: SystemService }, { token: i1$1.MatDialog }, { token: i1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
886
+ ProcessesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ProcessesComponent, selector: "fs-system-processes", inputs: { loadProcesses: "loadProcesses", loadProcess: "loadProcess", run: "run", kill: "kill", delete: "delete", download: "download", actions: "actions" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\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\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: [""], components: [{ type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsDateDuration": i5$2.FsDateDurationPipe } });
887
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProcessesComponent, decorators: [{
888
+ type: Component,
889
+ args: [{
890
+ selector: 'fs-system-processes',
891
+ templateUrl: './processes.component.html',
892
+ styleUrls: ['./processes.component.scss']
893
+ }]
894
+ }], ctorParameters: function () { return [{ type: SystemService }, { type: i1$1.MatDialog }, { type: i1.FsMessage }]; }, propDecorators: { list: [{
895
+ type: ViewChild,
896
+ args: [FsListComponent]
897
+ }], loadProcesses: [{
898
+ type: Input
899
+ }], loadProcess: [{
900
+ type: Input
901
+ }], run: [{
902
+ type: Input
903
+ }], kill: [{
904
+ type: Input
905
+ }], delete: [{
906
+ type: Input
907
+ }], download: [{
908
+ type: Input
909
+ }], actions: [{
910
+ type: Input
911
+ }] } });
922
912
 
923
- let ServerLogComponent = class ServerLogComponent {
924
- constructor(data) {
925
- this.data = data;
926
- }
927
- ngOnInit() {
928
- if (this.data.log) {
929
- this.log = this.data.log;
930
- try {
931
- this.log.backtrace = JSON.parse(this.log.backtrace);
932
- }
933
- catch (e) { }
934
- try {
935
- this.log.server = JSON.parse(this.log.server);
936
- }
937
- catch (e) { }
938
- }
939
- }
940
- };
941
- ServerLogComponent.ctorParameters = () => [
942
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
943
- ];
944
- ServerLogComponent = __decorate([
945
- Component({
946
- template: "<fs-dialog *fsSkeleton=\"log\">\r\n <div mat-dialog-title>Log</div>\r\n <mat-dialog-content>\r\n <div fxLayout=\"column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Error Type\r\n </fs-label>\r\n {{log.type}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{log.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n URL\r\n </fs-label>\r\n {{log.url}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n {{log.createDate|fsDateFormat: 'full-date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n File\r\n </fs-label>\r\n {{log.file}} @ {{log.line}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Backtrace\r\n </fs-label>\r\n <pre>{{log.backtrace|json}}</pre>\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n $_SERVER\r\n </fs-label>\r\n <pre>{{log.server|json}}</pre>\r\n </fs-label-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n",
947
- styles: [""]
948
- }),
949
- __param(0, Inject(MAT_DIALOG_DATA)),
950
- __metadata("design:paramtypes", [Object])
951
- ], ServerLogComponent);
913
+ class ServerLogComponent {
914
+ constructor(data) {
915
+ this.data = data;
916
+ }
917
+ ngOnInit() {
918
+ if (this.data.log) {
919
+ this.log = this.data.log;
920
+ try {
921
+ this.log.backtrace = JSON.parse(this.log.backtrace);
922
+ }
923
+ catch (e) { }
924
+ try {
925
+ this.log.server = JSON.parse(this.log.server);
926
+ }
927
+ catch (e) { }
928
+ }
929
+ }
930
+ }
931
+ ServerLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ServerLogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
932
+ ServerLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 fxLayout=\"column\">\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>\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\n <fs-label-field>\n <fs-label>\n Backtrace\n </fs-label>\n <pre>{{log.backtrace|json}}</pre>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n $_SERVER\n </fs-label>\n <pre>{{log.server|json}}</pre>\n </fs-label-field>\n </div>\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: [""], components: [{ type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i5$2.FsDateFormatPipe, "json": i7$1.JsonPipe } });
933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ServerLogComponent, decorators: [{
934
+ type: Component,
935
+ args: [{
936
+ templateUrl: './server-log.component.html',
937
+ styleUrls: ['./server-log.component.scss']
938
+ }]
939
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
940
+ type: Inject,
941
+ args: [MAT_DIALOG_DATA]
942
+ }] }]; } });
952
943
 
953
- let ServerLogsComponent = class ServerLogsComponent {
954
- constructor(_dialog) {
955
- this._dialog = _dialog;
956
- this.config = null;
957
- this.logTypes = [];
958
- }
959
- ngOnInit() {
960
- this._configList();
961
- }
962
- _configList() {
963
- this.config = {
964
- filters: [
965
- {
966
- type: ItemType.Keyword,
967
- name: 'keyword',
968
- label: 'Search'
969
- }
970
- ],
971
- fetch: query => {
972
- return this.loadLogs(query)
973
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
974
- }
975
- };
976
- }
977
- open(log) {
978
- this._dialog.open(ServerLogComponent, {
979
- data: { log: log },
980
- width: '85%'
981
- });
982
- }
983
- };
984
- ServerLogsComponent.ctorParameters = () => [
985
- { type: MatDialog }
986
- ];
987
- __decorate([
988
- ViewChild('list', { static: true }),
989
- __metadata("design:type", FsListComponent)
990
- ], ServerLogsComponent.prototype, "list", void 0);
991
- __decorate([
992
- Input(),
993
- __metadata("design:type", Function)
994
- ], ServerLogsComponent.prototype, "loadLogs", void 0);
995
- ServerLogsComponent = __decorate([
996
- Component({
997
- selector: 'fs-system-server-logs',
998
- template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.message}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Type</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.type}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list>\r\n",
999
- styles: [""]
1000
- }),
1001
- __metadata("design:paramtypes", [MatDialog])
1002
- ], ServerLogsComponent);
944
+ class ServerLogsComponent {
945
+ constructor(_dialog, _systemService) {
946
+ this._dialog = _dialog;
947
+ this._systemService = _systemService;
948
+ this.config = null;
949
+ this.logTypes = [];
950
+ }
951
+ ngOnInit() {
952
+ this._configList();
953
+ }
954
+ _configList() {
955
+ this.config = {
956
+ filters: [
957
+ {
958
+ type: ItemType.Keyword,
959
+ name: 'keyword',
960
+ label: 'Search'
961
+ }
962
+ ],
963
+ fetch: query => {
964
+ return this.loadLogs(query)
965
+ .pipe(map((response) => ({ data: this._systemService.input(response.data), paging: response.paging })));
966
+ }
967
+ };
968
+ }
969
+ open(log) {
970
+ const dialogRef = this._dialog.open(ServerLogComponent, {
971
+ data: { log: log },
972
+ width: '85%'
973
+ });
974
+ }
975
+ }
976
+ ServerLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ServerLogsComponent, deps: [{ token: i1$1.MatDialog }, { token: SystemService }], target: i0.ɵɵFactoryTarget.Component });
977
+ ServerLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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: [""], components: [{ type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ServerLogsComponent, decorators: [{
979
+ type: Component,
980
+ args: [{
981
+ selector: 'fs-system-server-logs',
982
+ templateUrl: './server-logs.component.html',
983
+ styleUrls: ['./server-logs.component.scss']
984
+ }]
985
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: SystemService }]; }, propDecorators: { list: [{
986
+ type: ViewChild,
987
+ args: ['list', { static: true }]
988
+ }], loadLogs: [{
989
+ type: Input
990
+ }] } });
1003
991
 
1004
- let UpgradeLogsComponent = class UpgradeLogsComponent {
1005
- constructor() {
1006
- this.config = null;
1007
- this.logTypes = [];
1008
- }
1009
- ngOnInit() {
1010
- this._configList();
1011
- }
1012
- _configList() {
1013
- this.config = {
1014
- paging: false,
1015
- filters: [
1016
- {
1017
- type: ItemType.Keyword,
1018
- name: 'keyword',
1019
- label: 'Search'
1020
- }
1021
- ],
1022
- fetch: query => {
1023
- return this.loadUpgradeLogs(query)
1024
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1025
- }
1026
- };
1027
- }
1028
- };
1029
- __decorate([
1030
- ViewChild(FsListComponent, { static: true }),
1031
- __metadata("design:type", FsListComponent)
1032
- ], UpgradeLogsComponent.prototype, "list", void 0);
1033
- __decorate([
1034
- Input(),
1035
- __metadata("design:type", Function)
1036
- ], UpgradeLogsComponent.prototype, "loadUpgradeLogs", void 0);
1037
- UpgradeLogsComponent = __decorate([
1038
- Component({
1039
- selector: 'fs-system-upgrade-logs',
1040
- template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.name}}\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Function</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.function}}()\r\n </ng-template>\r\n </fs-list-column>\r\n\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>\r\n",
1041
- styles: [""]
1042
- })
1043
- ], UpgradeLogsComponent);
992
+ class UpgradeLogsComponent {
993
+ constructor(_systemService) {
994
+ this._systemService = _systemService;
995
+ this.config = null;
996
+ this.logTypes = [];
997
+ }
998
+ ngOnInit() {
999
+ this._configList();
1000
+ }
1001
+ _configList() {
1002
+ this.config = {
1003
+ paging: false,
1004
+ filters: [
1005
+ {
1006
+ type: ItemType.Keyword,
1007
+ name: 'keyword',
1008
+ label: 'Search'
1009
+ }
1010
+ ],
1011
+ fetch: query => {
1012
+ return this.loadUpgradeLogs(query)
1013
+ .pipe(map((response) => ({ data: this._systemService.input(response.data), paging: response.paging })));
1014
+ }
1015
+ };
1016
+ }
1017
+ }
1018
+ UpgradeLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UpgradeLogsComponent, deps: [{ token: SystemService }], target: i0.ɵɵFactoryTarget.Component });
1019
+ UpgradeLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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: [""], components: [{ type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
1020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UpgradeLogsComponent, decorators: [{
1021
+ type: Component,
1022
+ args: [{
1023
+ selector: 'fs-system-upgrade-logs',
1024
+ templateUrl: './upgrade-logs.component.html',
1025
+ styleUrls: ['./upgrade-logs.component.scss']
1026
+ }]
1027
+ }], ctorParameters: function () { return [{ type: SystemService }]; }, propDecorators: { list: [{
1028
+ type: ViewChild,
1029
+ args: [FsListComponent, { static: true }]
1030
+ }], loadUpgradeLogs: [{
1031
+ type: Input
1032
+ }] } });
1044
1033
 
1045
- let ApiLogComponent = class ApiLogComponent {
1046
- constructor(_dialogRef, data) {
1047
- this._dialogRef = _dialogRef;
1048
- this.data = data;
1049
- }
1050
- ngOnInit() {
1051
- this.apiLogStates = indexNameValue(ApiLogStates);
1052
- if (this.data.apiLog) {
1053
- this.apiLog = this.data.apiLog;
1054
- }
1055
- }
1056
- };
1057
- ApiLogComponent.ctorParameters = () => [
1058
- { type: MatDialogRef },
1059
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
1060
- ];
1061
- ApiLogComponent = __decorate([
1062
- Component({
1063
- template: "<fs-dialog *fsSkeleton=\"apiLog\">\r\n <div mat-dialog-title>API Log</div>\r\n <mat-dialog-content>\r\n <div fxLayout=\"column\">\r\n <fs-label-field>\r\n <fs-label>\r\n Type\r\n </fs-label>\r\n {{apiLog.type}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Status\r\n </fs-label>\r\n {{apiLogStates[apiLog.state]}}\r\n </fs-label-field>\r\n\r\n <fs-label-field>\r\n <fs-label>\r\n Date\r\n </fs-label>\r\n {{apiLog.createDate|fsDateFormat: 'full-date-time'}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.length\">\r\n <fs-label>\r\n Duration\r\n </fs-label>\r\n {{ apiLog.length | fsDateDuration }}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.code\">\r\n <fs-label>\r\n Code\r\n </fs-label>\r\n {{apiLog.code}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.message\">\r\n <fs-label>\r\n Message\r\n </fs-label>\r\n {{apiLog.message}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.url\">\r\n <fs-label>\r\n URL\r\n </fs-label>\r\n {{apiLog.url}}\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.request\">\r\n <fs-label>\r\n Request\r\n </fs-label>\r\n <pre>{{apiLog.request|json}}</pre>\r\n </fs-label-field>\r\n\r\n <fs-label-field *ngIf=\"apiLog.response\">\r\n <fs-label>\r\n Response\r\n </fs-label>\r\n <pre>{{apiLog.response|json}}</pre>\r\n </fs-label-field>\r\n\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-button [mat-dialog-close]=\"true\" color=\"primary\">Done</button>\r\n </mat-dialog-actions>\r\n</fs-dialog>\r\n",
1064
- styles: [""]
1065
- }),
1066
- __param(1, Inject(MAT_DIALOG_DATA)),
1067
- __metadata("design:paramtypes", [MatDialogRef, Object])
1068
- ], ApiLogComponent);
1034
+ class ApiLogComponent {
1035
+ constructor(_dialogRef, data) {
1036
+ this._dialogRef = _dialogRef;
1037
+ this.data = data;
1038
+ }
1039
+ ngOnInit() {
1040
+ this.apiLogStates = indexNameValue(ApiLogStates);
1041
+ if (this.data.apiLog) {
1042
+ this.apiLog = this.data.apiLog;
1043
+ }
1044
+ }
1045
+ }
1046
+ ApiLogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ApiLogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1047
+ ApiLogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ApiLogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"apiLog\">\n <div mat-dialog-title>API Log</div>\n <mat-dialog-content>\n <div fxLayout=\"column\">\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>\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.length\">\n <fs-label>\n Duration\n </fs-label>\n {{ apiLog.length | fsDateDuration }}\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 *ngIf=\"apiLog.message\">\n <fs-label>\n Message\n </fs-label>\n {{apiLog.message}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"apiLog.url\">\n <fs-label>\n URL\n </fs-label>\n {{apiLog.url}}\n </fs-label-field>\n\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\n </div>\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: [""], components: [{ type: i2$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i2.FsLabelComponent, selector: "fs-label" }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i5$2.FsDateFormatPipe, "fsDateDuration": i5$2.FsDateDurationPipe, "json": i7$1.JsonPipe } });
1048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ApiLogComponent, decorators: [{
1049
+ type: Component,
1050
+ args: [{
1051
+ templateUrl: './api-log.component.html',
1052
+ styleUrls: ['./api-log.component.scss']
1053
+ }]
1054
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1055
+ type: Inject,
1056
+ args: [MAT_DIALOG_DATA]
1057
+ }] }]; } });
1069
1058
 
1070
- let ApiLogsComponent = class ApiLogsComponent {
1071
- constructor(_dialog) {
1072
- this._dialog = _dialog;
1073
- this.config = null;
1074
- this.apiLogStates = indexNameValue(ApiLogStates);
1075
- }
1076
- ngOnInit() {
1077
- this._configList();
1078
- }
1079
- _configList() {
1080
- this.config = {
1081
- filters: [
1082
- {
1083
- type: ItemType.Keyword,
1084
- name: 'keyword',
1085
- label: 'Search'
1086
- },
1087
- {
1088
- type: ItemType.Select,
1089
- name: 'state',
1090
- label: 'Status',
1091
- values: ApiLogStates
1092
- },
1093
- {
1094
- name: 'createDate',
1095
- type: ItemType.DateRange,
1096
- label: ['From Date', 'To Date'],
1097
- }
1098
- ],
1099
- fetch: query => {
1100
- Object.assign(query, {});
1101
- return this.loadApiLogs(query)
1102
- .pipe(map((response) => ({ data: response.data, paging: response.paging })));
1103
- }
1104
- };
1105
- }
1106
- open(apiLog) {
1107
- this._dialog.open(ApiLogComponent, {
1108
- data: { apiLog: apiLog },
1109
- width: '85%'
1110
- });
1111
- }
1112
- };
1113
- ApiLogsComponent.ctorParameters = () => [
1114
- { type: MatDialog }
1115
- ];
1116
- __decorate([
1117
- ViewChild(FsListComponent, { static: true }),
1118
- __metadata("design:type", FsListComponent)
1119
- ], ApiLogsComponent.prototype, "list", void 0);
1120
- __decorate([
1121
- Input(),
1122
- __metadata("design:type", Function)
1123
- ], ApiLogsComponent.prototype, "loadApiLogs", void 0);
1124
- ApiLogsComponent = __decorate([
1125
- Component({
1126
- selector: 'fs-system-api-logs',
1127
- template: "<fs-list [config]=\"config\">\r\n <fs-list-column>\r\n <ng-template fs-list-header>Name</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <a href=\"javascript:;\" (click)=\"open(row)\">{{row.type || 'Unknown'}}</a>\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Message</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.message}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Status</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{apiLogStates[row.state]}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column>\r\n <ng-template fs-list-header>Date</ng-template>\r\n <ng-template fs-list-cell let-row=\"row\">\r\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\r\n <div><small *ngIf=\"row.length\">Duration: {{ row.length | fsDateDuration }}</small></div>\r\n </ng-template>\r\n </fs-list-column>\r\n </fs-list>\r\n",
1128
- styles: [""]
1129
- }),
1130
- __metadata("design:paramtypes", [MatDialog])
1131
- ], ApiLogsComponent);
1059
+ class ApiLogsComponent {
1060
+ constructor(_dialog, _systemService) {
1061
+ this._dialog = _dialog;
1062
+ this._systemService = _systemService;
1063
+ this.config = null;
1064
+ this.apiLogStates = indexNameValue(ApiLogStates);
1065
+ }
1066
+ ngOnInit() {
1067
+ this._configList();
1068
+ }
1069
+ _configList() {
1070
+ this.config = {
1071
+ filters: [
1072
+ {
1073
+ type: ItemType.Keyword,
1074
+ name: 'keyword',
1075
+ label: 'Search'
1076
+ },
1077
+ {
1078
+ type: ItemType.Select,
1079
+ name: 'state',
1080
+ label: 'Status',
1081
+ values: ApiLogStates
1082
+ },
1083
+ {
1084
+ name: 'createDate',
1085
+ type: ItemType.DateRange,
1086
+ label: ['From Date', 'To Date'],
1087
+ }
1088
+ ],
1089
+ fetch: query => {
1090
+ Object.assign(query, {});
1091
+ return this.loadApiLogs(query)
1092
+ .pipe(map((response) => ({ data: this._systemService.input(response.data), paging: response.paging })));
1093
+ }
1094
+ };
1095
+ }
1096
+ open(apiLog) {
1097
+ this._dialog.open(ApiLogComponent, {
1098
+ data: { apiLog: apiLog },
1099
+ width: '85%'
1100
+ });
1101
+ }
1102
+ }
1103
+ ApiLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ApiLogsComponent, deps: [{ token: i1$1.MatDialog }, { token: SystemService }], target: i0.ɵɵFactoryTarget.Component });
1104
+ ApiLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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)\">{{row.type || 'Unknown'}}</a>\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>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{apiLogStates[row.state]}}\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: [""], components: [{ type: i4$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i4$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["title", "name", "show", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i4$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i4$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsDateDuration": i5$2.FsDateDurationPipe } });
1105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ApiLogsComponent, decorators: [{
1106
+ type: Component,
1107
+ args: [{
1108
+ selector: 'fs-system-api-logs',
1109
+ templateUrl: './api-logs.component.html',
1110
+ styleUrls: ['./api-logs.component.scss']
1111
+ }]
1112
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: SystemService }]; }, propDecorators: { list: [{
1113
+ type: ViewChild,
1114
+ args: [FsListComponent, { static: true }]
1115
+ }], loadApiLogs: [{
1116
+ type: Input
1117
+ }] } });
1132
1118
 
1133
- let InfoComponent = class InfoComponent {
1134
- ngAfterViewInit() {
1135
- this._load();
1136
- }
1137
- _load() {
1138
- this.load()
1139
- .subscribe((info) => {
1140
- info += '<style>body { background: transparent; }</style>';
1141
- const doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentWindow;
1142
- doc.open();
1143
- doc.write(info);
1144
- doc.close();
1145
- const scrollHeight = (this.iframe.nativeElement.contentWindow.document.documentElement.scrollHeight + 100);
1146
- this.iframe.nativeElement.style.height = `${scrollHeight}px`;
1147
- });
1148
- }
1149
- };
1150
- __decorate([
1151
- ViewChild('iframe'),
1152
- __metadata("design:type", ElementRef)
1153
- ], InfoComponent.prototype, "iframe", void 0);
1154
- __decorate([
1155
- Input(),
1156
- __metadata("design:type", Function)
1157
- ], InfoComponent.prototype, "load", void 0);
1158
- InfoComponent = __decorate([
1159
- Component({
1160
- selector: 'fs-system-info',
1161
- template: "<iframe #iframe></iframe>\r\n",
1162
- changeDetection: ChangeDetectionStrategy.OnPush,
1163
- styles: ["iframe{width:100%;border:0}"]
1164
- })
1165
- ], InfoComponent);
1119
+ class InfoComponent {
1120
+ ngAfterViewInit() {
1121
+ this._load();
1122
+ }
1123
+ _load() {
1124
+ this.load()
1125
+ .subscribe((info) => {
1126
+ info += '<style>body { background: transparent; }</style>';
1127
+ const doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentWindow;
1128
+ doc.open();
1129
+ doc.write(info);
1130
+ doc.close();
1131
+ const scrollHeight = (this.iframe.nativeElement.contentWindow.document.documentElement.scrollHeight + 100);
1132
+ this.iframe.nativeElement.style.height = `${scrollHeight}px`;
1133
+ });
1134
+ }
1135
+ }
1136
+ InfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: InfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1137
+ InfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 });
1138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: InfoComponent, decorators: [{
1139
+ type: Component,
1140
+ args: [{
1141
+ selector: 'fs-system-info',
1142
+ templateUrl: 'info.component.html',
1143
+ styleUrls: ['info.component.scss'],
1144
+ changeDetection: ChangeDetectionStrategy.OnPush,
1145
+ }]
1146
+ }], propDecorators: { iframe: [{
1147
+ type: ViewChild,
1148
+ args: ['iframe']
1149
+ }], load: [{
1150
+ type: Input
1151
+ }] } });
1166
1152
 
1167
- var FsSystemModule_1;
1168
- let FsSystemModule = FsSystemModule_1 = class FsSystemModule {
1169
- static forRoot(config) {
1170
- return {
1171
- ngModule: FsSystemModule_1,
1172
- providers: [
1173
- { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1174
- ]
1175
- };
1176
- }
1177
- };
1178
- FsSystemModule = FsSystemModule_1 = __decorate([
1179
- NgModule({
1180
- imports: [
1181
- CommonModule,
1182
- FlexLayoutModule,
1183
- FormsModule,
1184
- MatButtonModule,
1185
- MatExpansionModule,
1186
- MatTooltipModule,
1187
- MatIconModule,
1188
- MatFormFieldModule,
1189
- MatInputModule,
1190
- MatSelectModule,
1191
- MatDialogModule,
1192
- MatTabsModule,
1193
- FsDateModule,
1194
- FsSkeletonModule,
1195
- FsListModule,
1196
- FsFileModule,
1197
- FsFileManagerModule,
1198
- FsLabelModule,
1199
- FsDialogModule,
1200
- FsDatePickerModule,
1201
- FsMenuModule,
1202
- ClipboardModule,
1203
- ],
1204
- exports: [
1205
- DashboardComponent,
1206
- CronsComponent,
1207
- SettingsComponent,
1208
- FileManagerComponent,
1209
- ProcessesComponent,
1210
- ServerLogsComponent,
1211
- UpgradeLogsComponent,
1212
- ApiLogsComponent,
1213
- InfoComponent,
1214
- ],
1215
- declarations: [
1216
- DashboardComponent,
1217
- CronsComponent,
1218
- SettingsComponent,
1219
- KeyNameValuePipe,
1220
- FileManagerComponent,
1221
- ProcessesComponent,
1222
- ServerLogComponent,
1223
- ServerLogsComponent,
1224
- UpgradeLogsComponent,
1225
- ApiLogsComponent,
1226
- ApiLogComponent,
1227
- InfoComponent,
1228
- ProcessComponent,
1229
- CronComponent,
1230
- CronLogComponent,
1231
- ],
1232
- })
1233
- ], FsSystemModule);
1153
+ class FsSystemModule {
1154
+ static forRoot(config) {
1155
+ return {
1156
+ ngModule: FsSystemModule,
1157
+ providers: [
1158
+ { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1159
+ ]
1160
+ };
1161
+ }
1162
+ }
1163
+ FsSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1164
+ FsSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSystemModule, declarations: [DashboardComponent,
1165
+ CronsComponent,
1166
+ SettingsComponent,
1167
+ KeyNameValuePipe,
1168
+ FileManagerComponent,
1169
+ ProcessesComponent,
1170
+ ServerLogComponent,
1171
+ ServerLogsComponent,
1172
+ UpgradeLogsComponent,
1173
+ ApiLogsComponent,
1174
+ ApiLogComponent,
1175
+ InfoComponent,
1176
+ ProcessComponent,
1177
+ CronComponent,
1178
+ CronLogComponent], imports: [CommonModule,
1179
+ FlexLayoutModule,
1180
+ FormsModule,
1181
+ MatButtonModule,
1182
+ MatExpansionModule,
1183
+ MatTooltipModule,
1184
+ MatIconModule,
1185
+ MatFormFieldModule,
1186
+ MatInputModule,
1187
+ MatSelectModule,
1188
+ MatDialogModule,
1189
+ MatTabsModule,
1190
+ FsDateModule,
1191
+ FsSkeletonModule,
1192
+ FsListModule,
1193
+ FsFileModule,
1194
+ FsFileManagerModule,
1195
+ FsLabelModule,
1196
+ FsDialogModule,
1197
+ FsDatePickerModule,
1198
+ FsMenuModule,
1199
+ ClipboardModule], exports: [DashboardComponent,
1200
+ CronsComponent,
1201
+ SettingsComponent,
1202
+ FileManagerComponent,
1203
+ ProcessesComponent,
1204
+ ServerLogsComponent,
1205
+ UpgradeLogsComponent,
1206
+ ApiLogsComponent,
1207
+ InfoComponent] });
1208
+ FsSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSystemModule, providers: [
1209
+ SystemService
1210
+ ], imports: [[
1211
+ CommonModule,
1212
+ FlexLayoutModule,
1213
+ FormsModule,
1214
+ MatButtonModule,
1215
+ MatExpansionModule,
1216
+ MatTooltipModule,
1217
+ MatIconModule,
1218
+ MatFormFieldModule,
1219
+ MatInputModule,
1220
+ MatSelectModule,
1221
+ MatDialogModule,
1222
+ MatTabsModule,
1223
+ FsDateModule,
1224
+ FsSkeletonModule,
1225
+ FsListModule,
1226
+ FsFileModule,
1227
+ FsFileManagerModule,
1228
+ FsLabelModule,
1229
+ FsDialogModule,
1230
+ FsDatePickerModule,
1231
+ FsMenuModule,
1232
+ ClipboardModule,
1233
+ ]] });
1234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsSystemModule, decorators: [{
1235
+ type: NgModule,
1236
+ args: [{
1237
+ imports: [
1238
+ CommonModule,
1239
+ FlexLayoutModule,
1240
+ FormsModule,
1241
+ MatButtonModule,
1242
+ MatExpansionModule,
1243
+ MatTooltipModule,
1244
+ MatIconModule,
1245
+ MatFormFieldModule,
1246
+ MatInputModule,
1247
+ MatSelectModule,
1248
+ MatDialogModule,
1249
+ MatTabsModule,
1250
+ FsDateModule,
1251
+ FsSkeletonModule,
1252
+ FsListModule,
1253
+ FsFileModule,
1254
+ FsFileManagerModule,
1255
+ FsLabelModule,
1256
+ FsDialogModule,
1257
+ FsDatePickerModule,
1258
+ FsMenuModule,
1259
+ ClipboardModule,
1260
+ ],
1261
+ exports: [
1262
+ DashboardComponent,
1263
+ CronsComponent,
1264
+ SettingsComponent,
1265
+ FileManagerComponent,
1266
+ ProcessesComponent,
1267
+ ServerLogsComponent,
1268
+ UpgradeLogsComponent,
1269
+ ApiLogsComponent,
1270
+ InfoComponent,
1271
+ ],
1272
+ declarations: [
1273
+ DashboardComponent,
1274
+ CronsComponent,
1275
+ SettingsComponent,
1276
+ KeyNameValuePipe,
1277
+ FileManagerComponent,
1278
+ ProcessesComponent,
1279
+ ServerLogComponent,
1280
+ ServerLogsComponent,
1281
+ UpgradeLogsComponent,
1282
+ ApiLogsComponent,
1283
+ ApiLogComponent,
1284
+ InfoComponent,
1285
+ ProcessComponent,
1286
+ CronComponent,
1287
+ CronLogComponent,
1288
+ ],
1289
+ providers: [
1290
+ SystemService
1291
+ ],
1292
+ }]
1293
+ }] });
1234
1294
 
1235
- /**
1236
- * Generated bundle index. Do not edit.
1295
+ /**
1296
+ * Generated bundle index. Do not edit.
1237
1297
  */
1238
1298
 
1239
- export { ApiLogState, ApiLogStates, CronState, CronStates, FS_SYSTEM_CONFIG, FsSystemModule, ProcessState, ProcessStates, DashboardComponent as ɵa, CronsComponent as ɵb, SettingsComponent as ɵc, FileManagerComponent as ɵd, ProcessesComponent as ɵe, ServerLogsComponent as ɵf, UpgradeLogsComponent as ɵg, ApiLogsComponent as ɵh, InfoComponent as ɵi, KeyNameValuePipe as ɵj, ServerLogComponent as ɵk, ApiLogComponent as ɵl, ProcessComponent as ɵm, CronComponent as ɵn, CronLogComponent as ɵo };
1299
+ export { ApiLogComponent, ApiLogState, ApiLogStates, ApiLogsComponent, CronComponent, CronLogComponent, CronState, CronStates, CronsComponent, DashboardComponent, FS_SYSTEM_CONFIG, FileManagerComponent, FsSystemModule, InfoComponent, KeyNameValuePipe, ProcessComponent, ProcessState, ProcessStates, ProcessesComponent, ServerLogComponent, ServerLogsComponent, SettingsComponent, UpgradeLogsComponent };
1240
1300
  //# sourceMappingURL=firestitch-system.js.map