@firestitch/system 13.0.2 → 13.0.4
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.
- package/app/modules/system/components/cron/cron.component.d.ts +2 -1
- package/app/modules/system/components/crons/crons.component.d.ts +3 -2
- package/app/modules/system/consts/cron-process-states.const.d.ts +4 -0
- package/app/modules/system/consts/index.d.ts +4 -1
- package/app/modules/system/consts/setting-interface-types.const.d.ts +5 -0
- package/esm2020/app/modules/system/components/cron/cron.component.mjs +9 -8
- package/esm2020/app/modules/system/components/cron-log/cron-log.component.mjs +1 -1
- package/esm2020/app/modules/system/components/crons/crons.component.mjs +68 -64
- package/esm2020/app/modules/system/consts/cron-process-states.const.mjs +5 -0
- package/esm2020/app/modules/system/consts/cron-states.const.mjs +1 -1
- package/esm2020/app/modules/system/consts/index.mjs +5 -2
- package/esm2020/app/modules/system/consts/setting-interface-types.const.mjs +12 -0
- package/fesm2015/firestitch-system.mjs +98 -80
- package/fesm2015/firestitch-system.mjs.map +1 -1
- package/fesm2020/firestitch-system.mjs +107 -86
- package/fesm2020/firestitch-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -326,6 +326,32 @@ var CronLogState;
|
|
|
326
326
|
CronLogState["LongRunning"] = "long_running";
|
|
327
327
|
})(CronLogState || (CronLogState = {}));
|
|
328
328
|
|
|
329
|
+
const ApiLogStates = [
|
|
330
|
+
{ name: 'Success', value: ApiLogState.Success },
|
|
331
|
+
{ name: 'Failed', value: ApiLogState.Failed },
|
|
332
|
+
{ name: 'Deleted', value: ApiLogState.Deleted }
|
|
333
|
+
];
|
|
334
|
+
|
|
335
|
+
const CronLogStates = [
|
|
336
|
+
{ name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
|
|
337
|
+
{ name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
|
|
338
|
+
{ name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
|
|
339
|
+
{ name: 'Enabled', value: CronLogState.Enabled, color: '#29B7FF' },
|
|
340
|
+
{ name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
|
|
341
|
+
{ name: 'Started', value: CronLogState.Started, color: '#D17333' },
|
|
342
|
+
{ name: 'Running', value: CronLogState.Running, color: '#34BD43' },
|
|
343
|
+
{ name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
|
|
344
|
+
{ name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
|
|
345
|
+
{ name: 'Killed', value: CronLogState.Killed, color: '#FA7567' },
|
|
346
|
+
{ name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
|
|
347
|
+
{ name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
|
|
348
|
+
];
|
|
349
|
+
|
|
350
|
+
const CronProcessStates = [
|
|
351
|
+
{ name: 'Running', value: 'running' },
|
|
352
|
+
{ name: 'Stopped', value: 'stopped' },
|
|
353
|
+
];
|
|
354
|
+
|
|
329
355
|
const CronStates = [
|
|
330
356
|
{ name: 'Running', value: CronState.Running },
|
|
331
357
|
{ name: 'Idle', value: CronState.Idle },
|
|
@@ -336,12 +362,6 @@ const CronStates = [
|
|
|
336
362
|
{ name: 'Enabled', value: CronState.Enabled },
|
|
337
363
|
];
|
|
338
364
|
|
|
339
|
-
const ApiLogStates = [
|
|
340
|
-
{ name: 'Success', value: ApiLogState.Success },
|
|
341
|
-
{ name: 'Failed', value: ApiLogState.Failed },
|
|
342
|
-
{ name: 'Deleted', value: ApiLogState.Deleted }
|
|
343
|
-
];
|
|
344
|
-
|
|
345
365
|
const ProcessStates = [
|
|
346
366
|
{ name: 'Queued', value: ProcessState.Queued },
|
|
347
367
|
{ name: 'Running', value: ProcessState.Running },
|
|
@@ -351,6 +371,17 @@ const ProcessStates = [
|
|
|
351
371
|
{ name: 'Deleted', value: ProcessState.Deleted }
|
|
352
372
|
];
|
|
353
373
|
|
|
374
|
+
const SettingInterfaceTypes = [
|
|
375
|
+
{ name: 'RadioButton', value: SettingInterfaceType.RadioButton },
|
|
376
|
+
{ name: 'InputBox', value: SettingInterfaceType.InputBox },
|
|
377
|
+
{ name: 'Textarea', value: SettingInterfaceType.Textarea },
|
|
378
|
+
{ name: 'DropDown', value: SettingInterfaceType.Select },
|
|
379
|
+
{ name: 'File', value: SettingInterfaceType.File },
|
|
380
|
+
{ name: 'Static', value: SettingInterfaceType.Static },
|
|
381
|
+
{ name: 'Password', value: SettingInterfaceType.Password },
|
|
382
|
+
{ name: 'Color', value: SettingInterfaceType.Color }
|
|
383
|
+
];
|
|
384
|
+
|
|
354
385
|
function indexNameValue(arry) {
|
|
355
386
|
const obj = {};
|
|
356
387
|
arry.forEach(item => {
|
|
@@ -438,21 +469,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
438
469
|
type: Input
|
|
439
470
|
}] } });
|
|
440
471
|
|
|
441
|
-
const CronLogStates = [
|
|
442
|
-
{ name: 'Message', value: CronLogState.Message, color: '#29B7FF' },
|
|
443
|
-
{ name: 'Disabled', value: CronLogState.Disabled, color: '#29B7FF' },
|
|
444
|
-
{ name: 'Reset', value: CronLogState.Reset, color: '#29B7FF' },
|
|
445
|
-
{ name: 'Enabled', value: CronLogState.Enabled, color: '#29B7FF' },
|
|
446
|
-
{ name: 'Queued', value: CronLogState.Queued, color: '#29B7FF' },
|
|
447
|
-
{ name: 'Started', value: CronLogState.Started, color: '#D17333' },
|
|
448
|
-
{ name: 'Running', value: CronLogState.Running, color: '#34BD43' },
|
|
449
|
-
{ name: 'Completed', value: CronLogState.Completed, color: '#34BD43' },
|
|
450
|
-
{ name: 'Failed', value: CronLogState.Failed, color: '#FA7567' },
|
|
451
|
-
{ name: 'Killed', value: CronLogState.Killed, color: '#FA7567' },
|
|
452
|
-
{ name: 'Stagnant', value: CronLogState.Stagnant, color: '#FA7567' },
|
|
453
|
-
{ name: 'Long Running', value: CronLogState.LongRunning, color: '#FA7567' },
|
|
454
|
-
];
|
|
455
|
-
|
|
456
472
|
class CronLogComponent {
|
|
457
473
|
constructor(_data) {
|
|
458
474
|
this._data = _data;
|
|
@@ -487,6 +503,7 @@ class CronComponent {
|
|
|
487
503
|
this._cdRef = _cdRef;
|
|
488
504
|
this.tabIndex = 0;
|
|
489
505
|
this.CronStates = indexNameValue(CronStates);
|
|
506
|
+
this.CronProcessStates = indexNameValue(CronProcessStates);
|
|
490
507
|
this.CronLogStates = indexNameValue(CronLogStates);
|
|
491
508
|
this.CronLogStateColors = {};
|
|
492
509
|
}
|
|
@@ -503,7 +520,7 @@ class CronComponent {
|
|
|
503
520
|
data: {
|
|
504
521
|
cronLog,
|
|
505
522
|
},
|
|
506
|
-
width: '85%'
|
|
523
|
+
width: '85%',
|
|
507
524
|
});
|
|
508
525
|
}
|
|
509
526
|
cronActionClick(cronAction) {
|
|
@@ -552,10 +569,10 @@ class CronComponent {
|
|
|
552
569
|
}
|
|
553
570
|
}
|
|
554
571
|
CronComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
555
|
-
CronComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"cron\">\
|
|
572
|
+
CronComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", 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 *ngIf=\"cron.processId\">\n <fs-label>\n Process\n </fs-label>\n {{cron.processId}}\n <ng-container *ngIf=\"cron.processState\">\n <div class=\"small\">\n {{CronProcessStates[cron.processState]}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Last Ran\n </fs-label>\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\n </ng-template>\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"cron.message\">\n <fs-label>\n Last Message\n </fs-label>\n <div class=\"message\">{{cron.message}}</div>\n </fs-label-field>\n </mat-tab>\n <mat-tab label=\"Logs\" *ngIf=\"config\">\n <ng-template matTabContent>\n <fs-list [config]=\"config\">\n <fs-list-column name=\"state\" title=\"Status\">\n <ng-template fs-list-cell let-row=\"row\">\n <a \n (click)=\"cronLogOpen(row)\"\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\n {{CronLogStates[row.state] || row.state}}\n </a>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Message\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"message\">{{row.message}}</div>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Duration\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration\">\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\n </ng-container>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list> \n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions> \n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n <ng-container *ngIf=\"tabIndex === 0\">\n <button \n *ngFor=\"let cronAction of cronActions\"\n mat-button \n (click)=\"cronActionClick(cronAction)\">\n {{cronAction.label}}\n </button> \n </ng-container>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [":host ::ng-deep .col-message .message{white-space:break-spaces;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}:host ::ng-deep .col-date{white-space:nowrap}h1 .small{line-height:normal}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}.message{white-space:pre-line}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i3.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.MatTabContent, selector: "[matTabContent]" }, { type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
556
573
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronComponent, decorators: [{
|
|
557
574
|
type: Component,
|
|
558
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"cron\">\
|
|
575
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"cron\">\n <h1 mat-dialog-title>\n Cron\n <div class=\"small\">{{cron.name}}</div>\n </h1>\n <mat-dialog-content>\n <mat-tab-group (selectedIndexChange)=\"selectedIndexChange($event)\">\n <mat-tab label=\"Overview\">\n <div class=\"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 *ngIf=\"cron.processId\">\n <fs-label>\n Process\n </fs-label>\n {{cron.processId}}\n <ng-container *ngIf=\"cron.processState\">\n <div class=\"small\">\n {{CronProcessStates[cron.processState]}}\n </div>\n </ng-container>\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Last Ran\n </fs-label>\n <ng-container *ngIf=\"cron.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"cron.createDate\"></fs-date-ago>\n <div><small *ngIf=\"cron.duration\">Duration: {{ cron.duration | fsDateDuration }}</small></div>\n </ng-template>\n </fs-label-field>\n </div>\n\n <fs-label-field *ngIf=\"cron.message\">\n <fs-label>\n Last Message\n </fs-label>\n <div class=\"message\">{{cron.message}}</div>\n </fs-label-field>\n </mat-tab>\n <mat-tab label=\"Logs\" *ngIf=\"config\">\n <ng-template matTabContent>\n <fs-list [config]=\"config\">\n <fs-list-column name=\"state\" title=\"Status\">\n <ng-template fs-list-cell let-row=\"row\">\n <a \n (click)=\"cronLogOpen(row)\"\n [ngStyle]=\"{ color: CronLogStateColors[row.state] }\">\n {{CronLogStates[row.state] || row.state}}\n </a>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Message\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"message\">{{row.message}}</div>\n </ng-template>\n </fs-list-column>\n \n <fs-list-column title=\"Duration\" class=\"col-message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration\">\n {{row.duration | fsDateDuration: 'hour-minute-second'}}\n </ng-container>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column name=\"create_date\" title=\"Date\" class=\"col-date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list> \n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions> \n <button \n mat-button \n [mat-dialog-close]=\"true\" \n color=\"primary\">\n Done\n </button>\n <ng-container *ngIf=\"tabIndex === 0\">\n <button \n *ngFor=\"let cronAction of cronActions\"\n mat-button \n (click)=\"cronActionClick(cronAction)\">\n {{cronAction.label}}\n </button> \n </ng-container>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [":host ::ng-deep .col-message .message{white-space:break-spaces;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}:host ::ng-deep .col-date{white-space:nowrap}h1 .small{line-height:normal}.row{display:flex;flex-wrap:wrap}.row fs-label-field:not(:last-child){margin-right:40px}.message{white-space:pre-line}\n"] }]
|
|
559
576
|
}], ctorParameters: function () {
|
|
560
577
|
return [{ type: undefined, decorators: [{
|
|
561
578
|
type: Inject,
|
|
@@ -569,66 +586,14 @@ class CronsComponent {
|
|
|
569
586
|
this._dialog = _dialog;
|
|
570
587
|
this._prompt = _prompt;
|
|
571
588
|
this.config = null;
|
|
572
|
-
this.
|
|
589
|
+
this.CronStates = indexNameValue(CronStates);
|
|
590
|
+
this.CronProcessStates = indexNameValue(CronProcessStates);
|
|
573
591
|
this.CronState = CronState;
|
|
574
592
|
this._destroy$ = new Subject();
|
|
575
593
|
}
|
|
576
594
|
ngOnInit() {
|
|
577
595
|
this._configList();
|
|
578
596
|
}
|
|
579
|
-
_configList() {
|
|
580
|
-
this.config = {
|
|
581
|
-
paging: false,
|
|
582
|
-
filters: [
|
|
583
|
-
{
|
|
584
|
-
type: ItemType.Keyword,
|
|
585
|
-
name: 'keyword',
|
|
586
|
-
label: 'Search',
|
|
587
|
-
},
|
|
588
|
-
],
|
|
589
|
-
rowActions: this.getCronActions()
|
|
590
|
-
.map((rowAction) => {
|
|
591
|
-
return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
|
|
592
|
-
rowAction.action(cron)
|
|
593
|
-
.subscribe();
|
|
594
|
-
} });
|
|
595
|
-
}),
|
|
596
|
-
fetch: (query) => {
|
|
597
|
-
query.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
598
|
-
return this.loadCrons(query)
|
|
599
|
-
.pipe(map((crons) => ({
|
|
600
|
-
data: crons
|
|
601
|
-
.map((cron) => {
|
|
602
|
-
return Object.assign(Object.assign({}, cron), { runningDuration: differenceInSeconds(parse(cron.createDate), new Date()) });
|
|
603
|
-
}),
|
|
604
|
-
})));
|
|
605
|
-
},
|
|
606
|
-
};
|
|
607
|
-
if (this.bulk) {
|
|
608
|
-
this.config.selection = {
|
|
609
|
-
selectAll: false,
|
|
610
|
-
actions: [
|
|
611
|
-
{
|
|
612
|
-
type: SelectionActionType.Action,
|
|
613
|
-
name: 'disable',
|
|
614
|
-
label: 'Disable',
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
type: SelectionActionType.Action,
|
|
618
|
-
name: 'enable',
|
|
619
|
-
label: 'Enable',
|
|
620
|
-
},
|
|
621
|
-
],
|
|
622
|
-
actionSelected: (action) => {
|
|
623
|
-
return this.bulk(action.action.name, action.selected)
|
|
624
|
-
.pipe(tap(() => {
|
|
625
|
-
this.list.reload();
|
|
626
|
-
this._message.success('Applied Changes');
|
|
627
|
-
}));
|
|
628
|
-
},
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
597
|
open(cron) {
|
|
633
598
|
this._dialog.open(CronComponent, {
|
|
634
599
|
data: {
|
|
@@ -736,12 +701,65 @@ class CronsComponent {
|
|
|
736
701
|
this._destroy$.next();
|
|
737
702
|
this._destroy$.complete();
|
|
738
703
|
}
|
|
704
|
+
_configList() {
|
|
705
|
+
this.config = {
|
|
706
|
+
paging: false,
|
|
707
|
+
filters: [
|
|
708
|
+
{
|
|
709
|
+
type: ItemType.Keyword,
|
|
710
|
+
name: 'keyword',
|
|
711
|
+
label: 'Search',
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
rowActions: this.getCronActions()
|
|
715
|
+
.map((rowAction) => {
|
|
716
|
+
return Object.assign(Object.assign({}, rowAction), { click: (cron) => {
|
|
717
|
+
rowAction.action(cron)
|
|
718
|
+
.subscribe();
|
|
719
|
+
} });
|
|
720
|
+
}),
|
|
721
|
+
fetch: (query) => {
|
|
722
|
+
query = Object.assign(Object.assign({}, query), { timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
723
|
+
return this.loadCrons(query)
|
|
724
|
+
.pipe(map((crons) => ({
|
|
725
|
+
data: crons
|
|
726
|
+
.map((cron) => {
|
|
727
|
+
return Object.assign(Object.assign({}, cron), { runningDuration: differenceInSeconds(parse(cron.createDate), new Date()) });
|
|
728
|
+
}),
|
|
729
|
+
})));
|
|
730
|
+
},
|
|
731
|
+
};
|
|
732
|
+
if (this.bulk) {
|
|
733
|
+
this.config.selection = {
|
|
734
|
+
selectAll: false,
|
|
735
|
+
actions: [
|
|
736
|
+
{
|
|
737
|
+
type: SelectionActionType.Action,
|
|
738
|
+
name: 'disable',
|
|
739
|
+
label: 'Disable',
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
type: SelectionActionType.Action,
|
|
743
|
+
name: 'enable',
|
|
744
|
+
label: 'Enable',
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
actionSelected: (action) => {
|
|
748
|
+
return this.bulk(action.action.name, action.selected)
|
|
749
|
+
.pipe(tap(() => {
|
|
750
|
+
this.list.reload();
|
|
751
|
+
this._message.success('Applied Changes');
|
|
752
|
+
}));
|
|
753
|
+
},
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
}
|
|
739
757
|
}
|
|
740
758
|
CronsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronsComponent, deps: [{ token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i3$3.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
|
|
741
|
-
CronsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronsComponent, selector: "fs-system-crons", inputs: { enable: "enable", disable: "disable", kill: "kill", queue: "queue", run: "run", loadCrons: "loadCrons", loadCron: "loadCron", loadCronLogs: "loadCronLogs", bulk: "bulk" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\
|
|
759
|
+
CronsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CronsComponent, selector: "fs-system-crons", inputs: { enable: "enable", disable: "disable", kill: "kill", queue: "queue", run: "run", loadCrons: "loadCrons", loadCron: "loadCron", loadCronLogs: "loadCronLogs", bulk: "bulk" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n <div *ngIf=\"row.cronSetting\">\n <small>{{row.cronSetting.summary}}</small>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column align=\"center\">\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.host || row.processId; else status\">\n <fs-popover \n [maxWidth]=\"null\"\n [template]=\"statusPopover\" \n size=\"small\">\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\n </fs-popover>\n <ng-template #statusPopover>\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\n <div *ngIf=\"row.processState\">Process State: {{CronProcessStates[row.processState]}}</div>\n </ng-template>\n </ng-container>\n <ng-template #status>\n {{CronStates[row.state]}}\n </ng-template>\n <ng-container *ngIf=\"row.state === CronState.Running\">\n <div class=\"small\">\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-container> \n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Last Ran</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div class=\"small\" *ngIf=\"row.duration\">\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i7.FsPopoverComponent, selector: "fs-popover" }, { type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "fsDateDuration": i4$2.FsDateDurationPipe } });
|
|
742
760
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CronsComponent, decorators: [{
|
|
743
761
|
type: Component,
|
|
744
|
-
args: [{ selector: 'fs-system-crons', template: "<fs-list [config]=\"config\">\
|
|
762
|
+
args: [{ selector: 'fs-system-crons', template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n <div *ngIf=\"row.cronSetting\">\n <small>{{row.cronSetting.summary}}</small>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column align=\"center\">\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.host || row.processId; else status\">\n <fs-popover \n [maxWidth]=\"null\"\n [template]=\"statusPopover\" \n size=\"small\">\n <ng-container *ngTemplateOutlet=\"status\"></ng-container>\n </fs-popover>\n <ng-template #statusPopover>\n <div *ngIf=\"row.host\">Host: {{row.host}}</div>\n <div *ngIf=\"row.processId\">Process ID: {{row.processId}}</div>\n <div *ngIf=\"row.processState\">Process State: {{CronProcessStates[row.processState]}}</div>\n </ng-template>\n </ng-container>\n <ng-template #status>\n {{CronStates[row.state]}}\n </ng-template>\n <ng-container *ngIf=\"row.state === CronState.Running\">\n <div class=\"small\">\n Duration: {{ row.runningDuration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-container> \n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>Last Ran</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.duration===null; else lastRan\">\n Never\n </ng-container>\n <ng-template #lastRan>\n <fs-date-ago [date]=\"row.createDate\"></fs-date-ago>\n <div class=\"small\" *ngIf=\"row.duration\">\n Duration: {{ row.duration | fsDateDuration: { hours: true, minutes: true, seconds: true } }}\n </div>\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""] }]
|
|
745
763
|
}], ctorParameters: function () { return [{ type: i1$1.FsMessage }, { type: i1.MatDialog }, { type: i3$3.FsPrompt }]; }, propDecorators: { list: [{
|
|
746
764
|
type: ViewChild,
|
|
747
765
|
args: [FsListComponent, { static: true }]
|