@firestitch/system 18.0.1 → 18.0.3
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/process/process.component.d.ts +1 -12
- package/app/modules/system/components/processes/processes.component.d.ts +3 -12
- package/app/modules/system/data/process.data.d.ts +17 -0
- package/esm2022/app/modules/system/components/cron-next-run/cron-next-run.component.mjs +3 -3
- package/esm2022/app/modules/system/components/process/process.component.mjs +15 -19
- package/esm2022/app/modules/system/components/processes/processes.component.mjs +65 -83
- package/esm2022/app/modules/system/data/process.data.mjs +45 -0
- package/fesm2022/firestitch-system.mjs +119 -101
- package/fesm2022/firestitch-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i2 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, ChangeDetectionStrategy, Inject, ViewChild, Input, NgModule,
|
|
4
|
+
import { Component, ChangeDetectionStrategy, Inject, ViewChild, Input, NgModule, Injectable, inject, Pipe, EventEmitter, Output, InjectionToken } from '@angular/core';
|
|
5
5
|
import * as i5$2 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
@@ -60,6 +60,7 @@ import * as i1$1 from '@firestitch/message';
|
|
|
60
60
|
import * as i3$2 from '@firestitch/prompt';
|
|
61
61
|
import { SelectionActionType } from '@firestitch/selection';
|
|
62
62
|
import * as i2$2 from '@firestitch/build';
|
|
63
|
+
import * as i1$2 from '@firestitch/api';
|
|
63
64
|
import * as i13 from '@angular/material/core';
|
|
64
65
|
|
|
65
66
|
class ExplainComponent {
|
|
@@ -694,11 +695,11 @@ class CronNextRunComponent {
|
|
|
694
695
|
return 0;
|
|
695
696
|
}
|
|
696
697
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CronNextRunComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
697
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: CronNextRunComponent, selector: "app-next-run", inputs: { cron: "cron" }, ngImport: i0, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true} }}\n</ng-container>\n
|
|
698
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: CronNextRunComponent, selector: "app-next-run", inputs: { cron: "cron" }, ngImport: i0, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{ duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true, maxOutputs: 2 } }}\n</ng-container>\n<ng-template #seconds>\n {{ duration }}s\n</ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
698
699
|
}
|
|
699
700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CronNextRunComponent, decorators: [{
|
|
700
701
|
type: Component,
|
|
701
|
-
args: [{ selector: 'app-next-run', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true} }}\n</ng-container>\n
|
|
702
|
+
args: [{ selector: 'app-next-run', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"duration > 60; else seconds\">\n {{ duration | fsDateDuration: { hours: true, seconds: true, minutes: true, days: true, maxOutputs: 2 } }}\n</ng-container>\n<ng-template #seconds>\n {{ duration }}s\n</ng-template>" }]
|
|
702
703
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { cron: [{
|
|
703
704
|
type: Input
|
|
704
705
|
}] } });
|
|
@@ -1038,6 +1039,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1038
1039
|
type: Input
|
|
1039
1040
|
}] } });
|
|
1040
1041
|
|
|
1042
|
+
class ProcessData {
|
|
1043
|
+
_api;
|
|
1044
|
+
constructor(_api) {
|
|
1045
|
+
this._api = _api;
|
|
1046
|
+
}
|
|
1047
|
+
gets(data = {}, config = {}) {
|
|
1048
|
+
return this._api.get('processes', data, { key: 'processes', ...config });
|
|
1049
|
+
}
|
|
1050
|
+
post(data = {}, config = {}) {
|
|
1051
|
+
return this._api.post('processes', data, { key: 'process', ...config });
|
|
1052
|
+
}
|
|
1053
|
+
run(data = {}, config = {}) {
|
|
1054
|
+
return this._api.post(`processes/${data.id}/run`, data, { key: 'process', ...config });
|
|
1055
|
+
}
|
|
1056
|
+
get(id, config = {}) {
|
|
1057
|
+
return this._api.get(`processes/${id}`, {}, { key: 'process', ...config });
|
|
1058
|
+
}
|
|
1059
|
+
kill(data = {}, config = {}) {
|
|
1060
|
+
return this._api.post(`processes/${data.id}/kill`, data, { key: 'process', ...config });
|
|
1061
|
+
}
|
|
1062
|
+
delete(data = {}, config = {}) {
|
|
1063
|
+
return this._api.delete(`processes/${data.id}`, data, { key: 'process', ...config });
|
|
1064
|
+
}
|
|
1065
|
+
queue(data = {}, config = {}) {
|
|
1066
|
+
return this._api.post(`processes/${data.id}/queue`, data, { key: 'process', ...config });
|
|
1067
|
+
}
|
|
1068
|
+
download(data = {}) {
|
|
1069
|
+
this._api
|
|
1070
|
+
.createApiFile(`processes/${data.id}/download`)
|
|
1071
|
+
.download();
|
|
1072
|
+
}
|
|
1073
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessData, deps: [{ token: i1$2.FsApi }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1074
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessData, providedIn: 'root' });
|
|
1075
|
+
}
|
|
1076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessData, decorators: [{
|
|
1077
|
+
type: Injectable,
|
|
1078
|
+
args: [{
|
|
1079
|
+
providedIn: 'root',
|
|
1080
|
+
}]
|
|
1081
|
+
}], ctorParameters: () => [{ type: i1$2.FsApi }] });
|
|
1082
|
+
|
|
1041
1083
|
class ProcessComponent {
|
|
1042
1084
|
data;
|
|
1043
1085
|
_message;
|
|
@@ -1048,6 +1090,7 @@ class ProcessComponent {
|
|
|
1048
1090
|
ProcessProcessStates = indexNameValue(ProcessProcessStates);
|
|
1049
1091
|
ProcessState = ProcessState;
|
|
1050
1092
|
_destroy$ = new Subject();
|
|
1093
|
+
_processData = inject(ProcessData);
|
|
1051
1094
|
constructor(data, _message, _cdRef, _prompt) {
|
|
1052
1095
|
this.data = data;
|
|
1053
1096
|
this._message = _message;
|
|
@@ -1055,19 +1098,13 @@ class ProcessComponent {
|
|
|
1055
1098
|
this._prompt = _prompt;
|
|
1056
1099
|
}
|
|
1057
1100
|
ngOnInit() {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
else {
|
|
1065
|
-
this.process = this.data.process;
|
|
1066
|
-
}
|
|
1101
|
+
this.load$()
|
|
1102
|
+
.subscribe(() => {
|
|
1103
|
+
this.runningRefresh();
|
|
1104
|
+
});
|
|
1067
1105
|
}
|
|
1068
1106
|
load$() {
|
|
1069
|
-
return this.data
|
|
1070
|
-
.loadProcess(this.data.process)
|
|
1107
|
+
return this._processData.get(this.data.process.id)
|
|
1071
1108
|
.pipe(tap((process) => {
|
|
1072
1109
|
this.process = process;
|
|
1073
1110
|
this._cdRef.markForCheck();
|
|
@@ -1083,14 +1120,14 @@ class ProcessComponent {
|
|
|
1083
1120
|
title: 'Kill process',
|
|
1084
1121
|
template: 'Are you sure you would like to kill the process?',
|
|
1085
1122
|
})
|
|
1086
|
-
.pipe(switchMap(() => this.
|
|
1123
|
+
.pipe(switchMap(() => this._processData.kill(this.data.process)), switchMap(() => this.load$()))
|
|
1087
1124
|
.subscribe(() => {
|
|
1088
1125
|
this._message.success('Killed process');
|
|
1089
1126
|
});
|
|
1090
1127
|
}
|
|
1091
1128
|
run() {
|
|
1092
1129
|
this._message.success('Running process');
|
|
1093
|
-
this.
|
|
1130
|
+
this._processData.run(this.data.process)
|
|
1094
1131
|
.pipe(switchMap(() => this.load$()))
|
|
1095
1132
|
.subscribe(() => {
|
|
1096
1133
|
this.runningRefresh();
|
|
@@ -1098,23 +1135,23 @@ class ProcessComponent {
|
|
|
1098
1135
|
}
|
|
1099
1136
|
queue() {
|
|
1100
1137
|
this._message.success('Running process');
|
|
1101
|
-
this.
|
|
1138
|
+
this._processData.queue(this.data.process)
|
|
1102
1139
|
.pipe(switchMap(() => this.load$()))
|
|
1103
1140
|
.subscribe();
|
|
1104
1141
|
}
|
|
1105
1142
|
download() {
|
|
1106
|
-
this.
|
|
1143
|
+
this._processData.download(this.data.process);
|
|
1107
1144
|
}
|
|
1108
1145
|
ngOnDestroy() {
|
|
1109
1146
|
this._destroy$.next(null);
|
|
1110
1147
|
this._destroy$.complete();
|
|
1111
1148
|
}
|
|
1112
1149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
|
|
1113
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: ProcessComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title
|
|
1150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: ProcessComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title>\n Process\n </div>\n <mat-dialog-content>\n <div class=\"column\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Name\n </fs-label>\n {{ process.prettyName }}\n </fs-label-field>\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div\n class=\"status\"\n [ngClass]=\"{ 'running': process.state === ProcessState.Running }\">\n {{ ProcessStates[process.state] }}\n <ng-container *ngIf=\"process.state === ProcessState.Running\">\n <mat-progress-spinner\n [diameter]=\"20\"\n [mode]=\"'indeterminate'\">\n </mat-progress-spinner>\n </ng-container>\n </div>\n </fs-label-field>\n <fs-label-field *ngIf=\"process.notify\">\n <fs-label>\n Notification Email\n </fs-label>\n {{ process.notify }}\n </fs-label-field>\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{ process.pid || 'None' }}\n <ng-container *ngIf=\"process.pid\">\n <div class=\"small\">\n {{ ProcessProcessStates[process.processState] || 'Unknown' }}\n </div>\n </ng-container>\n </fs-label-field>\n <fs-label-field *ngIf=\"process.createDate\">\n <fs-label>\n Create Date\n </fs-label>\n {{ process.createDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.startDate\">\n <fs-label>\n Start Date\n </fs-label>\n {{ process.startDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.endDate\">\n <fs-label>\n Complete Date\n </fs-label>\n {{ process.endDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.duration\">\n <fs-label>\n Duration\n </fs-label>\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </fs-label-field>\n </div>\n <fs-label-field *ngIf=\"process.message\">\n <fs-label>\n Message\n </fs-label>\n {{ process.message }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.log\">\n <fs-label>\n Log\n </fs-label>\n <div class=\"log\">\n {{ process.log }}\n </div>\n </fs-label-field>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"true\"\n color=\"primary\">\n Close\n </button>\n <button\n *ngIf=\"process.state === ProcessState.Running\"\n mat-button\n (click)=\"kill()\">\n Kill\n </button>\n <button\n *ngIf=\"process.state !== ProcessState.Running\"\n mat-button\n (click)=\"run()\">\n Run\n </button>\n <button\n *ngIf=\"(\n process.state !== ProcessState.Running && \n process.state !== ProcessState.Queued\n )\"\n mat-button\n (click)=\"queue()\">\n Queue\n </button>\n <button\n *ngIf=\"process.filename\"\n mat-button\n (click)=\"download()\">\n Download\n </button>\n </mat-dialog-actions>\n</fs-dialog>", styles: [".log{white-space:pre-line;font-family:monospace;font-size:95%;line-height:130%}.status{display:flex}.status.running{margin-right:28px}.status.running mat-progress-spinner{position:absolute;right:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "component", type: i8.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i8.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i9.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }, { kind: "pipe", type: i4$2.FsDateFormatPipe, name: "fsDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1114
1151
|
}
|
|
1115
1152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessComponent, decorators: [{
|
|
1116
1153
|
type: Component,
|
|
1117
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title
|
|
1154
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"process\">\n <div mat-dialog-title>\n Process\n </div>\n <mat-dialog-content>\n <div class=\"column\">\n <div class=\"fs-row.gap-lg.wrap.align-start\">\n <fs-label-field>\n <fs-label>\n Name\n </fs-label>\n {{ process.prettyName }}\n </fs-label-field>\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n <div\n class=\"status\"\n [ngClass]=\"{ 'running': process.state === ProcessState.Running }\">\n {{ ProcessStates[process.state] }}\n <ng-container *ngIf=\"process.state === ProcessState.Running\">\n <mat-progress-spinner\n [diameter]=\"20\"\n [mode]=\"'indeterminate'\">\n </mat-progress-spinner>\n </ng-container>\n </div>\n </fs-label-field>\n <fs-label-field *ngIf=\"process.notify\">\n <fs-label>\n Notification Email\n </fs-label>\n {{ process.notify }}\n </fs-label-field>\n <fs-label-field>\n <fs-label>\n Process ID\n </fs-label>\n {{ process.pid || 'None' }}\n <ng-container *ngIf=\"process.pid\">\n <div class=\"small\">\n {{ ProcessProcessStates[process.processState] || 'Unknown' }}\n </div>\n </ng-container>\n </fs-label-field>\n <fs-label-field *ngIf=\"process.createDate\">\n <fs-label>\n Create Date\n </fs-label>\n {{ process.createDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.startDate\">\n <fs-label>\n Start Date\n </fs-label>\n {{ process.startDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.endDate\">\n <fs-label>\n Complete Date\n </fs-label>\n {{ process.endDate | fsDateFormat: 'date-time' }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.duration\">\n <fs-label>\n Duration\n </fs-label>\n {{ process.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </fs-label-field>\n </div>\n <fs-label-field *ngIf=\"process.message\">\n <fs-label>\n Message\n </fs-label>\n {{ process.message }}\n </fs-label-field>\n <fs-label-field *ngIf=\"process.log\">\n <fs-label>\n Log\n </fs-label>\n <div class=\"log\">\n {{ process.log }}\n </div>\n </fs-label-field>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"true\"\n color=\"primary\">\n Close\n </button>\n <button\n *ngIf=\"process.state === ProcessState.Running\"\n mat-button\n (click)=\"kill()\">\n Kill\n </button>\n <button\n *ngIf=\"process.state !== ProcessState.Running\"\n mat-button\n (click)=\"run()\">\n Run\n </button>\n <button\n *ngIf=\"(\n process.state !== ProcessState.Running && \n process.state !== ProcessState.Queued\n )\"\n mat-button\n (click)=\"queue()\">\n Queue\n </button>\n <button\n *ngIf=\"process.filename\"\n mat-button\n (click)=\"download()\">\n Download\n </button>\n </mat-dialog-actions>\n</fs-dialog>", styles: [".log{white-space:pre-line;font-family:monospace;font-size:95%;line-height:130%}.status{display:flex}.status.running{margin-right:28px}.status.running mat-progress-spinner{position:absolute;right:0}\n"] }]
|
|
1118
1155
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1119
1156
|
type: Inject,
|
|
1120
1157
|
args: [MAT_DIALOG_DATA]
|
|
@@ -1124,18 +1161,12 @@ class ProcessesComponent {
|
|
|
1124
1161
|
_dialog;
|
|
1125
1162
|
_message;
|
|
1126
1163
|
list;
|
|
1127
|
-
loadProcesses;
|
|
1128
|
-
loadProcess;
|
|
1129
|
-
run;
|
|
1130
|
-
kill;
|
|
1131
|
-
delete;
|
|
1132
|
-
download;
|
|
1133
|
-
queue;
|
|
1134
1164
|
actions = [];
|
|
1135
1165
|
config = null;
|
|
1136
1166
|
ProcessStates = indexNameValue(ProcessStates);
|
|
1137
1167
|
ProcessState = ProcessState;
|
|
1138
1168
|
_destroy$ = new Subject();
|
|
1169
|
+
_processData = inject(ProcessData);
|
|
1139
1170
|
constructor(_dialog, _message) {
|
|
1140
1171
|
this._dialog = _dialog;
|
|
1141
1172
|
this._message = _message;
|
|
@@ -1147,14 +1178,10 @@ class ProcessesComponent {
|
|
|
1147
1178
|
this.list.reload();
|
|
1148
1179
|
}
|
|
1149
1180
|
open(process) {
|
|
1150
|
-
this._dialog
|
|
1181
|
+
this._dialog
|
|
1182
|
+
.open(ProcessComponent, {
|
|
1151
1183
|
data: {
|
|
1152
1184
|
process,
|
|
1153
|
-
download: this.download,
|
|
1154
|
-
run: this.run,
|
|
1155
|
-
loadProcess: this.loadProcess,
|
|
1156
|
-
queue: this.queue,
|
|
1157
|
-
kill: this.kill,
|
|
1158
1185
|
},
|
|
1159
1186
|
width: '85%',
|
|
1160
1187
|
})
|
|
@@ -1168,10 +1195,66 @@ class ProcessesComponent {
|
|
|
1168
1195
|
this._destroy$.next(null);
|
|
1169
1196
|
this._destroy$.complete();
|
|
1170
1197
|
}
|
|
1198
|
+
download(process) {
|
|
1199
|
+
this._processData.download(process);
|
|
1200
|
+
}
|
|
1171
1201
|
_configList() {
|
|
1172
1202
|
this.config = {
|
|
1173
1203
|
actions: [],
|
|
1174
|
-
rowActions: [
|
|
1204
|
+
rowActions: [
|
|
1205
|
+
{
|
|
1206
|
+
label: 'Run',
|
|
1207
|
+
show: (process) => {
|
|
1208
|
+
return process.state !== ProcessState.Running;
|
|
1209
|
+
},
|
|
1210
|
+
click: (data) => {
|
|
1211
|
+
this._message.info('Running process...');
|
|
1212
|
+
this._processData.run(data)
|
|
1213
|
+
.subscribe(() => {
|
|
1214
|
+
this.reload();
|
|
1215
|
+
this._message.success('Ran process');
|
|
1216
|
+
});
|
|
1217
|
+
},
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
label: 'Queue',
|
|
1221
|
+
show: (process) => {
|
|
1222
|
+
return process.state !== ProcessState.Running &&
|
|
1223
|
+
process.state !== ProcessState.Queued;
|
|
1224
|
+
},
|
|
1225
|
+
click: (data) => {
|
|
1226
|
+
this._processData.queue(data)
|
|
1227
|
+
.subscribe(() => {
|
|
1228
|
+
this.reload();
|
|
1229
|
+
this._message.success('Queued process');
|
|
1230
|
+
});
|
|
1231
|
+
},
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
label: 'Kill',
|
|
1235
|
+
show: (data) => {
|
|
1236
|
+
return !!data.pid;
|
|
1237
|
+
},
|
|
1238
|
+
click: (data) => {
|
|
1239
|
+
this._message.info('Killing process...');
|
|
1240
|
+
this._processData.kill(data)
|
|
1241
|
+
.subscribe(() => {
|
|
1242
|
+
this.reload();
|
|
1243
|
+
this._message.success('Killed process');
|
|
1244
|
+
});
|
|
1245
|
+
},
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
label: 'Delete',
|
|
1249
|
+
click: (data) => {
|
|
1250
|
+
this._processData.delete(data)
|
|
1251
|
+
.subscribe(() => {
|
|
1252
|
+
this.reload();
|
|
1253
|
+
this._message.success('Deleted process');
|
|
1254
|
+
});
|
|
1255
|
+
},
|
|
1256
|
+
},
|
|
1257
|
+
],
|
|
1175
1258
|
filters: [
|
|
1176
1259
|
{
|
|
1177
1260
|
type: ItemType.Keyword,
|
|
@@ -1186,61 +1269,10 @@ class ProcessesComponent {
|
|
|
1186
1269
|
},
|
|
1187
1270
|
],
|
|
1188
1271
|
fetch: (query) => {
|
|
1189
|
-
return this.
|
|
1272
|
+
return this._processData.gets(query)
|
|
1190
1273
|
.pipe(map((response) => ({ data: response.data, paging: response.paging })));
|
|
1191
1274
|
},
|
|
1192
1275
|
};
|
|
1193
|
-
if (this.run) {
|
|
1194
|
-
this.config.rowActions
|
|
1195
|
-
.push({
|
|
1196
|
-
label: 'Run',
|
|
1197
|
-
show: (process) => {
|
|
1198
|
-
return process.state !== ProcessState.Running;
|
|
1199
|
-
},
|
|
1200
|
-
click: (data) => {
|
|
1201
|
-
this._message.info('Running process...');
|
|
1202
|
-
this.run(data)
|
|
1203
|
-
.subscribe(() => {
|
|
1204
|
-
this.reload();
|
|
1205
|
-
this._message.success('Succesfully ran process');
|
|
1206
|
-
});
|
|
1207
|
-
setTimeout(() => {
|
|
1208
|
-
this.reload();
|
|
1209
|
-
}, 500);
|
|
1210
|
-
},
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
|
-
if (this.kill) {
|
|
1214
|
-
this.config.rowActions.push({
|
|
1215
|
-
label: 'Kill',
|
|
1216
|
-
show: (data) => {
|
|
1217
|
-
return !!data.pid;
|
|
1218
|
-
},
|
|
1219
|
-
click: (data) => {
|
|
1220
|
-
this._message.info('Killing process...');
|
|
1221
|
-
this.kill(data)
|
|
1222
|
-
.subscribe(() => {
|
|
1223
|
-
this.reload();
|
|
1224
|
-
this._message.success('Succesfully killed process');
|
|
1225
|
-
});
|
|
1226
|
-
setTimeout(() => {
|
|
1227
|
-
this.reload();
|
|
1228
|
-
}, 500);
|
|
1229
|
-
},
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
if (this.delete) {
|
|
1233
|
-
this.config.rowActions.push({
|
|
1234
|
-
label: 'Delete',
|
|
1235
|
-
click: (data) => {
|
|
1236
|
-
this.delete(data)
|
|
1237
|
-
.subscribe(() => {
|
|
1238
|
-
this.reload();
|
|
1239
|
-
this._message.success('Deleted process');
|
|
1240
|
-
});
|
|
1241
|
-
},
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
1276
|
this.actions.forEach((action) => {
|
|
1245
1277
|
this.config.actions.push({
|
|
1246
1278
|
primary: false,
|
|
@@ -1265,7 +1297,7 @@ class ProcessesComponent {
|
|
|
1265
1297
|
});
|
|
1266
1298
|
}
|
|
1267
1299
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessesComponent, deps: [{ token: i1.MatDialog }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
|
|
1268
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: ProcessesComponent, selector: "fs-system-processes", inputs: {
|
|
1300
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: ProcessesComponent, selector: "fs-system-processes", inputs: { actions: "actions" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column>\n <ng-template fs-list-header>Name</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.prettyName}}</a>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Status</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ProcessStates[row.state]}}\n <small>\n <div *ngIf=\"row.state===ProcessState.Running && row.percent\">Complete: {{ row.percent }}%</div>\n <div *ngIf=\"row.state===ProcessState.Completed && row.filename\">Download: <a href=\"javascript:;\" (click)=\"download(row)\">{{ row.filename }}</a></div>\n <div *ngIf=\"row.pid\">PID: {{ row.pid }}</div>\n <div *ngIf=\"row.state===ProcessState.Running && row.notify\">Notify: {{ row.notify }}</div>\n </small>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Duration</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.duration | fsDateDuration: {hours: true, minutes: true, seconds: true} }}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Message</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Completed</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.endDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$2.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "component", type: i5.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i5.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i5.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i5.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i4$2.FsDateDurationPipe, name: "fsDateDuration" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1269
1301
|
}
|
|
1270
1302
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ProcessesComponent, decorators: [{
|
|
1271
1303
|
type: Component,
|
|
@@ -1273,20 +1305,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1273
1305
|
}], ctorParameters: () => [{ type: i1.MatDialog }, { type: i1$1.FsMessage }], propDecorators: { list: [{
|
|
1274
1306
|
type: ViewChild,
|
|
1275
1307
|
args: [FsListComponent]
|
|
1276
|
-
}], loadProcesses: [{
|
|
1277
|
-
type: Input
|
|
1278
|
-
}], loadProcess: [{
|
|
1279
|
-
type: Input
|
|
1280
|
-
}], run: [{
|
|
1281
|
-
type: Input
|
|
1282
|
-
}], kill: [{
|
|
1283
|
-
type: Input
|
|
1284
|
-
}], delete: [{
|
|
1285
|
-
type: Input
|
|
1286
|
-
}], download: [{
|
|
1287
|
-
type: Input
|
|
1288
|
-
}], queue: [{
|
|
1289
|
-
type: Input
|
|
1290
1308
|
}], actions: [{
|
|
1291
1309
|
type: Input
|
|
1292
1310
|
}] } });
|