@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,1281 +0,0 @@
1
- import { __decorate, __metadata, __param, __assign, __spread } from 'tslib';
2
- import { InjectionToken, ChangeDetectorRef, Input, Component, ChangeDetectionStrategy, Inject, ViewChild, EventEmitter, Output, Pipe, Injectable, ElementRef, NgModule } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import { FormsModule } from '@angular/forms';
5
- import { MatFormFieldModule } from '@angular/material/form-field';
6
- import { MatExpansionModule } from '@angular/material/expansion';
7
- import { MatInputModule } from '@angular/material/input';
8
- import { MatSelectModule } from '@angular/material/select';
9
- import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogModule } from '@angular/material/dialog';
10
- import { MatTooltipModule } from '@angular/material/tooltip';
11
- import { MatIconModule } from '@angular/material/icon';
12
- import { FlexLayoutModule } from '@angular/flex-layout';
13
- import { MatButtonModule } from '@angular/material/button';
14
- import { parse, FsDateModule } from '@firestitch/date';
15
- import { FsDatePickerModule } from '@firestitch/datepicker';
16
- import { FsSkeletonModule } from '@firestitch/skeleton';
17
- import { FsListComponent, FsListModule } from '@firestitch/list';
18
- import { FsFileManagerModule } from '@firestitch/file-manager';
19
- import { FsDialogModule } from '@firestitch/dialog';
20
- import { FsLabelModule } from '@firestitch/label';
21
- import { FsFileModule } from '@firestitch/file';
22
- import { FsMenuModule } from '@firestitch/menu';
23
- import { FsMessage } from '@firestitch/message';
24
- import { FsBuildService } from '@firestitch/build';
25
- import { takeUntil, map, tap } from 'rxjs/operators';
26
- import { Subject } from 'rxjs';
27
- import { differenceInMinutes } from 'date-fns';
28
- 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';
33
- import { MatTabsModule } from '@angular/material/tabs';
34
-
35
- var FS_SYSTEM_CONFIG = new InjectionToken('fs-system-config');
36
-
37
- var DashboardComponent = /** @class */ (function () {
38
- function DashboardComponent(_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
- DashboardComponent.prototype.ngOnInit = function () {
48
- var _this = this;
49
- this._load();
50
- this.buttonActions = this.actions.filter(function (item) { return !item.menu; });
51
- this.menuActions = this.actions.filter(function (item) { return item.menu; });
52
- this.build = this._buildService.build;
53
- this._buildService.buildChange$
54
- .pipe(takeUntil(this._destroy$))
55
- .subscribe(function (build) {
56
- _this.build = build;
57
- _this._cdRef.markForCheck();
58
- });
59
- };
60
- DashboardComponent.prototype._load = function () {
61
- var _this = this;
62
- this.load()
63
- .subscribe(function (dashboard) {
64
- _this.dashboard = dashboard;
65
- _this.dashboard.cronRanAttention = !dashboard.cronRan ||
66
- differenceInMinutes(new Date(), new Date(dashboard.cronRan)) > 15;
67
- _this._cdRef.markForCheck();
68
- });
69
- };
70
- DashboardComponent.prototype.ngOnDestroy = function () {
71
- this._destroy$.next();
72
- this._destroy$.complete();
73
- };
74
- DashboardComponent.prototype.actionClick = function (action) {
75
- action.click();
76
- };
77
- DashboardComponent.prototype.initClick = function () {
78
- var _this = this;
79
- this.init()
80
- .subscribe(function () {
81
- _this._message.success('Successfully initialized the system');
82
- });
83
- };
84
- DashboardComponent.prototype.upgradeClick = function () {
85
- var _this = this;
86
- this.upgrade()
87
- .subscribe(function () {
88
- _this._load();
89
- _this._message.success('Successfully upgraded the system');
90
- });
91
- };
92
- DashboardComponent.ctorParameters = function () { return [
93
- { type: FsMessage },
94
- { type: ChangeDetectorRef },
95
- { type: FsBuildService }
96
- ]; };
97
- __decorate([
98
- Input(),
99
- __metadata("design:type", Function)
100
- ], DashboardComponent.prototype, "init", void 0);
101
- __decorate([
102
- Input(),
103
- __metadata("design:type", Function)
104
- ], DashboardComponent.prototype, "upgrade", void 0);
105
- __decorate([
106
- Input(),
107
- __metadata("design:type", Function)
108
- ], DashboardComponent.prototype, "load", void 0);
109
- __decorate([
110
- Input(),
111
- __metadata("design:type", Array)
112
- ], DashboardComponent.prototype, "actions", void 0);
113
- DashboardComponent = __decorate([
114
- Component({
115
- selector: 'fs-system-dashboard',
116
- 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",
117
- changeDetection: ChangeDetectionStrategy.OnPush,
118
- 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}}"]
119
- }),
120
- __metadata("design:paramtypes", [FsMessage,
121
- ChangeDetectorRef,
122
- FsBuildService])
123
- ], DashboardComponent);
124
- return DashboardComponent;
125
- }());
126
-
127
- function indexNameValue(arry) {
128
- var obj = {};
129
- arry.forEach(function (item) {
130
- obj[item.value] = item.name;
131
- });
132
- return obj;
133
- }
134
-
135
- var CronState;
136
- (function (CronState) {
137
- CronState["Running"] = "running";
138
- CronState["Idle"] = "idle";
139
- CronState["Failed"] = "failed";
140
- CronState["Queued"] = "queued";
141
- CronState["Disabled"] = "disabled";
142
- })(CronState || (CronState = {}));
143
-
144
- var SettingInterfaceType;
145
- (function (SettingInterfaceType) {
146
- SettingInterfaceType["RadioButton"] = "R";
147
- SettingInterfaceType["InputBox"] = "I";
148
- SettingInterfaceType["Textarea"] = "T";
149
- SettingInterfaceType["Select"] = "D";
150
- SettingInterfaceType["SelectMultiple"] = "W";
151
- SettingInterfaceType["Date"] = "A";
152
- SettingInterfaceType["File"] = "F";
153
- SettingInterfaceType["Static"] = "S";
154
- SettingInterfaceType["Password"] = "P";
155
- SettingInterfaceType["Time"] = "M";
156
- })(SettingInterfaceType || (SettingInterfaceType = {}));
157
-
158
- var ApiLogState;
159
- (function (ApiLogState) {
160
- ApiLogState["Success"] = "success";
161
- ApiLogState["Failed"] = "failed";
162
- ApiLogState["Deleted"] = "deleted";
163
- })(ApiLogState || (ApiLogState = {}));
164
-
165
- var ProcessState;
166
- (function (ProcessState) {
167
- ProcessState["Queued"] = "Q";
168
- ProcessState["Running"] = "R";
169
- ProcessState["Completed"] = "C";
170
- ProcessState["Killed"] = "K";
171
- ProcessState["Deleted"] = "D";
172
- ProcessState["Failed"] = "F";
173
- })(ProcessState || (ProcessState = {}));
174
-
175
- var CronLogState;
176
- (function (CronLogState) {
177
- CronLogState["Message"] = "message";
178
- CronLogState["Disabled"] = "disabled";
179
- CronLogState["Started"] = "started";
180
- CronLogState["Running"] = "running";
181
- CronLogState["Completed"] = "completed";
182
- CronLogState["Failed"] = "failed";
183
- CronLogState["Killed"] = "killed";
184
- CronLogState["Queued"] = "queued";
185
- CronLogState["Reset"] = "reset";
186
- CronLogState["Stagnant"] = "stagnant";
187
- CronLogState["LongRunning"] = "long_running";
188
- })(CronLogState || (CronLogState = {}));
189
-
190
- var CronLogStates = [
191
- { name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
192
- { name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
193
- { name: 'Started', value: CronLogState.Started, color: '#34BD43' },
194
- { name: 'Running', value: CronLogState.Running, color: '#34BD43' },
195
- { name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
196
- { name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
197
- { name: 'Killed', value: CronLogState.Killed, color: '#29B7FF' },
198
- { name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
199
- { name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
200
- { name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
201
- { name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
202
- ];
203
-
204
- var CronStates = [
205
- { name: 'Running', value: CronState.Running },
206
- { name: 'Idle', value: CronState.Idle },
207
- { name: 'Failed', value: CronState.Failed },
208
- { name: 'Queued', value: CronState.Queued },
209
- { name: 'Disabled', value: CronState.Disabled }
210
- ];
211
-
212
- var ApiLogStates = [
213
- { name: 'Success', value: ApiLogState.Success },
214
- { name: 'Failed', value: ApiLogState.Failed },
215
- { name: 'Deleted', value: ApiLogState.Deleted }
216
- ];
217
-
218
- var ProcessStates = [
219
- { name: 'Queued', value: ProcessState.Queued },
220
- { name: 'Running', value: ProcessState.Running },
221
- { name: 'Completed', value: ProcessState.Completed },
222
- { name: 'Killed', value: ProcessState.Killed },
223
- { name: 'Failed', value: ProcessState.Failed },
224
- { name: 'Deleted', value: ProcessState.Deleted }
225
- ];
226
-
227
- var CronLogComponent = /** @class */ (function () {
228
- function CronLogComponent(_data) {
229
- this._data = _data;
230
- this.CronLogStates = indexNameValue(CronLogStates);
231
- this.CronLogStateColors = {};
232
- }
233
- CronLogComponent.prototype.ngOnInit = function () {
234
- this.cronLog = this._data.cronLog;
235
- this.CronLogStateColors = CronLogStates
236
- .reduce(function (accum, cronLogState) {
237
- accum[cronLogState.value] = cronLogState.color;
238
- return accum;
239
- }, {});
240
- };
241
- CronLogComponent.ctorParameters = function () { return [
242
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
243
- ]; };
244
- CronLogComponent = __decorate([
245
- Component({
246
- 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",
247
- styles: [".message{white-space:pre-line}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}"]
248
- }),
249
- __param(0, Inject(MAT_DIALOG_DATA)),
250
- __metadata("design:paramtypes", [Object])
251
- ], CronLogComponent);
252
- return CronLogComponent;
253
- }());
254
-
255
- var CronComponent = /** @class */ (function () {
256
- function CronComponent(_data, _dialog, _cdRef) {
257
- this._data = _data;
258
- this._dialog = _dialog;
259
- this._cdRef = _cdRef;
260
- this.tabIndex = 0;
261
- this.CronStates = indexNameValue(CronStates);
262
- this.CronLogStates = indexNameValue(CronLogStates);
263
- this.CronLogStateColors = {};
264
- }
265
- CronComponent.prototype.ngOnInit = function () {
266
- this.load();
267
- this.CronLogStateColors = CronLogStates
268
- .reduce(function (accum, cronLogState) {
269
- accum[cronLogState.value] = cronLogState.color;
270
- return accum;
271
- }, {});
272
- };
273
- CronComponent.prototype.cronLogOpen = function (cronLog) {
274
- this._dialog.open(CronLogComponent, {
275
- data: {
276
- cronLog: cronLog,
277
- },
278
- width: '85%'
279
- });
280
- };
281
- CronComponent.prototype.cronActionClick = function (cronAction) {
282
- var _this = this;
283
- cronAction.action(this.cron)
284
- .subscribe(function () {
285
- _this.load();
286
- });
287
- };
288
- CronComponent.prototype.selectedIndexChange = function (index) {
289
- this.tabIndex = index;
290
- };
291
- CronComponent.prototype.load = function () {
292
- var _this = this;
293
- this._data.loadCron(this._data.cron)
294
- .subscribe(function (cron) {
295
- _this.cron = __assign(__assign({}, _this._data.cron), cron);
296
- if (_this._data.loadCronLogs) {
297
- _this.config = {
298
- filters: [
299
- {
300
- type: ItemType.Select,
301
- name: 'state',
302
- label: 'Status',
303
- values: __spread([
304
- { name: 'All', value: null }
305
- ], CronLogStates),
306
- },
307
- {
308
- type: ItemType.DateRange,
309
- name: 'date',
310
- label: ['From Date', 'To Date'],
311
- },
312
- ],
313
- fetch: function (query) {
314
- query = __assign(__assign({}, query), { cronId: _this.cron.id });
315
- return _this._data.loadCronLogs(query);
316
- },
317
- };
318
- }
319
- _this.cronActions = _this._data.cronActions
320
- .filter(function (cronLogAction) {
321
- return cronLogAction.show(_this.cron);
322
- });
323
- _this._cdRef.markForCheck();
324
- });
325
- };
326
- CronComponent.ctorParameters = function () { return [
327
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
328
- { type: MatDialog },
329
- { type: ChangeDetectorRef }
330
- ]; };
331
- CronComponent = __decorate([
332
- Component({
333
- 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",
334
- changeDetection: ChangeDetectionStrategy.OnPush,
335
- 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}"]
336
- }),
337
- __param(0, Inject(MAT_DIALOG_DATA)),
338
- __metadata("design:paramtypes", [Object, MatDialog,
339
- ChangeDetectorRef])
340
- ], CronComponent);
341
- return CronComponent;
342
- }());
343
-
344
- var CronsComponent = /** @class */ (function () {
345
- function CronsComponent(_message, _dialog) {
346
- this._message = _message;
347
- this._dialog = _dialog;
348
- this.config = null;
349
- this.cronStates = indexNameValue(CronStates);
350
- }
351
- CronsComponent.prototype.ngOnInit = function () {
352
- this._configList();
353
- };
354
- CronsComponent.prototype._configList = function () {
355
- var _this = this;
356
- this.config = {
357
- paging: false,
358
- filters: [
359
- {
360
- type: ItemType.Keyword,
361
- name: 'keyword',
362
- label: 'Search'
363
- }
364
- ],
365
- rowActions: this.getCronActions()
366
- .map(function (rowAction) {
367
- return __assign(__assign({}, rowAction), { click: function (cron) {
368
- rowAction.action(cron)
369
- .subscribe();
370
- } });
371
- }),
372
- fetch: function (query) {
373
- query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
374
- return _this.loadCrons(query)
375
- .pipe(map(function (response) { return ({ data: response }); }));
376
- },
377
- };
378
- if (this.bulk) {
379
- this.config.selection = {
380
- selectAll: false,
381
- actions: [
382
- {
383
- type: SelectionActionType.Action,
384
- name: 'disable',
385
- label: 'Disable'
386
- },
387
- {
388
- type: SelectionActionType.Action,
389
- name: 'enable',
390
- label: 'Enable'
391
- },
392
- ],
393
- actionSelected: function (action) {
394
- return _this.bulk(action.action.name, action.selected)
395
- .pipe(tap(function () {
396
- _this.list.reload();
397
- _this._message.success('Applied Changes');
398
- }));
399
- },
400
- };
401
- }
402
- };
403
- CronsComponent.prototype.open = function (cron) {
404
- this._dialog.open(CronComponent, {
405
- data: {
406
- cron: cron,
407
- loadCronLogs: this.loadCronLogs,
408
- loadCron: this.loadCron,
409
- cronActions: this.getCronActions(),
410
- },
411
- width: '85%'
412
- });
413
- };
414
- CronsComponent.prototype.getCronActions = function () {
415
- var _this = this;
416
- return [
417
- {
418
- action: function (data) {
419
- return _this.queue(data)
420
- .pipe(tap(function () {
421
- _this._message.success('Queued cron');
422
- _this.list.reload();
423
- }));
424
- },
425
- label: 'Queue',
426
- show: function (cron) {
427
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
428
- },
429
- },
430
- {
431
- action: function (data) {
432
- return _this.run(data)
433
- .pipe(tap(function () {
434
- _this._message.success('Cron ran');
435
- _this.list.reload();
436
- }));
437
- },
438
- label: 'Run',
439
- show: function (cron) {
440
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
441
- },
442
- },
443
- {
444
- action: function (data) {
445
- return _this.enable(data)
446
- .pipe(tap(function () {
447
- _this._message.success('Enabled cron');
448
- _this.list.reload();
449
- }));
450
- },
451
- label: 'Enable',
452
- show: function (cron) {
453
- return cron.state === CronState.Disabled;
454
- },
455
- },
456
- {
457
- action: function (data) {
458
- return _this.disable(data)
459
- .pipe(tap(function () {
460
- _this._message.success('Disabled cron');
461
- _this.list.reload();
462
- }));
463
- },
464
- label: 'Disable',
465
- show: function (cron) {
466
- return cron.state === CronState.Idle || cron.state === CronState.Failed;
467
- },
468
- },
469
- {
470
- action: function (data) {
471
- return _this.kill(data)
472
- .pipe(tap(function () {
473
- _this._message.success('Killed cron');
474
- _this.list.reload();
475
- }));
476
- },
477
- label: 'Kill',
478
- show: function (cron) {
479
- return cron.state === CronState.Running;
480
- },
481
- },
482
- ];
483
- };
484
- CronsComponent.ctorParameters = function () { return [
485
- { type: FsMessage },
486
- { type: MatDialog }
487
- ]; };
488
- __decorate([
489
- ViewChild(FsListComponent, { static: true }),
490
- __metadata("design:type", FsListComponent)
491
- ], CronsComponent.prototype, "list", void 0);
492
- __decorate([
493
- Input(),
494
- __metadata("design:type", Function)
495
- ], CronsComponent.prototype, "enable", void 0);
496
- __decorate([
497
- Input(),
498
- __metadata("design:type", Function)
499
- ], CronsComponent.prototype, "disable", void 0);
500
- __decorate([
501
- Input(),
502
- __metadata("design:type", Function)
503
- ], CronsComponent.prototype, "kill", void 0);
504
- __decorate([
505
- Input(),
506
- __metadata("design:type", Function)
507
- ], CronsComponent.prototype, "queue", void 0);
508
- __decorate([
509
- Input(),
510
- __metadata("design:type", Function)
511
- ], CronsComponent.prototype, "run", void 0);
512
- __decorate([
513
- Input(),
514
- __metadata("design:type", Function)
515
- ], CronsComponent.prototype, "loadCrons", void 0);
516
- __decorate([
517
- Input(),
518
- __metadata("design:type", Function)
519
- ], CronsComponent.prototype, "loadCron", void 0);
520
- __decorate([
521
- Input(),
522
- __metadata("design:type", Function)
523
- ], CronsComponent.prototype, "loadCronLogs", void 0);
524
- __decorate([
525
- Input(),
526
- __metadata("design:type", Function)
527
- ], CronsComponent.prototype, "bulk", void 0);
528
- CronsComponent = __decorate([
529
- Component({
530
- selector: 'fs-system-crons',
531
- 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",
532
- styles: [""]
533
- }),
534
- __metadata("design:paramtypes", [FsMessage,
535
- MatDialog])
536
- ], CronsComponent);
537
- return CronsComponent;
538
- }());
539
-
540
- var SettingsComponent = /** @class */ (function () {
541
- function SettingsComponent(_message, _clipboardService, _prompt, _cdRef) {
542
- this._message = _message;
543
- this._clipboardService = _clipboardService;
544
- this._prompt = _prompt;
545
- this._cdRef = _cdRef;
546
- this.fileRemove = new EventEmitter();
547
- this.fileSelect = new EventEmitter();
548
- this.groupedSettings = [];
549
- this.groups = [];
550
- this.SettingInterfaceType = SettingInterfaceType;
551
- }
552
- SettingsComponent.prototype.ngOnInit = function () {
553
- var _this = this;
554
- this.loadSettings()
555
- .subscribe(function (settings) {
556
- settings = settings.map(function (setting) {
557
- switch (setting.interfaceType) {
558
- case SettingInterfaceType.Date:
559
- case SettingInterfaceType.Time:
560
- setting.value = parse(setting.value);
561
- case SettingInterfaceType.SelectMultiple:
562
- setting.value = Array.isArray(setting.value) ? setting.value : [];
563
- break;
564
- }
565
- return setting;
566
- });
567
- _this.groupedSettings = groupBy(settings, function (item) {
568
- return item.group;
569
- });
570
- _this.groups = Object.keys(_this.groupedSettings);
571
- _this._cdRef.markForCheck();
572
- });
573
- };
574
- SettingsComponent.prototype.export = function (event, settings) {
575
- event.stopPropagation();
576
- var data = settings.map(function (setting) {
577
- return {
578
- name: setting.name,
579
- value: setting.value,
580
- group: setting.group,
581
- };
582
- });
583
- this._clipboardService.copy(JSON.stringify(data));
584
- this._message.success('Copied to clipboard');
585
- };
586
- SettingsComponent.prototype.import = function (event, group) {
587
- var _this = this;
588
- event.stopPropagation();
589
- this._prompt.input({
590
- label: 'JSON Import',
591
- title: 'Import Settings',
592
- commitLabel: 'Import',
593
- required: true,
594
- }).subscribe(function (value) {
595
- if (value) {
596
- try {
597
- var settings_1 = _this.groupedSettings[group];
598
- var data = JSON.parse(value);
599
- data.forEach(function (item) {
600
- var setting = settings_1.find(function (s) {
601
- return item.name === s.name;
602
- });
603
- if (setting) {
604
- Object.assign(setting, item);
605
- }
606
- });
607
- _this._cdRef.markForCheck();
608
- }
609
- catch (e) {
610
- _this._message.error(e);
611
- }
612
- }
613
- });
614
- };
615
- SettingsComponent.prototype.saveGroup = function (group) {
616
- var _this = this;
617
- var settings = this.groupedSettings[group];
618
- var values = reduce(settings, function (result, value, key) {
619
- return (result[value.name] = value.value, result);
620
- }, {});
621
- this.save(group, values)
622
- .subscribe(function () {
623
- _this._message.success('Changes Saved');
624
- });
625
- };
626
- SettingsComponent.ctorParameters = function () { return [
627
- { type: FsMessage },
628
- { type: ClipboardService },
629
- { type: FsPrompt },
630
- { type: ChangeDetectorRef }
631
- ]; };
632
- __decorate([
633
- Input(),
634
- __metadata("design:type", Function)
635
- ], SettingsComponent.prototype, "loadSettings", void 0);
636
- __decorate([
637
- Input(),
638
- __metadata("design:type", Function)
639
- ], SettingsComponent.prototype, "save", void 0);
640
- __decorate([
641
- Output(),
642
- __metadata("design:type", Object)
643
- ], SettingsComponent.prototype, "fileRemove", void 0);
644
- __decorate([
645
- Output(),
646
- __metadata("design:type", Object)
647
- ], SettingsComponent.prototype, "fileSelect", void 0);
648
- SettingsComponent = __decorate([
649
- Component({
650
- selector: 'fs-system-settings',
651
- 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",
652
- changeDetection: ChangeDetectionStrategy.OnPush,
653
- 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}"]
654
- }),
655
- __metadata("design:paramtypes", [FsMessage,
656
- ClipboardService,
657
- FsPrompt,
658
- ChangeDetectorRef])
659
- ], SettingsComponent);
660
- return SettingsComponent;
661
- }());
662
-
663
- var FileManagerComponent = /** @class */ (function () {
664
- function FileManagerComponent() {
665
- }
666
- FileManagerComponent.prototype.ngOnInit = function () {
667
- this._configFileManager();
668
- };
669
- FileManagerComponent.prototype._configFileManager = function () {
670
- var _this = this;
671
- this.config = {
672
- fetch: function (path) {
673
- return _this.fetch(path);
674
- },
675
- deleteFile: function (path) {
676
- return _this.deleteFile(path);
677
- },
678
- deleteDirectory: function (path) {
679
- return _this.deleteDirectory(path);
680
- },
681
- createDirectory: function (path) {
682
- return _this.createDirectory(path);
683
- },
684
- download: function (path) {
685
- return _this.download(path);
686
- },
687
- upload: function (path, file) {
688
- return _this.upload(path, file);
689
- }
690
- };
691
- };
692
- __decorate([
693
- Input(),
694
- __metadata("design:type", Function)
695
- ], FileManagerComponent.prototype, "fetch", void 0);
696
- __decorate([
697
- Input(),
698
- __metadata("design:type", Function)
699
- ], FileManagerComponent.prototype, "deleteFile", void 0);
700
- __decorate([
701
- Input(),
702
- __metadata("design:type", Function)
703
- ], FileManagerComponent.prototype, "deleteDirectory", void 0);
704
- __decorate([
705
- Input(),
706
- __metadata("design:type", Function)
707
- ], FileManagerComponent.prototype, "createDirectory", void 0);
708
- __decorate([
709
- Input(),
710
- __metadata("design:type", Function)
711
- ], FileManagerComponent.prototype, "download", void 0);
712
- __decorate([
713
- Input(),
714
- __metadata("design:type", Function)
715
- ], FileManagerComponent.prototype, "upload", void 0);
716
- FileManagerComponent = __decorate([
717
- Component({
718
- selector: 'fs-system-file-manager',
719
- template: "<fs-file-manager [config]=\"config\"></fs-file-manager>",
720
- styles: [""]
721
- }),
722
- __metadata("design:paramtypes", [])
723
- ], FileManagerComponent);
724
- return FileManagerComponent;
725
- }());
726
-
727
- var KeyNameValuePipe = /** @class */ (function () {
728
- function KeyNameValuePipe() {
729
- }
730
- KeyNameValuePipe.prototype.transform = function (values) {
731
- return Object.keys(values).map(function (key) {
732
- return { value: key, name: values[key] };
733
- });
734
- };
735
- KeyNameValuePipe = __decorate([
736
- Pipe({
737
- name: 'keyNameValue'
738
- }),
739
- Injectable()
740
- ], KeyNameValuePipe);
741
- return KeyNameValuePipe;
742
- }());
743
-
744
- var ProcessComponent = /** @class */ (function () {
745
- function ProcessComponent(_dialogRef, data) {
746
- this._dialogRef = _dialogRef;
747
- this.data = data;
748
- this.ProcessState = ProcessState;
749
- }
750
- ProcessComponent.prototype.ngOnInit = function () {
751
- this.ProcessStates = indexNameValue(ProcessStates);
752
- if (this.data.loadProcess) {
753
- this.load();
754
- }
755
- else {
756
- this.process = this.data.process;
757
- }
758
- };
759
- ProcessComponent.prototype.load = function () {
760
- var _this = this;
761
- this.data.loadProcess(this.data.process)
762
- .subscribe(function (process) {
763
- _this.process = process;
764
- });
765
- };
766
- ProcessComponent.ctorParameters = function () { return [
767
- { type: MatDialogRef },
768
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
769
- ]; };
770
- ProcessComponent = __decorate([
771
- Component({
772
- 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",
773
- styles: [":host ::ng-deep .log .field-content{white-space:pre-wrap;font-family:monospace;font-size:14px}"]
774
- }),
775
- __param(1, Inject(MAT_DIALOG_DATA)),
776
- __metadata("design:paramtypes", [MatDialogRef, Object])
777
- ], ProcessComponent);
778
- return ProcessComponent;
779
- }());
780
-
781
- var ProcessesComponent = /** @class */ (function () {
782
- function ProcessesComponent(_dialog, _message) {
783
- this._dialog = _dialog;
784
- this._message = _message;
785
- this.actions = [];
786
- this.config = null;
787
- this.ProcessStates = indexNameValue(ProcessStates);
788
- this.ProcessState = ProcessState;
789
- this._destroy$ = new Subject();
790
- }
791
- ProcessesComponent.prototype.ngOnInit = function () {
792
- this._configList();
793
- };
794
- ProcessesComponent.prototype._configList = function () {
795
- var _this = this;
796
- this.config = {
797
- actions: [],
798
- rowActions: [],
799
- filters: [
800
- {
801
- type: ItemType.Keyword,
802
- name: 'keyword',
803
- label: 'Search'
804
- },
805
- {
806
- type: ItemType.Select,
807
- name: 'state',
808
- label: 'Status',
809
- values: ProcessStates
810
- },
811
- ],
812
- fetch: function (query) {
813
- return _this.loadProcesses(query)
814
- .pipe(map(function (response) { return ({ data: response.data, paging: response.paging }); }));
815
- }
816
- };
817
- if (this.run) {
818
- this.config.rowActions.push({
819
- label: 'Run',
820
- click: function (data) {
821
- _this._message.info('Running process...');
822
- _this.run(data)
823
- .subscribe(function () {
824
- _this.list.reload();
825
- _this._message.success('Succesfully ran process');
826
- });
827
- setTimeout(function () {
828
- _this.list.reload();
829
- }, 500);
830
- }
831
- });
832
- }
833
- if (this.kill) {
834
- this.config.rowActions.push({
835
- label: 'Kill',
836
- show: function (data) {
837
- return !!data.pid;
838
- },
839
- click: function (data) {
840
- _this._message.info('Killing process...');
841
- _this.kill(data)
842
- .subscribe(function () {
843
- _this.list.reload();
844
- _this._message.success('Succesfully killed process');
845
- });
846
- setTimeout(function () {
847
- _this.list.reload();
848
- }, 500);
849
- }
850
- });
851
- }
852
- if (this.delete) {
853
- this.config.rowActions.push({
854
- label: 'Delete',
855
- click: function (data) {
856
- _this.delete(data)
857
- .subscribe(function () {
858
- _this.list.reload();
859
- _this._message.success('Deleted process');
860
- });
861
- }
862
- });
863
- }
864
- this.actions.forEach(function (action) {
865
- _this.config.actions.push({
866
- primary: false,
867
- label: action.label,
868
- menu: action.menu,
869
- click: function () {
870
- if (action.click) {
871
- action.click();
872
- }
873
- if (action.component) {
874
- var dialogRef = _this._dialog.open(action.component, {
875
- width: '800px'
876
- });
877
- dialogRef.afterClosed()
878
- .pipe(takeUntil(_this._destroy$))
879
- .subscribe(function (result) {
880
- _this.list.reload();
881
- });
882
- }
883
- },
884
- });
885
- });
886
- };
887
- ProcessesComponent.prototype.open = function (process) {
888
- this._dialog.open(ProcessComponent, {
889
- data: {
890
- process: process,
891
- loadProcess: this.loadProcess,
892
- },
893
- width: '85%'
894
- });
895
- };
896
- ProcessesComponent.prototype.ngOnDestroy = function () {
897
- this._destroy$.next();
898
- this._destroy$.complete();
899
- };
900
- ProcessesComponent.ctorParameters = function () { return [
901
- { type: MatDialog },
902
- { type: FsMessage }
903
- ]; };
904
- __decorate([
905
- ViewChild(FsListComponent),
906
- __metadata("design:type", FsListComponent)
907
- ], ProcessesComponent.prototype, "list", void 0);
908
- __decorate([
909
- Input(),
910
- __metadata("design:type", Function)
911
- ], ProcessesComponent.prototype, "loadProcesses", void 0);
912
- __decorate([
913
- Input(),
914
- __metadata("design:type", Function)
915
- ], ProcessesComponent.prototype, "loadProcess", void 0);
916
- __decorate([
917
- Input(),
918
- __metadata("design:type", Function)
919
- ], ProcessesComponent.prototype, "run", void 0);
920
- __decorate([
921
- Input(),
922
- __metadata("design:type", Function)
923
- ], ProcessesComponent.prototype, "kill", void 0);
924
- __decorate([
925
- Input(),
926
- __metadata("design:type", Function)
927
- ], ProcessesComponent.prototype, "delete", void 0);
928
- __decorate([
929
- Input(),
930
- __metadata("design:type", Function)
931
- ], ProcessesComponent.prototype, "download", void 0);
932
- __decorate([
933
- Input(),
934
- __metadata("design:type", Array)
935
- ], ProcessesComponent.prototype, "actions", void 0);
936
- ProcessesComponent = __decorate([
937
- Component({
938
- selector: 'fs-system-processes',
939
- 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",
940
- styles: [""]
941
- }),
942
- __metadata("design:paramtypes", [MatDialog,
943
- FsMessage])
944
- ], ProcessesComponent);
945
- return ProcessesComponent;
946
- }());
947
-
948
- var ServerLogComponent = /** @class */ (function () {
949
- function ServerLogComponent(data) {
950
- this.data = data;
951
- }
952
- ServerLogComponent.prototype.ngOnInit = function () {
953
- if (this.data.log) {
954
- this.log = this.data.log;
955
- try {
956
- this.log.backtrace = JSON.parse(this.log.backtrace);
957
- }
958
- catch (e) { }
959
- try {
960
- this.log.server = JSON.parse(this.log.server);
961
- }
962
- catch (e) { }
963
- }
964
- };
965
- ServerLogComponent.ctorParameters = function () { return [
966
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
967
- ]; };
968
- ServerLogComponent = __decorate([
969
- Component({
970
- 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",
971
- styles: [""]
972
- }),
973
- __param(0, Inject(MAT_DIALOG_DATA)),
974
- __metadata("design:paramtypes", [Object])
975
- ], ServerLogComponent);
976
- return ServerLogComponent;
977
- }());
978
-
979
- var ServerLogsComponent = /** @class */ (function () {
980
- function ServerLogsComponent(_dialog) {
981
- this._dialog = _dialog;
982
- this.config = null;
983
- this.logTypes = [];
984
- }
985
- ServerLogsComponent.prototype.ngOnInit = function () {
986
- this._configList();
987
- };
988
- ServerLogsComponent.prototype._configList = function () {
989
- var _this = this;
990
- this.config = {
991
- filters: [
992
- {
993
- type: ItemType.Keyword,
994
- name: 'keyword',
995
- label: 'Search'
996
- }
997
- ],
998
- fetch: function (query) {
999
- return _this.loadLogs(query)
1000
- .pipe(map(function (response) { return ({ data: response.data, paging: response.paging }); }));
1001
- }
1002
- };
1003
- };
1004
- ServerLogsComponent.prototype.open = function (log) {
1005
- this._dialog.open(ServerLogComponent, {
1006
- data: { log: log },
1007
- width: '85%'
1008
- });
1009
- };
1010
- ServerLogsComponent.ctorParameters = function () { return [
1011
- { type: MatDialog }
1012
- ]; };
1013
- __decorate([
1014
- ViewChild('list', { static: true }),
1015
- __metadata("design:type", FsListComponent)
1016
- ], ServerLogsComponent.prototype, "list", void 0);
1017
- __decorate([
1018
- Input(),
1019
- __metadata("design:type", Function)
1020
- ], ServerLogsComponent.prototype, "loadLogs", void 0);
1021
- ServerLogsComponent = __decorate([
1022
- Component({
1023
- selector: 'fs-system-server-logs',
1024
- 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",
1025
- styles: [""]
1026
- }),
1027
- __metadata("design:paramtypes", [MatDialog])
1028
- ], ServerLogsComponent);
1029
- return ServerLogsComponent;
1030
- }());
1031
-
1032
- var UpgradeLogsComponent = /** @class */ (function () {
1033
- function UpgradeLogsComponent() {
1034
- this.config = null;
1035
- this.logTypes = [];
1036
- }
1037
- UpgradeLogsComponent.prototype.ngOnInit = function () {
1038
- this._configList();
1039
- };
1040
- UpgradeLogsComponent.prototype._configList = function () {
1041
- var _this = this;
1042
- this.config = {
1043
- paging: false,
1044
- filters: [
1045
- {
1046
- type: ItemType.Keyword,
1047
- name: 'keyword',
1048
- label: 'Search'
1049
- }
1050
- ],
1051
- fetch: function (query) {
1052
- return _this.loadUpgradeLogs(query)
1053
- .pipe(map(function (response) { return ({ data: response.data, paging: response.paging }); }));
1054
- }
1055
- };
1056
- };
1057
- __decorate([
1058
- ViewChild(FsListComponent, { static: true }),
1059
- __metadata("design:type", FsListComponent)
1060
- ], UpgradeLogsComponent.prototype, "list", void 0);
1061
- __decorate([
1062
- Input(),
1063
- __metadata("design:type", Function)
1064
- ], UpgradeLogsComponent.prototype, "loadUpgradeLogs", void 0);
1065
- UpgradeLogsComponent = __decorate([
1066
- Component({
1067
- selector: 'fs-system-upgrade-logs',
1068
- 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",
1069
- styles: [""]
1070
- })
1071
- ], UpgradeLogsComponent);
1072
- return UpgradeLogsComponent;
1073
- }());
1074
-
1075
- var ApiLogComponent = /** @class */ (function () {
1076
- function ApiLogComponent(_dialogRef, data) {
1077
- this._dialogRef = _dialogRef;
1078
- this.data = data;
1079
- }
1080
- ApiLogComponent.prototype.ngOnInit = function () {
1081
- this.apiLogStates = indexNameValue(ApiLogStates);
1082
- if (this.data.apiLog) {
1083
- this.apiLog = this.data.apiLog;
1084
- }
1085
- };
1086
- ApiLogComponent.ctorParameters = function () { return [
1087
- { type: MatDialogRef },
1088
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
1089
- ]; };
1090
- ApiLogComponent = __decorate([
1091
- Component({
1092
- 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",
1093
- styles: [""]
1094
- }),
1095
- __param(1, Inject(MAT_DIALOG_DATA)),
1096
- __metadata("design:paramtypes", [MatDialogRef, Object])
1097
- ], ApiLogComponent);
1098
- return ApiLogComponent;
1099
- }());
1100
-
1101
- var ApiLogsComponent = /** @class */ (function () {
1102
- function ApiLogsComponent(_dialog) {
1103
- this._dialog = _dialog;
1104
- this.config = null;
1105
- this.apiLogStates = indexNameValue(ApiLogStates);
1106
- }
1107
- ApiLogsComponent.prototype.ngOnInit = function () {
1108
- this._configList();
1109
- };
1110
- ApiLogsComponent.prototype._configList = function () {
1111
- var _this = this;
1112
- this.config = {
1113
- filters: [
1114
- {
1115
- type: ItemType.Keyword,
1116
- name: 'keyword',
1117
- label: 'Search'
1118
- },
1119
- {
1120
- type: ItemType.Select,
1121
- name: 'state',
1122
- label: 'Status',
1123
- values: ApiLogStates
1124
- },
1125
- {
1126
- name: 'createDate',
1127
- type: ItemType.DateRange,
1128
- label: ['From Date', 'To Date'],
1129
- }
1130
- ],
1131
- fetch: function (query) {
1132
- Object.assign(query, {});
1133
- return _this.loadApiLogs(query)
1134
- .pipe(map(function (response) { return ({ data: response.data, paging: response.paging }); }));
1135
- }
1136
- };
1137
- };
1138
- ApiLogsComponent.prototype.open = function (apiLog) {
1139
- this._dialog.open(ApiLogComponent, {
1140
- data: { apiLog: apiLog },
1141
- width: '85%'
1142
- });
1143
- };
1144
- ApiLogsComponent.ctorParameters = function () { return [
1145
- { type: MatDialog }
1146
- ]; };
1147
- __decorate([
1148
- ViewChild(FsListComponent, { static: true }),
1149
- __metadata("design:type", FsListComponent)
1150
- ], ApiLogsComponent.prototype, "list", void 0);
1151
- __decorate([
1152
- Input(),
1153
- __metadata("design:type", Function)
1154
- ], ApiLogsComponent.prototype, "loadApiLogs", void 0);
1155
- ApiLogsComponent = __decorate([
1156
- Component({
1157
- selector: 'fs-system-api-logs',
1158
- 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",
1159
- styles: [""]
1160
- }),
1161
- __metadata("design:paramtypes", [MatDialog])
1162
- ], ApiLogsComponent);
1163
- return ApiLogsComponent;
1164
- }());
1165
-
1166
- var InfoComponent = /** @class */ (function () {
1167
- function InfoComponent() {
1168
- }
1169
- InfoComponent.prototype.ngAfterViewInit = function () {
1170
- this._load();
1171
- };
1172
- InfoComponent.prototype._load = function () {
1173
- var _this = this;
1174
- this.load()
1175
- .subscribe(function (info) {
1176
- info += '<style>body { background: transparent; }</style>';
1177
- var doc = _this.iframe.nativeElement.contentDocument || _this.iframe.nativeElement.contentWindow;
1178
- doc.open();
1179
- doc.write(info);
1180
- doc.close();
1181
- var scrollHeight = (_this.iframe.nativeElement.contentWindow.document.documentElement.scrollHeight + 100);
1182
- _this.iframe.nativeElement.style.height = scrollHeight + "px";
1183
- });
1184
- };
1185
- __decorate([
1186
- ViewChild('iframe'),
1187
- __metadata("design:type", ElementRef)
1188
- ], InfoComponent.prototype, "iframe", void 0);
1189
- __decorate([
1190
- Input(),
1191
- __metadata("design:type", Function)
1192
- ], InfoComponent.prototype, "load", void 0);
1193
- InfoComponent = __decorate([
1194
- Component({
1195
- selector: 'fs-system-info',
1196
- template: "<iframe #iframe></iframe>\r\n",
1197
- changeDetection: ChangeDetectionStrategy.OnPush,
1198
- styles: ["iframe{width:100%;border:0}"]
1199
- })
1200
- ], InfoComponent);
1201
- return InfoComponent;
1202
- }());
1203
-
1204
- var FsSystemModule = /** @class */ (function () {
1205
- function FsSystemModule() {
1206
- }
1207
- FsSystemModule_1 = FsSystemModule;
1208
- FsSystemModule.forRoot = function (config) {
1209
- return {
1210
- ngModule: FsSystemModule_1,
1211
- providers: [
1212
- { provide: FS_SYSTEM_CONFIG, useValue: config || {} },
1213
- ]
1214
- };
1215
- };
1216
- var FsSystemModule_1;
1217
- FsSystemModule = FsSystemModule_1 = __decorate([
1218
- NgModule({
1219
- imports: [
1220
- CommonModule,
1221
- FlexLayoutModule,
1222
- FormsModule,
1223
- MatButtonModule,
1224
- MatExpansionModule,
1225
- MatTooltipModule,
1226
- MatIconModule,
1227
- MatFormFieldModule,
1228
- MatInputModule,
1229
- MatSelectModule,
1230
- MatDialogModule,
1231
- MatTabsModule,
1232
- FsDateModule,
1233
- FsSkeletonModule,
1234
- FsListModule,
1235
- FsFileModule,
1236
- FsFileManagerModule,
1237
- FsLabelModule,
1238
- FsDialogModule,
1239
- FsDatePickerModule,
1240
- FsMenuModule,
1241
- ClipboardModule,
1242
- ],
1243
- exports: [
1244
- DashboardComponent,
1245
- CronsComponent,
1246
- SettingsComponent,
1247
- FileManagerComponent,
1248
- ProcessesComponent,
1249
- ServerLogsComponent,
1250
- UpgradeLogsComponent,
1251
- ApiLogsComponent,
1252
- InfoComponent,
1253
- ],
1254
- declarations: [
1255
- DashboardComponent,
1256
- CronsComponent,
1257
- SettingsComponent,
1258
- KeyNameValuePipe,
1259
- FileManagerComponent,
1260
- ProcessesComponent,
1261
- ServerLogComponent,
1262
- ServerLogsComponent,
1263
- UpgradeLogsComponent,
1264
- ApiLogsComponent,
1265
- ApiLogComponent,
1266
- InfoComponent,
1267
- ProcessComponent,
1268
- CronComponent,
1269
- CronLogComponent,
1270
- ],
1271
- })
1272
- ], FsSystemModule);
1273
- return FsSystemModule;
1274
- }());
1275
-
1276
- /**
1277
- * Generated bundle index. Do not edit.
1278
- */
1279
-
1280
- 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 };
1281
- //# sourceMappingURL=firestitch-system.js.map