@esfaenza/admin-module 11.2.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.
- package/README.md +24 -0
- package/bundles/esfaenza-admin-module.umd.js +1667 -0
- package/bundles/esfaenza-admin-module.umd.js.map +1 -0
- package/bundles/esfaenza-admin-module.umd.min.js +16 -0
- package/bundles/esfaenza-admin-module.umd.min.js.map +1 -0
- package/esfaenza-admin-module.d.ts +17 -0
- package/esfaenza-admin-module.metadata.json +1 -0
- package/esm2015/esfaenza-admin-module.js +18 -0
- package/esm2015/lib/admin-module.module.js +89 -0
- package/esm2015/lib/communications/base/BaseModuleCommunicationsConsumer.js +3 -0
- package/esm2015/lib/components/audits/adm_audits.component.js +109 -0
- package/esm2015/lib/components/audits/adm_audits.component.loc.js +30 -0
- package/esm2015/lib/components/enqueues/adm_enq.component.js +91 -0
- package/esm2015/lib/components/enqueues/adm_enq.component.loc.js +19 -0
- package/esm2015/lib/components/logs/adm_logs.component.js +37 -0
- package/esm2015/lib/components/metrics/metrics_search.component.js +177 -0
- package/esm2015/lib/components/metrics/metrics_search.component.loc.js +23 -0
- package/esm2015/lib/components/profiler/adm_profiler.component.js +108 -0
- package/esm2015/lib/components/profiler/adm_profiler.component.loc.js +33 -0
- package/esm2015/lib/components/topact/topact_search.component.js +191 -0
- package/esm2015/lib/components/topact/topact_search.component.loc.js +32 -0
- package/esm2015/lib/components/workers/adm_wrk.component.js +182 -0
- package/esm2015/lib/components/workers/adm_wrk.component.loc.js +33 -0
- package/esm2015/lib/models/components/ActiveSession.js +3 -0
- package/esm2015/lib/models/components/Audit.js +3 -0
- package/esm2015/lib/models/components/AuditsView.js +9 -0
- package/esm2015/lib/models/components/DirectorInfos.js +3 -0
- package/esm2015/lib/models/components/LocksView.js +5 -0
- package/esm2015/lib/models/components/Metric.js +3 -0
- package/esm2015/lib/models/components/MetricChart.js +4 -0
- package/esm2015/lib/models/components/MetricsView.js +5 -0
- package/esm2015/lib/models/components/ProcessesView.js +5 -0
- package/esm2015/lib/models/components/ProfilerDataNode.js +76 -0
- package/esm2015/lib/models/components/ProfilerDataNode.loc.js +20 -0
- package/esm2015/lib/models/components/ProfilerDataNodesView.js +5 -0
- package/esm2015/lib/models/components/TopActivitiesDataView.js +5 -0
- package/esm2015/lib/models/components/TopActivity.js +3 -0
- package/esm2015/lib/models/components/TopNode.js +3 -0
- package/esm2015/lib/models/components/TopSession.js +3 -0
- package/esm2015/lib/models/externals/Repository.js +21 -0
- package/esm2015/lib/models/shared/KeyValue.js +7 -0
- package/esm2015/lib/models/shared/Locale.js +2 -0
- package/esm2015/lib/tokens.js +4 -0
- package/esm2015/public-api.js +4 -0
- package/fesm2015/esfaenza-admin-module.js +1176 -0
- package/fesm2015/esfaenza-admin-module.js.map +1 -0
- package/lib/admin-module.module.d.ts +62 -0
- package/lib/communications/base/BaseModuleCommunicationsConsumer.d.ts +3 -0
- package/lib/components/audits/adm_audits.component.d.ts +29 -0
- package/lib/components/audits/adm_audits.component.loc.d.ts +4 -0
- package/lib/components/enqueues/adm_enq.component.d.ts +27 -0
- package/lib/components/enqueues/adm_enq.component.loc.d.ts +4 -0
- package/lib/components/logs/adm_logs.component.d.ts +14 -0
- package/lib/components/metrics/metrics_search.component.d.ts +46 -0
- package/lib/components/metrics/metrics_search.component.loc.d.ts +4 -0
- package/lib/components/profiler/adm_profiler.component.d.ts +29 -0
- package/lib/components/profiler/adm_profiler.component.loc.d.ts +4 -0
- package/lib/components/topact/topact_search.component.d.ts +58 -0
- package/lib/components/topact/topact_search.component.loc.d.ts +4 -0
- package/lib/components/workers/adm_wrk.component.d.ts +51 -0
- package/lib/components/workers/adm_wrk.component.loc.d.ts +4 -0
- package/lib/models/components/ActiveSession.d.ts +11 -0
- package/lib/models/components/Audit.d.ts +13 -0
- package/lib/models/components/AuditsView.d.ts +14 -0
- package/lib/models/components/DirectorInfos.d.ts +5 -0
- package/lib/models/components/LocksView.d.ts +7 -0
- package/lib/models/components/Metric.d.ts +6 -0
- package/lib/models/components/MetricChart.d.ts +6 -0
- package/lib/models/components/MetricsView.d.ts +12 -0
- package/lib/models/components/ProcessesView.d.ts +8 -0
- package/lib/models/components/ProfilerDataNode.d.ts +19 -0
- package/lib/models/components/ProfilerDataNode.loc.d.ts +70 -0
- package/lib/models/components/ProfilerDataNodesView.d.ts +7 -0
- package/lib/models/components/TopActivitiesDataView.d.ts +7 -0
- package/lib/models/components/TopActivity.d.ts +8 -0
- package/lib/models/components/TopNode.d.ts +6 -0
- package/lib/models/components/TopSession.d.ts +15 -0
- package/lib/models/externals/Repository.d.ts +20 -0
- package/lib/models/shared/KeyValue.d.ts +5 -0
- package/lib/models/shared/Locale.d.ts +1 -0
- package/lib/tokens.d.ts +3 -0
- package/package.json +27 -0
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,1176 @@
|
|
|
1
|
+
import { Location, CommonModule } from '@angular/common';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { InjectionToken, Injectable, Inject, Component, ViewChild, NgModule } from '@angular/core';
|
|
4
|
+
import { ActivatedRoute, RouterModule } from '@angular/router';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
7
|
+
import { MatDayjsDateModule } from '@esfaenza/material-dayjs-adapter';
|
|
8
|
+
import { MatInputModule } from '@angular/material/input';
|
|
9
|
+
import { NgxMatDatetimePickerModule } from '@angular-material-components/datetime-picker';
|
|
10
|
+
import { ModalModule } from 'ngx-bootstrap/modal';
|
|
11
|
+
import { CsvModule } from '@ctrl/ngx-csv';
|
|
12
|
+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
13
|
+
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
14
|
+
import { AppSearch, EsTableOperationDefinition, EsTableModule } from '@esfaenza/es-table';
|
|
15
|
+
import { FormsAndValidationsModule } from '@esfaenza/forms-and-validations';
|
|
16
|
+
import { LineSerie, DateValue, LineChartData, Limit, EsChartsModule } from '@esfaenza/es-charts';
|
|
17
|
+
import { EsGertrudeModule } from '@esfaenza/gertrude';
|
|
18
|
+
import { LocalizationService, LocalizationModule } from '@esfaenza/localizations';
|
|
19
|
+
import { ContextMenuModule } from '@esfaenza/ngx-contextmenu';
|
|
20
|
+
import { __awaiter, __decorate } from 'tslib';
|
|
21
|
+
import { PreferencesService } from '@esfaenza/preferences';
|
|
22
|
+
import { HTTPService } from '@esfaenza/httpservice';
|
|
23
|
+
import { HttpParams } from '@angular/common/http';
|
|
24
|
+
import { UtilityService, MessageService, Export, ExportService, DateService } from '@esfaenza/extensions';
|
|
25
|
+
import { autoserialize } from 'cerialize';
|
|
26
|
+
import { map } from 'rxjs/operators';
|
|
27
|
+
|
|
28
|
+
class BaseModuleCommunicationsConsumer {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class AuditsView extends AppSearch {
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.filteraction = '';
|
|
35
|
+
this.filterhttp = '';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Repository = {
|
|
40
|
+
GET_Adm_ChangeProcessConsumerGroup: "/api/Adm/ChangeProcessConsumerGroup",
|
|
41
|
+
GET_Adm_ClearAllCaches: "/api/Adm/ClearAllCaches",
|
|
42
|
+
GET_Adm_GetConsumerGroups: "/api/Adm/GetConsumerGroups#cache",
|
|
43
|
+
GET_Adm_GetInfos: "/api/Adm/GetInfos",
|
|
44
|
+
GET_Adm_GetMetrics: "/api/Adm/GetMetrics",
|
|
45
|
+
POST_Adm_GetMetrics: "/api/Adm/GetMetrics",
|
|
46
|
+
POST_Adm_GetProfilerDataNodes: "/api/Adm/GetProfilerDataNodes",
|
|
47
|
+
POST_Adm_GetServerAudits: "/api/Adm/GetServerAudits",
|
|
48
|
+
POST_Adm_GetServerLocks: "/api/Adm/GetServerLocks",
|
|
49
|
+
GET_Adm_GetServerLogs: "/api/Adm/GetServerLogs",
|
|
50
|
+
POST_Adm_GetServerWorkers: "/api/Adm/GetServerWorkers",
|
|
51
|
+
POST_Adm_GetTopActivities: "/api/Adm/GetTopActivities",
|
|
52
|
+
GET_Adm_GetWorkerStatus: "/api/Adm/GetWorkerStatus",
|
|
53
|
+
GET_Adm_InvalidateServerSideCache: "/api/Adm/InvalidateServerSideCache",
|
|
54
|
+
GET_Adm_KillProcess: "/api/Adm/KillProcess",
|
|
55
|
+
GET_Adm_SetProcessTracing: "/api/Adm/SetProcessTracing",
|
|
56
|
+
GET_Adm_StartWorker: "/api/Adm/StartWorker",
|
|
57
|
+
GET_Adm_StopWorker: "/api/Adm/StopWorker"
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const ADM_LOCALE = new InjectionToken('ADM_LOCALE');
|
|
61
|
+
const ADM_BACKEND_URL = new InjectionToken('ADM_BACKEND_URL');
|
|
62
|
+
|
|
63
|
+
class AdmAuditLoc extends LocalizationService {
|
|
64
|
+
constructor(LOC_LOCALE) {
|
|
65
|
+
super(LOC_LOCALE);
|
|
66
|
+
super.set("en->it", "Search Application Audits", ["Ricerca Audit Applicativi"]);
|
|
67
|
+
super.set("en->it", "User", ["Utente"]);
|
|
68
|
+
super.set("en->it", "REST Call", ["Chiamata REST"]);
|
|
69
|
+
super.set("en->it", "Update", ["Aggiornamento"]);
|
|
70
|
+
super.set("en->it", "Route", ["Route"]);
|
|
71
|
+
super.set("en->it", "Action", ["Azione"]);
|
|
72
|
+
super.set("en->it", "HTTP Method", ["Metodo HTTP"]);
|
|
73
|
+
super.set("en->it", "Arguments", ["Argomenti"]);
|
|
74
|
+
super.set("en->it", "Object ID", ["ID Oggetto"]);
|
|
75
|
+
super.set("en->it", "Object Type", ["Tipo Oggetto"]);
|
|
76
|
+
super.set("en->it", "Object Data", ["Dati Oggetto"]);
|
|
77
|
+
super.set("en->it", "Loading Application Audits", ["Carico gli Audit dell'Applicazione"]);
|
|
78
|
+
super.set("en->it", "Date", ["Data"]);
|
|
79
|
+
super.set("en->it", "HTTP Response", ["Risposta HTTP"]);
|
|
80
|
+
super.set("en->it", "Application Error Code", ["Codice Errore Applicativo"]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
AdmAuditLoc.decorators = [
|
|
84
|
+
{ type: Injectable }
|
|
85
|
+
];
|
|
86
|
+
AdmAuditLoc.ctorParameters = () => [
|
|
87
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
class AdmAuditsComponent {
|
|
91
|
+
constructor(lc, localStorage, _state, http, route, location, backend) {
|
|
92
|
+
this.lc = lc;
|
|
93
|
+
this.localStorage = localStorage;
|
|
94
|
+
this._state = _state;
|
|
95
|
+
this.http = http;
|
|
96
|
+
this.route = route;
|
|
97
|
+
this.location = location;
|
|
98
|
+
this.backend = backend;
|
|
99
|
+
this.searchView = new AuditsView();
|
|
100
|
+
this.Actions = [];
|
|
101
|
+
this.HttpMethods = [];
|
|
102
|
+
this.searchInProgress = false;
|
|
103
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
104
|
+
this.HttpMethods = [
|
|
105
|
+
{ id: "GET", description: "GET" },
|
|
106
|
+
{ id: "POST", description: "POST" },
|
|
107
|
+
{ id: "PUT", description: "PUT" },
|
|
108
|
+
{ id: "PATCH", description: "PATCH" },
|
|
109
|
+
{ id: "DELETE", description: "DELETE" }
|
|
110
|
+
];
|
|
111
|
+
this.Actions = [
|
|
112
|
+
{ id: "C", description: this.lc.loc("REST Call") },
|
|
113
|
+
{ id: "U", description: this.lc.loc("Update") },
|
|
114
|
+
{ id: "D", description: this.lc.loc("Delete") }
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
ngOnInit() {
|
|
118
|
+
this.storageSub = this.route.queryParams.subscribe(params => { this.Init(params["ignoreStorage"]); });
|
|
119
|
+
}
|
|
120
|
+
ngOnDestroy() {
|
|
121
|
+
if (this.storageSub)
|
|
122
|
+
this.storageSub.unsubscribe();
|
|
123
|
+
}
|
|
124
|
+
Init(ignoreStorage) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
let item = yield this.localStorage.getItem("HotAudittato").toPromise();
|
|
127
|
+
if (!ignoreStorage && item) {
|
|
128
|
+
this.init(item);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.init(null);
|
|
132
|
+
this.location.replaceState("/pages/adm/serveraudits");
|
|
133
|
+
this.route.snapshot.queryParams = [];
|
|
134
|
+
yield this.localStorage.removeItem("HotAudittato").toPromise();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
init(HotPotato) {
|
|
139
|
+
//Se ho la HotPotato vuol dire che sono appena tornato dall'edit/nuovo. Rifaccio la ricerca in base ai filtri precedenti
|
|
140
|
+
//Altirmenti genero il modello nuovo normalmente
|
|
141
|
+
if (HotPotato) {
|
|
142
|
+
this.searchView = HotPotato;
|
|
143
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerAudits"], this.searchView);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.searchView = new AuditsView();
|
|
147
|
+
this.searchView.filterda = dayjs().add(-1, "month").format(this.lc.token("getSmallDateFormat"));
|
|
148
|
+
this.searchView.filtera = dayjs().format(this.lc.token("getSmallDateFormat"));
|
|
149
|
+
this.sendSearch();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
sendSearch(resetPage = true) {
|
|
153
|
+
this.searchInProgress = true;
|
|
154
|
+
if (resetPage)
|
|
155
|
+
this.searchView.page = 1;
|
|
156
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerAudits"], this.searchView);
|
|
157
|
+
}
|
|
158
|
+
POSTGetProcesses(url, data) {
|
|
159
|
+
this.http.post(url, data).subscribe(t => {
|
|
160
|
+
this.searchView = t;
|
|
161
|
+
this.searchInProgress = false;
|
|
162
|
+
this.localStorage.setItem("HotAudittato", this.searchView).subscribe();
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
AdmAuditsComponent.decorators = [
|
|
167
|
+
{ type: Component, args: [{
|
|
168
|
+
selector: "adm_audits",
|
|
169
|
+
viewProviders: [{ provide: LocalizationService, useClass: AdmAuditLoc }],
|
|
170
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">{{'Search Application Audits' | localize : lc}}</span>\r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <div class=\"col-md-12 bottom-15\">\r\n <form role=\"form\">\r\n <div class=\"row\">\r\n <div class=\"col-md-11\">\r\n <div class=\"col-md-12 row app-no-padding app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-date [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterda\" name=\"filterda\" [Placeholder]=\"'From' | localize : lc\"></form-date>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-date [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filtera\" name=\"filtera\" [Placeholder]=\"'To' | localize : lc\"></form-date>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filteruser\" name=\"filteruser\" [Placeholder]=\"'User' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterroute\" name=\"filterroute\" [Placeholder]=\"'Route' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-select [FormLayout]=\"false\" [Validation]=\"false\" [SelectLabel]=\"'Action' | localize : lc\" [(ngModel)]=\"searchView.filteraction\" name=\"filteraction\" [Source]=\"Actions\"></form-select>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-select [FormLayout]=\"false\" [Validation]=\"false\" [SelectLabel]=\"'HTTP Method' | localize : lc\" [(ngModel)]=\"searchView.filterhttp\" name=\"filterhttp\" [Source]=\"HttpMethods\"></form-select>\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 row app-no-padding\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterargs\" name=\"filterargs\" [Placeholder]=\"'Arguments' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterobjid\" name=\"filterobjid\" [Placeholder]=\"'Object ID' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterobjtype\" name=\"filterobjtype\" [Placeholder]=\"'Object Type' | localize : lc\"></form-input>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-md-1 app-no-padding\">\r\n <button [disabled]=\"searchInProgress\" class=\"input-group-addon btn app-btn-search\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <p *ngIf=\"!searchView\"><em>{{'Loading Application Audits' | localize : lc}}...</em></p>\r\n <div *ngIf=\"searchView\">\r\n <es-table [(ngModel)]=\"searchView\" [MultipleOrderingDirectives]=\"true\" (onSearchRequest)=\"sendSearch($event);\">\r\n \r\n <span *th=\"'Timestamp'\">{{'Date' | localize : lc}}</span>\r\n <span *th=\"'User'\">{{'User' | localize : lc}}</span>\r\n <span *th=\"'Action'\">{{'Action' | localize : lc}}</span>\r\n <span *th=\"'HttpMethod'\">{{'HTTP Method' | localize : lc}}</span>\r\n <span *th=\"'Route'\">{{'Route' | localize : lc}}</span>\r\n <span *th=\"'Args'\">{{'Arguments' | localize : lc}}</span>\r\n <span *th=\"'HttpResponse'\">{{'HTTP Response' | localize : lc}}</span>\r\n <span *th=\"'NonStdErrorMessage'\">{{'Application Error Code' | localize : lc}}</span>\r\n <span *th=\"'ObjectType'\">{{'Object Type' | localize : lc}}</span>\r\n <span *th=\"'ObjectId'\">{{'Object ID' | localize : lc}}</span>\r\n <span *th=\"'ObjectData'\">{{'Object Data' | localize : lc}}</span>\r\n \r\n <strong *td=\"'Timestamp'; let pro\">{{pro.timestamp | loc_date:'DD/MM/YYYY HH:mm:ss'}}</strong>\r\n <span *td=\"'User'; let pro\">{{pro.user}}</span>\r\n <span *td=\"'Action'; let pro\">{{pro.action}}</span>\r\n <span *td=\"'HttpMethod'; let pro\">{{pro.httpmethod}}</span>\r\n <span *td=\"'Route'; let pro\">{{pro.route}}</span>\r\n <span *td=\"'Args'; let pro\">{{pro.args}}</span>\r\n <span *td=\"'HttpResponse'; let pro\">{{pro.httpresponse}}</span>\r\n <span *td=\"'NonStdErrorMessage'; let pro\">{{pro.mdmerrorcode}}</span>\r\n <span *td=\"'ObjectType'; let pro\">{{pro.objecttype}}</span>\r\n <span *td=\"'ObjectId'; let pro\">{{pro.objectid}}</span>\r\n <span *td=\"'ObjectData'; let pro\">{{pro.objectdata}}</span>\r\n </es-table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
171
|
+
},] }
|
|
172
|
+
];
|
|
173
|
+
AdmAuditsComponent.ctorParameters = () => [
|
|
174
|
+
{ type: LocalizationService },
|
|
175
|
+
{ type: PreferencesService },
|
|
176
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
177
|
+
{ type: HTTPService },
|
|
178
|
+
{ type: ActivatedRoute },
|
|
179
|
+
{ type: Location },
|
|
180
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
class ProcessesView extends AppSearch {
|
|
184
|
+
constructor() { super(); }
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
class AdmWrkLoc extends LocalizationService {
|
|
188
|
+
constructor(LOC_LOCALE) {
|
|
189
|
+
super(LOC_LOCALE);
|
|
190
|
+
super.set("en->it", "Consumer Group succesfully changed", ["Gruppo di Consumo modificato con successo"]);
|
|
191
|
+
super.set("en->it", "Errors changing Consumer Group", ["Errori nella modifica del Gruppo di Consumo"]);
|
|
192
|
+
super.set("en->it", "Change Consumer Group", ["Modifica Gruppo di Consumo"]);
|
|
193
|
+
super.set("en->it", "New Consumer Group", ["Nuovo Gruppo di Consumo"]);
|
|
194
|
+
super.set("en->it", "State", ["Stato"]);
|
|
195
|
+
super.set("en->it", "Global", ["Globale"]);
|
|
196
|
+
super.set("en->it", "Search Application Processes", ["Ricerca Processi Applicativi"]);
|
|
197
|
+
super.set("en->it", "Tenant", ["Operatore"]);
|
|
198
|
+
super.set("en->it", "Errors toggling Process Tracing", ["Errori nella modifica del Tracing del Processo"]);
|
|
199
|
+
super.set("en->it", "User", ["Utente"]);
|
|
200
|
+
super.set("en->it", "Loading Application Processes", ["Carico i Processi Applicativi"]);
|
|
201
|
+
super.set("en->it", "Activate Process Tracing", ["Attiva Tracing Processo"]);
|
|
202
|
+
super.set("en->it", "Deactivate Process Tracing", ["Disattiva Tracing Progetto"]);
|
|
203
|
+
super.set("en->it", "Kill Process", ["Ammazza Processo"]);
|
|
204
|
+
super.set("en->it", "Errors killing the Process", ["Errori durante la Kill del Processo"]);
|
|
205
|
+
super.set("en->it", "Process succesfully killed", ["Processo ucciso con successo"]);
|
|
206
|
+
super.set("en->it", "Confirm Process Kill", ["Conferma Terminazione del Processo"]);
|
|
207
|
+
super.set("en->it", "Are you sure you wish to kill the selected process? The associated user will be disconnected", ["Sei sicuro di voler Terminare il processo selezionato? L'utente relativo sara' disconnesso"]);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
AdmWrkLoc.decorators = [
|
|
211
|
+
{ type: Injectable }
|
|
212
|
+
];
|
|
213
|
+
AdmWrkLoc.ctorParameters = () => [
|
|
214
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
class AdmWrkComponent {
|
|
218
|
+
constructor(utiExts, msgExts, lc, localStorage, _state, http, route, location, backend) {
|
|
219
|
+
this.utiExts = utiExts;
|
|
220
|
+
this.msgExts = msgExts;
|
|
221
|
+
this.lc = lc;
|
|
222
|
+
this.localStorage = localStorage;
|
|
223
|
+
this._state = _state;
|
|
224
|
+
this.http = http;
|
|
225
|
+
this.route = route;
|
|
226
|
+
this.location = location;
|
|
227
|
+
this.backend = backend;
|
|
228
|
+
this.searchView = new ProcessesView();
|
|
229
|
+
this.DynamicOps = [];
|
|
230
|
+
this.valueToShow = "";
|
|
231
|
+
//********************************************** Gestione modifica Consumer Group ***************************************
|
|
232
|
+
this.newCg = "";
|
|
233
|
+
this.CGs = [];
|
|
234
|
+
this.CgDictionariesLoaded = false;
|
|
235
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
236
|
+
this.DynamicOps = [
|
|
237
|
+
new EsTableOperationDefinition("trace_on", this.lc.loc("Activate Process Tracing"), "fa fa-circle text-danger", "", "trace_enabled", "N"),
|
|
238
|
+
new EsTableOperationDefinition("trace_off", this.lc.loc("Deactivate Process Tracing"), "fa fa-circle text-success", "", "trace_enabled", "Y"),
|
|
239
|
+
new EsTableOperationDefinition("kill", this.lc.loc("Kill Process"), "fa fa-ban text-danger"),
|
|
240
|
+
new EsTableOperationDefinition("change_cg", this.lc.loc("Change Consumer Group"), "fa fa-edit text-info")
|
|
241
|
+
];
|
|
242
|
+
}
|
|
243
|
+
ngOnInit() {
|
|
244
|
+
this.storageSub = this.route.queryParams.subscribe(params => {
|
|
245
|
+
this.Init(params["ignoreStorage"]);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
ngOnDestroy() {
|
|
249
|
+
if (this.storageSub)
|
|
250
|
+
this.storageSub.unsubscribe();
|
|
251
|
+
}
|
|
252
|
+
Init(ignoreStorage) {
|
|
253
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
+
let item = yield this.localStorage.getItem("HotProcessato").toPromise();
|
|
255
|
+
if (!ignoreStorage && item) {
|
|
256
|
+
this.init(item);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
this.init(null);
|
|
260
|
+
this.location.replaceState("/pages/adm/serverworkers");
|
|
261
|
+
this.route.snapshot.queryParams = [];
|
|
262
|
+
yield this.localStorage.removeItem("HotProcessato").toPromise();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
init(HotPotato) {
|
|
267
|
+
if (HotPotato) {
|
|
268
|
+
this.searchView = HotPotato;
|
|
269
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerWorkers"], this.searchView);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this.searchView = new ProcessesView();
|
|
273
|
+
this.sendSearch();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
sendSearch(resetPage = true) {
|
|
277
|
+
this.searchView.searchinprogress = true;
|
|
278
|
+
if (resetPage)
|
|
279
|
+
this.searchView.page = 1;
|
|
280
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerWorkers"], this.searchView);
|
|
281
|
+
}
|
|
282
|
+
POSTGetProcesses(url, data) {
|
|
283
|
+
this.http.post(url, data).subscribe(t => {
|
|
284
|
+
this.searchView = t;
|
|
285
|
+
this.searchView.searchinprogress = false;
|
|
286
|
+
this.localStorage.setItem("HotProcessato", this.searchView).subscribe();
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
back() {
|
|
290
|
+
this.location.back();
|
|
291
|
+
}
|
|
292
|
+
onOperation(event) {
|
|
293
|
+
switch (event.id) {
|
|
294
|
+
case "trace_on":
|
|
295
|
+
this.toggleTracing(event.item, true);
|
|
296
|
+
break;
|
|
297
|
+
case "trace_off":
|
|
298
|
+
this.toggleTracing(event.item, false);
|
|
299
|
+
break;
|
|
300
|
+
case "kill":
|
|
301
|
+
this.killProcess(event.item);
|
|
302
|
+
break;
|
|
303
|
+
case "change_cg":
|
|
304
|
+
this.changeProcessCg(event.item);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
toggleTracing(process, tracing) {
|
|
309
|
+
var pars = new HttpParams()
|
|
310
|
+
.set("instanceid", process.properties["inst_id"])
|
|
311
|
+
.set("sid", process.properties["sid"])
|
|
312
|
+
.set("serial", process.properties["serial"])
|
|
313
|
+
.set("enable", tracing.toString());
|
|
314
|
+
this.http.get(this.backend + Repository["GET_Adm_SetProcessTracing"], pars).subscribe(t => {
|
|
315
|
+
this.msgExts.manageStringResponse(t, "", this.lc.loc("Errors toggling Process Tracing"), () => this.sendSearch());
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
killProcess(process) {
|
|
319
|
+
this.msgExts.simpleWarningWithChoice(this.lc.loc("Confirm Process Kill"), this.lc.loc("Are you sure you wish to kill the selected process? The associated user will be disconnected"), () => {
|
|
320
|
+
var pars = new HttpParams()
|
|
321
|
+
.set("instanceid", process.properties["inst_id"])
|
|
322
|
+
.set("sid", process.properties["sid"])
|
|
323
|
+
.set("serial", process.properties["serial"]);
|
|
324
|
+
this.http.get(this.backend + Repository["GET_Adm_KillProcess"], pars).subscribe(t => {
|
|
325
|
+
this.msgExts.manageStringResponse(t, this.lc.loc("Process succesfully killed"), this.lc.loc("Errors killing the Process"), () => this.sendSearch());
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
changeProcessCg(process) {
|
|
330
|
+
this.ProcessOnEdit = process;
|
|
331
|
+
if (!this.CgDictionariesLoaded) {
|
|
332
|
+
this.loadCgDictionaries();
|
|
333
|
+
this.CgDictionariesLoaded = true;
|
|
334
|
+
}
|
|
335
|
+
this.setupChangeCg();
|
|
336
|
+
this.dlgChangeCg.show();
|
|
337
|
+
}
|
|
338
|
+
loadCgDictionaries() {
|
|
339
|
+
this.http.get(this.backend + Repository["GET_Adm_GetConsumerGroups"]).subscribe(t => this.CGs = t);
|
|
340
|
+
}
|
|
341
|
+
setupChangeCg() {
|
|
342
|
+
this.utiExts.cleanForm(this.cgFrom);
|
|
343
|
+
setTimeout(() => { this.newCg = ""; });
|
|
344
|
+
}
|
|
345
|
+
doChangeCg() {
|
|
346
|
+
var pars = new HttpParams()
|
|
347
|
+
.set("instanceid", this.ProcessOnEdit.properties["inst_id"])
|
|
348
|
+
.set("sid", this.ProcessOnEdit.properties["sid"])
|
|
349
|
+
.set("serial", this.ProcessOnEdit.properties["serial"])
|
|
350
|
+
.set("consumer_group", this.newCg);
|
|
351
|
+
this.http.get(this.backend + Repository["GET_Adm_ChangeProcessConsumerGroup"], pars).subscribe(t => {
|
|
352
|
+
this.msgExts.manageStringResponse(t, this.lc.loc("Consumer Group succesfully changed"), this.lc.loc("Errors changing Consumer Group"), () => this.sendSearch());
|
|
353
|
+
});
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
AdmWrkComponent.decorators = [
|
|
358
|
+
{ type: Component, args: [{
|
|
359
|
+
selector: "adm_wrk",
|
|
360
|
+
viewProviders: [{ provide: LocalizationService, useClass: AdmWrkLoc }],
|
|
361
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">{{'Search Application Processes' | localize : lc}}</span>\r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <div class=\"col-md-12\">\r\n <form role=\"form\">\r\n <div class=\"row app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filtertenant\" name=\"filterTenant\" [Placeholder]=\"'Tenant' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filteruser\" name=\"filterUser\" [Placeholder]=\"'User' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterstate\" name=\"filterState\" [Placeholder]=\"'State' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper app-padding-top-10\">\r\n <form-checkbox [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterglobal\" name=\"filterglobal\"></form-checkbox> \r\n <span class=\"app-pointer\" (click)=\"searchView.filterglobal = !searchView.filterglobal\">{{'Global' | localize : lc}}</span>\r\n </div>\r\n <button [disabled]=\"searchView.searchinprogress\" class=\"input-group-addon btn app-btn-search app-margin-top-20\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n </div>\r\n </form>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <p *ngIf=\"!searchView\"><em>{{'Loading Application Processes' | localize : lc}}...</em></p>\r\n <div *ngIf=\"searchView\">\r\n <es-table [(ngModel)]=\"searchView\" [DynamicOperations]=\"DynamicOps\" [AutoUpdate]=\"true\" [OrderByColumn]=\"true\" (onSearchRequest)=\"sendSearch($event);\" (onDynamicOperation)=\"onOperation($event)\">\r\n <span class=\"app-nowrap\" *td=\"'full_wait_stack'; let value\">\r\n <span class=\"fa fa-list app-pointer\" (click)=\"valueToShow = value; dlgValue.show();\"></span> \r\n {{value.length > 70 ? value.substr(0, 67) + '...' : value}}\r\n </span>\r\n </es-table>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"app-margin-top-15\">\r\n <button class=\"btn btn-secondary pull-left\" type=\"button\" (click)=\"back()\">{{'Back' | localize : lc}}</button>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div bsModal #dlgChangeCg=\"bs-modal\" class=\"modal fade\" role=\"dialog\" aria-hidden=\"true\">\r\n <div class=\"modal-dialog modal-lg\" cdkDrag>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\" cdkDragHandle>\r\n <h4 class=\"modal-title pull-left\">{{'Change Consumer Group' | localize : lc}}</h4>\r\n <button type=\"button\" class=\"close pull-right\" (click)=\"dlgChangeCg.hide()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n <form novalidate #cgFrom=\"ngForm\" (ngSubmit)=\"cgFrom.valid && doChangeCg() && dlgChangeCg.hide()\">\r\n <div class=\"modal-body\">\r\n <form-select [Label]=\"'New Consumer Group' | localize : lc\" [(ngModel)]=\"newCg\" name=\"newcg\" [Source]=\"CGs\" required [Last]=\"true\"></form-select>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn btn-secondary app-margin-right-5\" (click)=\"dlgChangeCg.hide()\">{{'Close' | localize : lc}}</button>\r\n <button type=\"submit\" class=\"btn btn-primary\">{{'Confirm' | localize : lc}}</button>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div bsModal #dlgValue=\"bs-modal\" class=\"modal fade\" role=\"dialog\" aria-hidden=\"true\">\r\n <div class=\"modal-dialog modal-xl\" app-draggable=\".modal-header\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h5 class=\"modal-title pull-left\">\r\n Full Wait Stack\r\n </h5>\r\n <button type=\"button\" class=\"close pull-right\" (click)=\"dlgValue.hide()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n <div class=\"modal-body app-padidng-bottom-20 app-padding-top-20\">\r\n <span class=\"app-wrap\">\r\n {{valueToShow}}\r\n </span>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"dlgValue.hide()\">Chiudi</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
362
|
+
},] }
|
|
363
|
+
];
|
|
364
|
+
AdmWrkComponent.ctorParameters = () => [
|
|
365
|
+
{ type: UtilityService },
|
|
366
|
+
{ type: MessageService },
|
|
367
|
+
{ type: LocalizationService },
|
|
368
|
+
{ type: PreferencesService },
|
|
369
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
370
|
+
{ type: HTTPService },
|
|
371
|
+
{ type: ActivatedRoute },
|
|
372
|
+
{ type: Location },
|
|
373
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
374
|
+
];
|
|
375
|
+
AdmWrkComponent.propDecorators = {
|
|
376
|
+
cgFrom: [{ type: ViewChild, args: ["cgFrom",] }],
|
|
377
|
+
dlgChangeCg: [{ type: ViewChild, args: ["dlgChangeCg",] }]
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const Locale = localStorage.getItem("LOCALE") || myconfig.LOCALE;
|
|
381
|
+
|
|
382
|
+
const ProfilerDataNode_loc = {
|
|
383
|
+
'Parent ID': { 'en-US': "Parent ID", 'it-IT': "ID Padre" },
|
|
384
|
+
'ID': { 'en-US': "ID", 'it-IT': "ID" },
|
|
385
|
+
'Description': { 'en-US': "Description", 'it-IT': "Descrizione" },
|
|
386
|
+
'Calls': { 'en-US': "Calls", 'it-IT': "Chiamate" },
|
|
387
|
+
'Time': { 'en-US': "Time", 'it-IT': "Tempo" },
|
|
388
|
+
'Peak Time': { 'en-US': "Peak Time", 'it-IT': "Tempo Max" },
|
|
389
|
+
'Min. Time': { 'en-US': "Min. Time", 'it-IT': "Tempo Min" },
|
|
390
|
+
'Avg. Time': { 'en-US': "Avg. Time", 'it-IT': "Tempo Medio" },
|
|
391
|
+
'Specific Time': { 'en-US': "Specific Time", 'it-IT': "Tempo Specifico" },
|
|
392
|
+
'Percentage': { 'en-US': "Percentage", 'it-IT': "Percentuale" },
|
|
393
|
+
'Calls for Period': { 'en-US': "Calls for Period", 'it-IT': "Chiamate Periodo" },
|
|
394
|
+
'Time for Period': { 'en-US': "Time for Period", 'it-IT': "Tempo Periodo" },
|
|
395
|
+
'Peak Time for Period': { 'en-US': "Peak Time for Period", 'it-IT': "Tempo Max Periodo" },
|
|
396
|
+
'Min. Time for Period': { 'en-US': "Min. Time for Period", 'it-IT': "Tempo Min Periodo" },
|
|
397
|
+
'Avg. Time for Period': { 'en-US': "Avg. Time for Period", 'it-IT': "Tempo Medio Periodo" },
|
|
398
|
+
'Specific Time for Period': { 'en-US': "Specific Time for Period", 'it-IT': "Tempo Specifico Periodo" },
|
|
399
|
+
'Percentage for Period': { 'en-US': "Percentage for Period", 'it-IT': "Percentuale Periodo" }
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
class ProfilerDataNode {
|
|
403
|
+
}
|
|
404
|
+
__decorate([
|
|
405
|
+
Export(10, ProfilerDataNode_loc["Parent ID"][Locale]),
|
|
406
|
+
autoserialize
|
|
407
|
+
], ProfilerDataNode.prototype, "parentid", void 0);
|
|
408
|
+
__decorate([
|
|
409
|
+
Export(20, ProfilerDataNode_loc["ID"][Locale]),
|
|
410
|
+
autoserialize
|
|
411
|
+
], ProfilerDataNode.prototype, "id", void 0);
|
|
412
|
+
__decorate([
|
|
413
|
+
Export(30, ProfilerDataNode_loc["Description"][Locale]),
|
|
414
|
+
autoserialize
|
|
415
|
+
], ProfilerDataNode.prototype, "description", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
Export(40, ProfilerDataNode_loc["Calls"][Locale]),
|
|
418
|
+
autoserialize
|
|
419
|
+
], ProfilerDataNode.prototype, "calls", void 0);
|
|
420
|
+
__decorate([
|
|
421
|
+
Export(50, ProfilerDataNode_loc["Time"][Locale]),
|
|
422
|
+
autoserialize
|
|
423
|
+
], ProfilerDataNode.prototype, "time", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
Export(60, ProfilerDataNode_loc["Peak Time"][Locale]),
|
|
426
|
+
autoserialize
|
|
427
|
+
], ProfilerDataNode.prototype, "peaktime", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
Export(70, ProfilerDataNode_loc["Min. Time"][Locale]),
|
|
430
|
+
autoserialize
|
|
431
|
+
], ProfilerDataNode.prototype, "mintime", void 0);
|
|
432
|
+
__decorate([
|
|
433
|
+
Export(80, ProfilerDataNode_loc["Avg. Time"][Locale]),
|
|
434
|
+
autoserialize
|
|
435
|
+
], ProfilerDataNode.prototype, "avgtime", void 0);
|
|
436
|
+
__decorate([
|
|
437
|
+
Export(90, ProfilerDataNode_loc["Specific Time"][Locale]),
|
|
438
|
+
autoserialize
|
|
439
|
+
], ProfilerDataNode.prototype, "timewithoutchildren", void 0);
|
|
440
|
+
__decorate([
|
|
441
|
+
Export(100, ProfilerDataNode_loc["Percentage"][Locale]),
|
|
442
|
+
autoserialize
|
|
443
|
+
], ProfilerDataNode.prototype, "percentage", void 0);
|
|
444
|
+
__decorate([
|
|
445
|
+
Export(110, ProfilerDataNode_loc["Calls for Period"][Locale]),
|
|
446
|
+
autoserialize
|
|
447
|
+
], ProfilerDataNode.prototype, "snapdeltacalls", void 0);
|
|
448
|
+
__decorate([
|
|
449
|
+
Export(120, ProfilerDataNode_loc["Time for Period"][Locale]),
|
|
450
|
+
autoserialize
|
|
451
|
+
], ProfilerDataNode.prototype, "snapdeltatime", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
Export(130, ProfilerDataNode_loc["Peak Time for Period"][Locale]),
|
|
454
|
+
autoserialize
|
|
455
|
+
], ProfilerDataNode.prototype, "snappeaktime", void 0);
|
|
456
|
+
__decorate([
|
|
457
|
+
Export(140, ProfilerDataNode_loc["Min. Time for Period"][Locale]),
|
|
458
|
+
autoserialize
|
|
459
|
+
], ProfilerDataNode.prototype, "snapmintime", void 0);
|
|
460
|
+
__decorate([
|
|
461
|
+
Export(150, ProfilerDataNode_loc["Avg. Time for Period"][Locale]),
|
|
462
|
+
autoserialize
|
|
463
|
+
], ProfilerDataNode.prototype, "snapavgtime", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
Export(160, ProfilerDataNode_loc["Specific Time for Period"][Locale]),
|
|
466
|
+
autoserialize
|
|
467
|
+
], ProfilerDataNode.prototype, "snaptimewithoutchildren", void 0);
|
|
468
|
+
__decorate([
|
|
469
|
+
Export(170, ProfilerDataNode_loc["Percentage for Period"][Locale]),
|
|
470
|
+
autoserialize
|
|
471
|
+
], ProfilerDataNode.prototype, "snappercentage", void 0);
|
|
472
|
+
|
|
473
|
+
class ProfilerDataNodesView extends AppSearch {
|
|
474
|
+
constructor() { super(); }
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
class AdmProfilerComponentLoc extends LocalizationService {
|
|
478
|
+
constructor(LOC_LOCALE) {
|
|
479
|
+
super(LOC_LOCALE);
|
|
480
|
+
super.set("en->it", "Server Profiler", ["Profiler del Server"]);
|
|
481
|
+
super.set("en->it", "Loading Data", ["Carico i Dati"]);
|
|
482
|
+
super.set("en->it", "ID", ["ID"]);
|
|
483
|
+
super.set("en->it", "Description", ["Descrizione"]);
|
|
484
|
+
super.set("en->it", "Calls", ["Chiamate"]);
|
|
485
|
+
super.set("en->it", "Time", ["Tempo"]);
|
|
486
|
+
super.set("en->it", "Peak Time", ["Tempo Max"]);
|
|
487
|
+
super.set("en->it", "Min. Time", ["Tempo Min"]);
|
|
488
|
+
super.set("en->it", "Avg. Time", ["Tempo Medio"]);
|
|
489
|
+
super.set("en->it", "Specific Time", ["Tempo Specifico"]);
|
|
490
|
+
super.set("en->it", "Percentage", ["Percentuale"]);
|
|
491
|
+
super.set("en->it", "Calls for Period", ["Chiamate Periodo"]);
|
|
492
|
+
super.set("en->it", "Time for Period", ["Tempo Periodo"]);
|
|
493
|
+
super.set("en->it", "Peak Time for Period", ["Tempo Max Periodo"]);
|
|
494
|
+
super.set("en->it", "Min. Time for Period", ["Tempo Min Periodo"]);
|
|
495
|
+
super.set("en->it", "Avg. Time for Period", ["Tempo Medio Periodo"]);
|
|
496
|
+
super.set("en->it", "Specific Time for Period", ["Tempo Specifico Periodo"]);
|
|
497
|
+
super.set("en->it", "Percentage for Period", ["Percentuale Periodo"]);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
AdmProfilerComponentLoc.decorators = [
|
|
501
|
+
{ type: Injectable }
|
|
502
|
+
];
|
|
503
|
+
AdmProfilerComponentLoc.ctorParameters = () => [
|
|
504
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
505
|
+
];
|
|
506
|
+
|
|
507
|
+
class AdmProfilerComponent {
|
|
508
|
+
constructor(expExts, lc, localStorage, location, _state, http, route, backend) {
|
|
509
|
+
this.expExts = expExts;
|
|
510
|
+
this.lc = lc;
|
|
511
|
+
this.localStorage = localStorage;
|
|
512
|
+
this.location = location;
|
|
513
|
+
this._state = _state;
|
|
514
|
+
this.http = http;
|
|
515
|
+
this.route = route;
|
|
516
|
+
this.backend = backend;
|
|
517
|
+
this.searchView = new ProfilerDataNodesView();
|
|
518
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
519
|
+
}
|
|
520
|
+
ngOnInit() {
|
|
521
|
+
this.storageSub = this.route.queryParams.subscribe(params => {
|
|
522
|
+
this.Init(params["ignoreStorage"]);
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
Init(ignoreStore) {
|
|
526
|
+
this.doInit(ignoreStore);
|
|
527
|
+
}
|
|
528
|
+
doInit(ignoreStorage) {
|
|
529
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
530
|
+
let item = yield this.localStorage.getItem("HotSearchProfilato").toPromise();
|
|
531
|
+
if (!ignoreStorage && item) {
|
|
532
|
+
this.init(item);
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
this.init(null);
|
|
536
|
+
this.location.replaceState("/pages/adm/profiler");
|
|
537
|
+
this.route.snapshot.queryParams = [];
|
|
538
|
+
yield this.localStorage.removeItem("HotSearchProfilato").toPromise();
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
init(HotPotato) {
|
|
543
|
+
if (HotPotato) {
|
|
544
|
+
this.searchView = HotPotato;
|
|
545
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetProfilerDataNodes"], this.searchView);
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
this.searchView = new ProfilerDataNodesView();
|
|
549
|
+
this.sendSearch();
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
ngOnDestroy() {
|
|
553
|
+
if (this.storageSub)
|
|
554
|
+
this.storageSub.unsubscribe();
|
|
555
|
+
}
|
|
556
|
+
sendSearch(resetPage = true) {
|
|
557
|
+
this.searchView.searchinprogress = true;
|
|
558
|
+
if (resetPage)
|
|
559
|
+
this.searchView.page = 1;
|
|
560
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetProfilerDataNodes"], this.searchView);
|
|
561
|
+
}
|
|
562
|
+
POSTGetItems(url, data) {
|
|
563
|
+
this.http.post(url, data).subscribe(t => {
|
|
564
|
+
this.searchView = t;
|
|
565
|
+
this.searchView.searchinprogress = false;
|
|
566
|
+
this.localStorage.setItem("HotSearchProfilato", this.searchView).subscribe();
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
prepareExport(dataCallBack) {
|
|
570
|
+
var view = JSON.parse(JSON.stringify(this.searchView));
|
|
571
|
+
view.page = 1;
|
|
572
|
+
view.itemsperpageoverride = 9999999;
|
|
573
|
+
this.http.post(this.backend + Repository["POST_Adm_GetProfilerDataNodes"], view).subscribe(t => {
|
|
574
|
+
let items = this.expExts.deserializeForExport(t.items, ProfilerDataNode);
|
|
575
|
+
dataCallBack(items);
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
AdmProfilerComponent.decorators = [
|
|
580
|
+
{ type: Component, args: [{
|
|
581
|
+
selector: "adm_profiler",
|
|
582
|
+
providers: [{ provide: LocalizationService, useClass: AdmProfilerComponentLoc }],
|
|
583
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">{{'Server Profiler' | localize : lc}}</span> \r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <div class=\"col-md-12 bottom-15\">\r\n <form role=\"form\">\r\n <div class=\"row app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-date [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterfrom\" name=\"filterfrom\" [Placeholder]=\"'From' | localize : lc\"></form-date>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-date [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterto\" name=\"filterto\" [Placeholder]=\"'To' | localize : lc\"></form-date>\r\n </div>\r\n <button [disabled]=\"searchView.searchinprogress\" class=\"input-group-addon btn app-btn-search app-margin-top-20\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n </div>\r\n </form>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <p *ngIf=\"!searchView\"><em>{{'Loading Data' | localize : lc}}</em></p>\r\n <div *ngIf=\"searchView\">\r\n <es-table [(ngModel)]=\"searchView\" [Hierarchy]=\"true\" [OrderByColumn]=\"false\" [ParentKey]=\"'parentid'\"\r\n [OwnKey]=\"'id'\" [StartsExpanded]=\"false\" [ExportFunction]=\"prepareExport.bind(this)\" [Export]=\"true\"\r\n [ExportFileName]=\"'Profiler Export.csv'\" [HidePaging]=\"true\" (onSearchRequest)=\"sendSearch($event);\">\r\n \r\n <span *th=\"'1'\">{{'ID' | localize : lc}}</span>\r\n <span *th=\"'2'\">{{'Description' | localize : lc}}</span>\r\n <span *th=\"'3'\">{{'Calls' | localize : lc}}</span>\r\n <span *th=\"'4'\">{{'Time' | localize : lc}}</span>\r\n <span *th=\"'5'\">{{'Peak Time' | localize : lc}}</span>\r\n <span *th=\"'6'\">{{'Min. Time' | localize : lc}}</span>\r\n <span *th=\"'7'\">{{'Avg. Time' | localize : lc}}</span>\r\n <span *th=\"'8'\">{{'Specific Time' | localize : lc}}</span>\r\n <span *th=\"'9'\">{{'Percentage' | localize : lc}}</span>\r\n <span *th=\"'10'\">{{'Calls for Period' | localize : lc}}</span>\r\n <span *th=\"'11'\">{{'Time for Period' | localize : lc}}</span>\r\n <span *th=\"'12'\">{{'Peak Time for Period' | localize : lc}}</span>\r\n <span *th=\"'13'\">{{'Min. Time for Period' | localize : lc}}</span>\r\n <span *th=\"'14'\">{{'Avg. Time for Period' | localize : lc}}</span>\r\n <span *th=\"'15'\">{{'Specific Time for Period' | localize : lc}}</span>\r\n <span *th=\"'16'\">{{'Percentage for Period' | localize : lc}}</span>\r\n\r\n <span *td=\"'1'; let item\">{{item.id}}</span>\r\n <span *td=\"'2'; let item\" title=\"{{item.description}}\">{{item.description.length <= 50 ? item.description : item.description.substr(0,50) + \"[...]\" }}</span>\r\n <span *td=\"'3'; let item\">{{item.calls}}</span>\r\n <span *td=\"'4'; let item\">{{item.time}}</span>\r\n <span *td=\"'5'; let item\">{{item.peaktime}}</span>\r\n <span *td=\"'6'; let item\">{{item.mintime}}</span>\r\n <span *td=\"'7'; let item\">{{item.avgtime}}</span>\r\n <span *td=\"'8'; let item\">{{item.timewithoutchildren}}</span>\r\n <span *td=\"'9'; let item\">{{item.percentage}}</span>\r\n <span *td=\"'10' let item\">{{item.snapdeltacalls}}</span>\r\n <span *td=\"'11' let item\">{{item.snapdeltatime}}</span>\r\n <span *td=\"'12' let item\">{{item.snappeaktime}}</span>\r\n <span *td=\"'13' let item\">{{item.snapmintime}}</span>\r\n <span *td=\"'14' let item\">{{item.snapavgtime}}</span>\r\n <span *td=\"'15' let item\">{{item.snaptimewithoutchildren}}</span>\r\n <span *td=\"'16' let item\">{{item.snappercentage}}</span>\r\n </es-table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
584
|
+
},] }
|
|
585
|
+
];
|
|
586
|
+
AdmProfilerComponent.ctorParameters = () => [
|
|
587
|
+
{ type: ExportService },
|
|
588
|
+
{ type: LocalizationService },
|
|
589
|
+
{ type: PreferencesService },
|
|
590
|
+
{ type: Location },
|
|
591
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
592
|
+
{ type: HTTPService },
|
|
593
|
+
{ type: ActivatedRoute },
|
|
594
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
595
|
+
];
|
|
596
|
+
|
|
597
|
+
class TopActivitiesDataView extends AppSearch {
|
|
598
|
+
constructor() { super(); }
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
class AdmTopActivitieLoc extends LocalizationService {
|
|
602
|
+
constructor(LOC_LOCALE) {
|
|
603
|
+
super(LOC_LOCALE);
|
|
604
|
+
super.set("en->it", "Active Sessions", ["Sessioni Attive"]);
|
|
605
|
+
super.set("en->it", "Top Nodes", ["Prime Istruzioni"]);
|
|
606
|
+
super.set("en->it", "Top Sessions", ["Prime Sessioni"]);
|
|
607
|
+
super.set("en->it", "Loading Data", ["Carico i Dati"]);
|
|
608
|
+
super.set("en->it", "Top Activities", ["Attivita' Principali"]);
|
|
609
|
+
super.set("en->it", "Node Description", ["Descrizione Nodo"]);
|
|
610
|
+
super.set("en->it", "Node", ["Nodo"]);
|
|
611
|
+
super.set("en->it", "Activity", ["Attivita'"]);
|
|
612
|
+
super.set("en->it", "Limit", ["Limite"]);
|
|
613
|
+
super.set("en->it", "Node Type", ["Tipo Nodo"]);
|
|
614
|
+
super.set("en->it", "User", ["Utente"]);
|
|
615
|
+
super.set("en->it", "Tenant", ["Tenant"]);
|
|
616
|
+
super.set("en->it", "Process", ["Processo"]);
|
|
617
|
+
super.set("en->it", "Update every", ["Aggiorna ogni"]);
|
|
618
|
+
super.set("en->it", "second/s", ["secondo/i"]);
|
|
619
|
+
super.set("en->it", "Maximum Threads", ["Thread Massimi"]);
|
|
620
|
+
super.set("en->it", "CPUs", ["CPU"]);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
AdmTopActivitieLoc.decorators = [
|
|
624
|
+
{ type: Injectable }
|
|
625
|
+
];
|
|
626
|
+
AdmTopActivitieLoc.ctorParameters = () => [
|
|
627
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
628
|
+
];
|
|
629
|
+
|
|
630
|
+
class AdmTopActivitiesComponent {
|
|
631
|
+
constructor(dateExts, lc, localStorage, location, _state, http, route, backend) {
|
|
632
|
+
this.dateExts = dateExts;
|
|
633
|
+
this.lc = lc;
|
|
634
|
+
this.localStorage = localStorage;
|
|
635
|
+
this.location = location;
|
|
636
|
+
this._state = _state;
|
|
637
|
+
this.http = http;
|
|
638
|
+
this.route = route;
|
|
639
|
+
this.backend = backend;
|
|
640
|
+
this.searchView = new TopActivitiesDataView();
|
|
641
|
+
this.autoUpdate = false;
|
|
642
|
+
this.seconds = "5";
|
|
643
|
+
this.seriesPropertiesMapping = {};
|
|
644
|
+
this.propertiesSeriesMapping = {
|
|
645
|
+
["cputime"]: "CPU",
|
|
646
|
+
["waittime"]: "Wait",
|
|
647
|
+
["scripttime"]: "Scripting",
|
|
648
|
+
["dbtime"]: "DB",
|
|
649
|
+
["nettime"]: "Network",
|
|
650
|
+
["throttletime"]: "Throttling",
|
|
651
|
+
["sleeptime"]: "Sleep",
|
|
652
|
+
["iotime"]: "IO"
|
|
653
|
+
};
|
|
654
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
655
|
+
}
|
|
656
|
+
ngOnInit() {
|
|
657
|
+
this.storageSub = this.route.queryParams.subscribe(params => {
|
|
658
|
+
this.Init(params["ignoreStorage"]);
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
Init(ignoreStore) {
|
|
662
|
+
this.doInit(ignoreStore);
|
|
663
|
+
}
|
|
664
|
+
doInit(ignoreStorage) {
|
|
665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
666
|
+
let item = yield this.localStorage.getItem("HotSearchTopAct").toPromise();
|
|
667
|
+
if (!ignoreStorage && item) {
|
|
668
|
+
this.init(item);
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
this.init(null);
|
|
672
|
+
this.location.replaceState("/pages/adm/topact");
|
|
673
|
+
this.route.snapshot.queryParams = [];
|
|
674
|
+
yield this.localStorage.removeItem("HotSearchTopAct").toPromise();
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
init(HotPotato) {
|
|
679
|
+
if (HotPotato) {
|
|
680
|
+
this.searchView = HotPotato;
|
|
681
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetTopActivities"], this.searchView, false);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
this.searchView = new TopActivitiesDataView();
|
|
685
|
+
this.sendSearch();
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
ngOnDestroy() {
|
|
689
|
+
if (this.storageSub)
|
|
690
|
+
this.storageSub.unsubscribe();
|
|
691
|
+
}
|
|
692
|
+
sendSearch(resetPage = true, update = false, searchViewOverride = null) {
|
|
693
|
+
this.searchView.searchinprogress = true;
|
|
694
|
+
if (resetPage)
|
|
695
|
+
this.searchView.page = 1;
|
|
696
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetTopActivities"], searchViewOverride !== null && searchViewOverride !== void 0 ? searchViewOverride : this.searchView, update);
|
|
697
|
+
}
|
|
698
|
+
POSTGetItems(url, data, update) {
|
|
699
|
+
this.http.post(url, data).subscribe((t) => __awaiter(this, void 0, void 0, function* () {
|
|
700
|
+
//Se sono in modalità di update non devo toccare la searchView attuale se non per il searchinprogress che viene messo dall'es table
|
|
701
|
+
if (!update) {
|
|
702
|
+
this.searchView = t;
|
|
703
|
+
this.localStorage.setItem("HotSearchTopAct", this.searchView).subscribe();
|
|
704
|
+
}
|
|
705
|
+
var dirinfos = yield this.getDirectorInfos();
|
|
706
|
+
this.searchView.searchinprogress = false;
|
|
707
|
+
this.reviewBindings(update, t, dirinfos);
|
|
708
|
+
}));
|
|
709
|
+
}
|
|
710
|
+
getDirectorInfos() {
|
|
711
|
+
return this.http.get(this.backend + Repository["GET_Adm_GetInfos"]).pipe(map(res => { return res; })).toPromise();
|
|
712
|
+
}
|
|
713
|
+
reviewBindings(update, searchViewOverride, dirInfos) {
|
|
714
|
+
let reference = (searchViewOverride !== null && searchViewOverride !== void 0 ? searchViewOverride : this.searchView).items[0];
|
|
715
|
+
this.TopNodes = reference.topnodes;
|
|
716
|
+
this.TopSessions = reference.topsessions;
|
|
717
|
+
this.DirInfos = dirInfos;
|
|
718
|
+
if (!reference.actsessions || reference.actsessions.length == 0) {
|
|
719
|
+
this.TopActiveSessions = null;
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
let series = [];
|
|
723
|
+
let props = Object.keys(reference.actsessions[0]);
|
|
724
|
+
for (let i = 0; i < props.length; i++) {
|
|
725
|
+
if (props[i] != 'sampletime') {
|
|
726
|
+
let s = new LineSerie(this.propertiesSeriesMapping[props[i]], [], null, null, "sessions");
|
|
727
|
+
series.push(s);
|
|
728
|
+
this.seriesPropertiesMapping[props[i]] = s;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
for (let i = 0; i < reference.actsessions.length; i++) {
|
|
732
|
+
let itemref = reference.actsessions[i];
|
|
733
|
+
let theD = new Date(itemref.sampletime);
|
|
734
|
+
for (let i = 0; i < props.length; i++)
|
|
735
|
+
if (props[i] != 'sampletime' && (!update || this.dateExts.getDateConvertion(theD).isAfter(this.LastDataPoint)))
|
|
736
|
+
this.seriesPropertiesMapping[props[i]].values.push(new DateValue(theD, itemref[props[i]]));
|
|
737
|
+
}
|
|
738
|
+
if (update && this.ChartInstance) {
|
|
739
|
+
let data = new LineChartData(series, new Limit(dirInfos === null || dirInfos === void 0 ? void 0 : dirInfos.threads, this.lc.loc("Maximum Threads")));
|
|
740
|
+
if (series.some(t => t.values.length > 0)) {
|
|
741
|
+
this.ChartInstance.addData(data);
|
|
742
|
+
this.LastDataPoint = series.map(t => dayjs.max(t.values.map(v => this.dateExts.getDateConvertion(v.d))))[0];
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
this.TopActiveSessions = new LineChartData(series, new Limit(dirInfos === null || dirInfos === void 0 ? void 0 : dirInfos.threads, this.lc.loc("Maximum Threads")));
|
|
747
|
+
this.LastDataPoint = series.map(t => dayjs.max(t.values.map(v => this.dateExts.getDateConvertion(v.d))))[0];
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
autoUpdateChanged() {
|
|
751
|
+
if (!/^[1-9]\d*$/.test(this.seconds))
|
|
752
|
+
this.seconds = '10';
|
|
753
|
+
const secondsInMs = parseInt(this.seconds, null) * 1000;
|
|
754
|
+
if (this.autoUpdate) {
|
|
755
|
+
this.sendSearch(false, true);
|
|
756
|
+
this.updateTimer = setInterval(() => { this.sendSearch(false, true); }, secondsInMs);
|
|
757
|
+
}
|
|
758
|
+
else
|
|
759
|
+
clearInterval(this.updateTimer);
|
|
760
|
+
}
|
|
761
|
+
dataSelectionChanged(event) {
|
|
762
|
+
this.from = event.initial ? (this.searchView.filterfrom ? this.dateExts.getDateConvertion(this.searchView.filterfrom).toDate() : "") : event.from;
|
|
763
|
+
this.to = event.initial ? (this.searchView.filterto ? this.dateExts.getDateConvertion(this.searchView.filterto).toDate() : "") : event.to;
|
|
764
|
+
var pseudoSearchView = JSON.parse(JSON.stringify(this.searchView));
|
|
765
|
+
pseudoSearchView.filterfrom = this.from ? dayjs(this.from).format(this.lc.token("getFullDateDisplayFormat")) : "";
|
|
766
|
+
pseudoSearchView.filterto = this.to ? dayjs(this.to).format(this.lc.token("getFullDateDisplayFormat")) : "";
|
|
767
|
+
this.sendSearch(true, true, pseudoSearchView);
|
|
768
|
+
}
|
|
769
|
+
onChartLoaded(chart) {
|
|
770
|
+
this.ChartInstance = chart;
|
|
771
|
+
chart.Chart.events.on("ready", () => {
|
|
772
|
+
chart.Chart.xAxes.each(x => x.zoom({ start: 0, end: 1 }, true, true));
|
|
773
|
+
chart.Chart.yAxes.each(y => y.zoom({ start: 0, end: 1 }, true, true));
|
|
774
|
+
setTimeout(() => {
|
|
775
|
+
chart.Chart.xAxes.each(x => x.zoom({ start: 0, end: 1 }, true, true));
|
|
776
|
+
chart.Chart.yAxes.each(y => y.zoom({ start: 0, end: 1 }, true, true));
|
|
777
|
+
// 500 millisecondi è più o meno il tempo di prima animazione del grafico. Finito questo si resetta lo zoom
|
|
778
|
+
}, 500);
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
AdmTopActivitiesComponent.decorators = [
|
|
783
|
+
{ type: Component, args: [{
|
|
784
|
+
selector: "topact_search",
|
|
785
|
+
providers: [
|
|
786
|
+
{ provide: LocalizationService, useClass: AdmTopActivitieLoc }
|
|
787
|
+
],
|
|
788
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">\r\n {{'Top Activities' | localize : lc}}\r\n <span *ngIf=\"DirInfos\"> - {{'' + DirInfos.cpus + ' ' + ('CPUs' | localize : lc) + (DirInfos.rssplan ? ' - ' + DirInfos.rssplan : '')}}</span> \r\n </span>\r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <div class=\"col-md-12 app-relative\">\r\n <form role=\"form\">\r\n <div class=\"row app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-datetime [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterfrom\" name=\"filterfrom\" [Placeholder]=\"'From' | localize : lc\"></form-datetime>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-datetime [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterto\" name=\"filterto\" [Placeholder]=\"'To' | localize : lc\"></form-datetime>\r\n </div>\r\n <button [disabled]=\"searchView.searchinprogress || autoUpdate\" class=\"input-group-addon btn app-btn-search app-margin-top-20\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n\r\n <div class=\"app-absolute app-right-25 app-top-40\">\r\n <div class=\"pull-right\">\r\n {{'Update every' | localize : lc}} <input [readonly]=\"autoUpdate\" maxlength=\"3\" class=\"form-control app-updevery-input\" type=\"text\" [(ngModel)]=\"seconds\" name=\"secs\" /> {{'second/s' | localize : lc}}\r\n </div>\r\n <div class=\"pull-right m-t-2 app-margin-right-5\">\r\n <label class=\"switch\">\r\n <input type=\"checkbox\" [(ngModel)]=\"autoUpdate\" (ngModelChange)=\"autoUpdateChanged();\" />\r\n <div class=\"slider round\"></div>\r\n </label>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12 app-margin-top-5\">\r\n <p *ngIf=\"!searchView\"><em>{{'Loading Data' | localize : lc}}</em></p>\r\n <div *ngIf=\"searchView\" class=\"row\">\r\n <div class=\"col-md-12 app-no-padding\">\r\n <!--<h5 class=\"app-margin-top-5\">{{'Active Sessions' | localize : lc}}</h5>-->\r\n <div style=\"width: 100%; height: 290px\">\r\n <es-line-chart *ngIf=\"TopActiveSessions\"\r\n [MinGridDistance]=\"65\"\r\n [Timeline]=\"false\"\r\n [FinalInstants]=\"false\"\r\n [LegendPadding]=\"{top: 0, bottom: 7, right: 0, left: 10}\"\r\n [Fill]=\"true\"\r\n [MergeDatasets]=\"true\"\r\n [Data]=\"TopActiveSessions\"\r\n [Legend]=\"true\" \r\n name=\"topactsession\"\r\n [DataGroupingThreshold]=\"99999999\"\r\n (onSelectionChanged)=\"dataSelectionChanged($event)\" (chartLoaded)=\"onChartLoaded($event)\"></es-line-chart>\r\n </div>\r\n </div>\r\n <div class=\"col-md-5\">\r\n <h5>{{'Top Nodes' | localize : lc}}</h5>\r\n <es-table [(ngModel)]=\"TopNodes\" [HidePaging]=\"true\">\r\n <ng-template #header>\r\n <th class=\"app-col-min\">{{'Node' | localize : lc}}</th>\r\n <th>{{'Node Description' | localize : lc}}</th>\r\n <th class=\"app-col-min\">{{'Activity' | localize : lc}}</th>\r\n <th class=\"app-col-min app-nowrap\">{{'Node Type' | localize : lc}}</th>\r\n </ng-template>\r\n <ng-template #body let-node>\r\n <td class=\"app-col-min\"><strong>{{node.profnodeid}}</strong></td>\r\n <td><span title=\"{{node.profnodedesc}}\">{{node.profnodedesc.length > 40 ? node.profnodedesc.substr(0,40) + \"...\" : node.profnodedesc}}</span></td>\r\n <td class=\"app-nowrap\">{{node.activity | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{node.nodetypename}}</td>\r\n </ng-template>\r\n </es-table>\r\n </div>\r\n <div class=\"col-md-7\">\r\n <h5>{{'Top Sessions' | localize : lc}}</h5>\r\n <es-table [(ngModel)]=\"TopSessions\" [HidePaging]=\"true\">\r\n <ng-template #header>\r\n <th class=\"app-col-min\">ID</th>\r\n <th>{{'User' | localize : lc}}</th>\r\n <th>{{'Tenant' | localize : lc}}</th>\r\n <th>{{'Process' | localize : lc}}</th>\r\n <th>{{'Activity' | localize : lc}}</th>\r\n <th>Cpu</th>\r\n <th>Wait</th>\r\n <th>DB</th>\r\n <th>Script</th>\r\n <th>Throttle</th>\r\n <th>Sleep</th>\r\n <th>Networking</th>\r\n <th>IO</th>\r\n </ng-template>\r\n\r\n <ng-template #body let-session>\r\n <td><strong>{{session.sid}}</strong></td>\r\n <td>{{session.user}}</td>\r\n <td>{{session.tenant}}</td>\r\n <td>{{session.bgprocess}}</td>\r\n <td>{{session.activity | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.cpu | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.wait | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.db | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.script | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.throttle | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.sleep | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.net | number : '1.1-2' : 'it'}} %</td>\r\n <td>{{session.io | number : '1.1-2' : 'it'}} %</td>\r\n </ng-template>\r\n </es-table>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
789
|
+
},] }
|
|
790
|
+
];
|
|
791
|
+
AdmTopActivitiesComponent.ctorParameters = () => [
|
|
792
|
+
{ type: DateService },
|
|
793
|
+
{ type: LocalizationService },
|
|
794
|
+
{ type: PreferencesService },
|
|
795
|
+
{ type: Location },
|
|
796
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
797
|
+
{ type: HTTPService },
|
|
798
|
+
{ type: ActivatedRoute },
|
|
799
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
800
|
+
];
|
|
801
|
+
|
|
802
|
+
class LocksView extends AppSearch {
|
|
803
|
+
constructor() { super(); }
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
class AdmEnqLoc extends LocalizationService {
|
|
807
|
+
constructor(LOC_LOCALE) {
|
|
808
|
+
super(LOC_LOCALE);
|
|
809
|
+
super.set("en->it", "Search Application Locks", ["Ricerca Lock Applicativi"]);
|
|
810
|
+
super.set("en->it", "Name", ["Nome"]);
|
|
811
|
+
super.set("en->it", "Loading Application Locks", ["Carico i Lock Applicativi"]);
|
|
812
|
+
super.set("en->it", "Global", ["Globale"]);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
AdmEnqLoc.decorators = [
|
|
816
|
+
{ type: Injectable }
|
|
817
|
+
];
|
|
818
|
+
AdmEnqLoc.ctorParameters = () => [
|
|
819
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
820
|
+
];
|
|
821
|
+
|
|
822
|
+
class AdmEnqComponent {
|
|
823
|
+
constructor(lc, localStorage, expExts, _state, http, route, location, backend) {
|
|
824
|
+
this.lc = lc;
|
|
825
|
+
this.localStorage = localStorage;
|
|
826
|
+
this.expExts = expExts;
|
|
827
|
+
this._state = _state;
|
|
828
|
+
this.http = http;
|
|
829
|
+
this.route = route;
|
|
830
|
+
this.location = location;
|
|
831
|
+
this.backend = backend;
|
|
832
|
+
this.locksView = new LocksView();
|
|
833
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
834
|
+
}
|
|
835
|
+
ngOnInit() {
|
|
836
|
+
this.storageSub = this.route.queryParams.subscribe(params => { this.Init(params["ignoreStorage"]); });
|
|
837
|
+
}
|
|
838
|
+
ngOnDestroy() {
|
|
839
|
+
if (this.storageSub)
|
|
840
|
+
this.storageSub.unsubscribe();
|
|
841
|
+
}
|
|
842
|
+
Init(ignoreStorage) {
|
|
843
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
844
|
+
let item = yield this.localStorage.getItem("HotEnqueue").toPromise();
|
|
845
|
+
if (!ignoreStorage && item) {
|
|
846
|
+
this.init(item);
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
this.init(null);
|
|
850
|
+
this.location.replaceState("/pages/adm/serverenqueues");
|
|
851
|
+
this.route.snapshot.queryParams = [];
|
|
852
|
+
yield this.localStorage.removeItem("HotEnqueue").toPromise();
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
init(HotPotato) {
|
|
857
|
+
if (HotPotato) {
|
|
858
|
+
this.locksView = HotPotato;
|
|
859
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerLocks"], this.locksView);
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
this.locksView = new LocksView();
|
|
863
|
+
this.sendSearch();
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
sendSearch(resetPage = true) {
|
|
867
|
+
if (resetPage)
|
|
868
|
+
this.locksView.page = 1;
|
|
869
|
+
this.POSTGetProcesses(this.backend + Repository["POST_Adm_GetServerLocks"], this.locksView);
|
|
870
|
+
}
|
|
871
|
+
POSTGetProcesses(url, data) {
|
|
872
|
+
this.http.post(url, data).subscribe(t => {
|
|
873
|
+
this.locksView = t;
|
|
874
|
+
this.localStorage.setItem("HotEnqueue", this.locksView).subscribe();
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
AdmEnqComponent.decorators = [
|
|
879
|
+
{ type: Component, args: [{
|
|
880
|
+
selector: "adm_enq",
|
|
881
|
+
viewProviders: [{ provide: LocalizationService, useClass: AdmEnqLoc }],
|
|
882
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">{{'Search Application Locks' | localize : lc}}</span>\r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <form role=\"form\">\r\n <div class=\"col-md-12 row app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"locksView.filtersid\" name=\"filtersid\" [Placeholder]=\"'SID'\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"locksView.filterlock\" name=\"filterlock\" [Placeholder]=\"'Name' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper app-padding-top-10\">\r\n <form-checkbox [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"locksView.filterglobal\" name=\"filterglobal\"></form-checkbox> \r\n <span class=\"app-pointer\" (click)=\"locksView.filterglobal = !locksView.filterglobal\">{{'Global' | localize : lc}}</span>\r\n </div>\r\n <button class=\"input-group-addon btn app-btn-search app-margin-top-20\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n </div>\r\n </form>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <p *ngIf=\"!locksView\"><em>{{'Loading Application Locks' | localize : lc}}...</em></p>\r\n <div *ngIf=\"locksView\">\r\n <es-table [(ngModel)]=\"locksView\" [AutoUpdate]=\"true\" [OrderByColumn]=\"true\" (onSearchRequest)=\"sendSearch($event);\"></es-table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
883
|
+
},] }
|
|
884
|
+
];
|
|
885
|
+
AdmEnqComponent.ctorParameters = () => [
|
|
886
|
+
{ type: LocalizationService },
|
|
887
|
+
{ type: PreferencesService },
|
|
888
|
+
{ type: ExportService },
|
|
889
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
890
|
+
{ type: HTTPService },
|
|
891
|
+
{ type: ActivatedRoute },
|
|
892
|
+
{ type: Location },
|
|
893
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
894
|
+
];
|
|
895
|
+
|
|
896
|
+
class KeyValue {
|
|
897
|
+
constructor(id, description) {
|
|
898
|
+
this.id = id;
|
|
899
|
+
this.description = description;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
class MetricsView extends AppSearch {
|
|
904
|
+
constructor() { super(); }
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
class AdmMetricsLoc extends LocalizationService {
|
|
908
|
+
constructor(LOC_LOCALE) {
|
|
909
|
+
super(LOC_LOCALE);
|
|
910
|
+
super.set("en->it", "System Metrics", ["Metriche di Sistema"]);
|
|
911
|
+
super.set("en->it", "Session ID", ["Cod. Sessione"]);
|
|
912
|
+
super.set("en->it", "Session Serial", ["Seriale Sessione"]);
|
|
913
|
+
super.set("en->it", "Filter Metrics...", ["Filtra Metriche..."]);
|
|
914
|
+
super.set("en->it", "Loading Data", ["Carico i Dati"]);
|
|
915
|
+
super.set("en->it", "Update every", ["Aggiorna ogni"]);
|
|
916
|
+
super.set("en->it", "second/s", ["secondo/i"]);
|
|
917
|
+
super.set("en->it", "Metrics Instance", ["Istanza Metriche"]);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
AdmMetricsLoc.decorators = [
|
|
921
|
+
{ type: Injectable }
|
|
922
|
+
];
|
|
923
|
+
AdmMetricsLoc.ctorParameters = () => [
|
|
924
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_LOCALE,] }] }
|
|
925
|
+
];
|
|
926
|
+
|
|
927
|
+
class AdmMetricsComponent {
|
|
928
|
+
constructor(dateExts, lc, localStorage, location, _state, http, route, backend) {
|
|
929
|
+
this.dateExts = dateExts;
|
|
930
|
+
this.lc = lc;
|
|
931
|
+
this.localStorage = localStorage;
|
|
932
|
+
this.location = location;
|
|
933
|
+
this._state = _state;
|
|
934
|
+
this.http = http;
|
|
935
|
+
this.route = route;
|
|
936
|
+
this.backend = backend;
|
|
937
|
+
this.MetricsChartCache = {};
|
|
938
|
+
this.searchView = new MetricsView();
|
|
939
|
+
this.autoUpdate = false;
|
|
940
|
+
this.seconds = "5";
|
|
941
|
+
this.Instances = [];
|
|
942
|
+
this.selectedInstance = "";
|
|
943
|
+
this.instanceRequired = false;
|
|
944
|
+
this.metricsToShow = [];
|
|
945
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
946
|
+
}
|
|
947
|
+
ngOnInit() {
|
|
948
|
+
this.storageSub = this.route.queryParams.subscribe(params => {
|
|
949
|
+
this.Init(params["ignoreStorage"]);
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
Init(ignoreStore) {
|
|
953
|
+
this.doInit(ignoreStore);
|
|
954
|
+
}
|
|
955
|
+
dateChanged() {
|
|
956
|
+
// Pulizia di tutti i parametri di ricerca dipendenti dalle date
|
|
957
|
+
this.metricsToShow = [];
|
|
958
|
+
this.Metrics = [];
|
|
959
|
+
this.instanceRequired = false;
|
|
960
|
+
this.Instances = [];
|
|
961
|
+
this.selectedInstance = "";
|
|
962
|
+
this.searchView.filtermetrics = [];
|
|
963
|
+
var pars = new HttpParams().set("from", this.searchView.filterfrom || "").set("to", this.searchView.filterto || "");
|
|
964
|
+
this.http.get(this.backend + Repository["GET_Adm_GetMetrics"], pars).subscribe(t => this.Metrics = t);
|
|
965
|
+
}
|
|
966
|
+
doInit(ignoreStorage) {
|
|
967
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
968
|
+
let item = yield this.localStorage.getItem("HotSearchMetrics").toPromise();
|
|
969
|
+
if (!ignoreStorage && item) {
|
|
970
|
+
this.init(item);
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
this.init(null);
|
|
974
|
+
this.location.replaceState("/pages/adm/metrics");
|
|
975
|
+
this.route.snapshot.queryParams = [];
|
|
976
|
+
yield this.localStorage.removeItem("HotSearchMetrics").toPromise();
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
init(HotPotato) {
|
|
981
|
+
if (HotPotato) {
|
|
982
|
+
this.searchView = HotPotato;
|
|
983
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetMetrics"], this.searchView, false);
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
this.searchView = new MetricsView();
|
|
987
|
+
this.sendSearch();
|
|
988
|
+
}
|
|
989
|
+
this.dateChanged();
|
|
990
|
+
}
|
|
991
|
+
ngOnDestroy() {
|
|
992
|
+
if (this.storageSub)
|
|
993
|
+
this.storageSub.unsubscribe();
|
|
994
|
+
}
|
|
995
|
+
sendSearch(resetPage = true, update = false, searchViewOverride = null) {
|
|
996
|
+
if (!update)
|
|
997
|
+
this.MetricsChartCache = {};
|
|
998
|
+
this.searchView.searchinprogress = true;
|
|
999
|
+
// Questa ricerca prende i nomi distinct delle metriche quindi devo prendere tutto per forza
|
|
1000
|
+
this.searchView.itemsperpageoverride = 999999;
|
|
1001
|
+
if (resetPage)
|
|
1002
|
+
this.searchView.page = 1;
|
|
1003
|
+
this.POSTGetItems(this.backend + Repository["POST_Adm_GetMetrics"], searchViewOverride !== null && searchViewOverride !== void 0 ? searchViewOverride : this.searchView, update);
|
|
1004
|
+
}
|
|
1005
|
+
POSTGetItems(url, data, update) {
|
|
1006
|
+
data.filterrealtime = update ? data.filterrealtime : !(!!data.filterfrom || !!data.filterto);
|
|
1007
|
+
this.http.post(url, data).subscribe((t) => __awaiter(this, void 0, void 0, function* () {
|
|
1008
|
+
//Se sono in modalità di update non devo toccare la searchView attuale se non per il searchinprogress che viene messo dall'es table
|
|
1009
|
+
if (!update) {
|
|
1010
|
+
this.selectedInstance = "";
|
|
1011
|
+
this.metricsToShow = [];
|
|
1012
|
+
this.searchView = t;
|
|
1013
|
+
this.searchView.items.forEach(m => {
|
|
1014
|
+
if (!this.Instances.find(t => t.id == m.instance))
|
|
1015
|
+
this.Instances.push(new KeyValue(m.instance, m.instance));
|
|
1016
|
+
});
|
|
1017
|
+
this.instanceRequired = this.Instances.length > 1;
|
|
1018
|
+
if (this.Instances.length == 1) {
|
|
1019
|
+
this.selectedInstance = this.Instances[0].id;
|
|
1020
|
+
this.instanceSelected();
|
|
1021
|
+
}
|
|
1022
|
+
this.localStorage.setItem("HotSearchMetrics", this.searchView).subscribe();
|
|
1023
|
+
}
|
|
1024
|
+
else {
|
|
1025
|
+
// Per ogni grafico di ogni metrica aggiungo tutti i valori che sono DOPO all'ultimo ts registrato per quel grafico
|
|
1026
|
+
t.items.forEach(m => {
|
|
1027
|
+
m.values.forEach(c => {
|
|
1028
|
+
let refm = this.MetricsChartCache[this.metricKey(m, c)];
|
|
1029
|
+
if (refm) {
|
|
1030
|
+
c.series.forEach(s => { s.values = s.values.filter(v => this.dateExts.getDateConvertion(v.d).isAfter(refm.lastTs)); });
|
|
1031
|
+
if (c.series.some(t => t.values.length > 0)) {
|
|
1032
|
+
refm.lastTs = c.series.map(t => dayjs.max(t.values.map(v => this.dateExts.getDateConvertion(v.d))))[0];
|
|
1033
|
+
refm.chart.addData(c);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
this.searchView.searchinprogress = false;
|
|
1040
|
+
}));
|
|
1041
|
+
}
|
|
1042
|
+
instanceSelected() {
|
|
1043
|
+
if (!this.selectedInstance)
|
|
1044
|
+
return;
|
|
1045
|
+
this.metricsToShow = this.searchView.items.filter(t => t.instance == this.selectedInstance);
|
|
1046
|
+
}
|
|
1047
|
+
linkChartToMetric(metric, metricChart, chartComp) {
|
|
1048
|
+
this.MetricsChartCache[this.metricKey(metric, metricChart)] = { chart: chartComp, lastTs: metricChart.series.map(t => dayjs.max(t.values.map(v => this.dateExts.getDateConvertion(v.d))))[0] };
|
|
1049
|
+
}
|
|
1050
|
+
metricKey(metric, value) {
|
|
1051
|
+
return metric.name + " - " + value.xtitle + " - " + metric.instance;
|
|
1052
|
+
}
|
|
1053
|
+
autoUpdateChanged() {
|
|
1054
|
+
if (!/^[1-9]\d*$/.test(this.seconds))
|
|
1055
|
+
this.seconds = '10';
|
|
1056
|
+
const secondsInMs = parseInt(this.seconds, null) * 1000;
|
|
1057
|
+
if (this.autoUpdate) {
|
|
1058
|
+
this.sendSearch(false, true);
|
|
1059
|
+
this.updateTimer = setInterval(() => { this.sendSearch(false, true); }, secondsInMs);
|
|
1060
|
+
}
|
|
1061
|
+
else
|
|
1062
|
+
clearInterval(this.updateTimer);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
AdmMetricsComponent.decorators = [
|
|
1066
|
+
{ type: Component, args: [{
|
|
1067
|
+
selector: "metrics_search",
|
|
1068
|
+
providers: [
|
|
1069
|
+
{ provide: LocalizationService, useClass: AdmMetricsLoc }
|
|
1070
|
+
],
|
|
1071
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card app-overflow-visible\" widget>\r\n <div class=\"card-header\">\r\n <span class=\"text-uppercase\">\r\n {{'System Metrics' | localize : lc}}\r\n </span>\r\n </div>\r\n <div class=\"card-body widget-body\">\r\n <div class=\"col-md-12\">\r\n <form role=\"form\">\r\n <div class=\"row\">\r\n <div class=\"col-md-11\">\r\n <div class=\"col-md-12 row app-no-padding app-first-filter-line\">\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-datetime [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterfrom\" name=\"filterfrom\" [Placeholder]=\"'From' | localize : lc\" (inputChange)=\"dateChanged();\"></form-datetime>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-datetime [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterto\" name=\"filterto\" [Placeholder]=\"'To' | localize : lc\" (inputChange)=\"dateChanged();\"></form-datetime>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filtersid\" name=\"filtersid\" [Placeholder]=\"'Session ID' | localize : lc\"></form-input>\r\n </div>\r\n <div class=\"col-xl-2 col-lg-2 col-md-12 app-filter-wrapper\">\r\n <form-input [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filterserial\" name=\"filterserial\" [Placeholder]=\"'Session Serial' | localize : lc\"></form-input>\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 row app-no-padding\">\r\n <div class=\"col-12 app-filter-wrapper\">\r\n <form-multiselect [Readonly]=\"autoUpdate\" [FormLayout]=\"false\" [Validation]=\"false\" [(ngModel)]=\"searchView.filtermetrics\" [IdField]=\"'name'\" [Display]=\"'{name}'\" name=\"filtermetrics\" [SelectLabel]=\"'Filter Metrics...' | localize : lc\" [Source]=\"Metrics\"></form-multiselect>\r\n </div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n <div class=\"col-md-1 app-no-padding\">\r\n <button [disabled]=\"searchView.searchinprogress || autoUpdate\" class=\"input-group-addon btn app-btn-search\" (click)=\"sendSearch()\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </form>\r\n <div class=\"app-col-12 app-margin-top-15\">\r\n <div class=\"pull-right\">\r\n {{'Update every' | localize : lc}} <input [readonly]=\"autoUpdate\" maxlength=\"3\" class=\"form-control app-updevery-input\" type=\"text\" [(ngModel)]=\"seconds\" /> {{'second/s' | localize : lc}}\r\n </div>\r\n <div class=\"pull-right m-t-2 app-margin-right-5\">\r\n <label class=\"switch\">\r\n <input type=\"checkbox\" [(ngModel)]=\"autoUpdate\" (ngModelChange)=\"autoUpdateChanged();\" />\r\n <div class=\"slider round\"></div>\r\n </label>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <p *ngIf=\"!searchView\"><em>{{'Loading Data' | localize : lc}}</em></p>\r\n <div *ngIf=\"searchView && instanceRequired\">\r\n <form-select [Validation]=\"false\" [Label]=\"'Metrics Instance' | localize : lc\" [(ngModel)]=\"selectedInstance\" name=\"instance\" [Source]=\"Instances\" (inputChange)=\"instanceSelected()\" required></form-select>\r\n </div>\r\n <div *ngIf=\"searchView && metricsToShow && metricsToShow.length > 0\">\r\n <div class=\"col-md-12 app-padding-right-0 row app-margin-top-15\">\r\n <ng-container *ngFor=\"let metric of metricsToShow; let i = index\">\r\n <div class=\"col-md-4 app-no-padding app-simple-border\" *ngFor=\"let chart of metric.values; let z = index\">\r\n <div style=\"width: 100%; height: 260px\">\r\n <es-line-chart [XTitle]=\"chart.xtitle\"\r\n [YTitle]=\"chart.ytitle\"\r\n [MinGridDistance]=\"65\"\r\n [Timeline]=\"false\"\r\n [LegendPadding]=\"{top: 0, bottom: 7, right: 0, left: 10}\"\r\n [MergeDatasets]=\"true\"\r\n [Data]=\"chart\"\r\n [Animations]=\"true\"\r\n [Legend]=\"chart.legend\"\r\n name=\"metric_{{i}}_chart_{{z}}\"\r\n (chartLoaded)=\"linkChartToMetric(metric, chart, $event);\"\r\n [DataGroupingThreshold]=\"99999999\">\r\n </es-line-chart>\r\n </div>\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
1072
|
+
},] }
|
|
1073
|
+
];
|
|
1074
|
+
AdmMetricsComponent.ctorParameters = () => [
|
|
1075
|
+
{ type: DateService },
|
|
1076
|
+
{ type: LocalizationService },
|
|
1077
|
+
{ type: PreferencesService },
|
|
1078
|
+
{ type: Location },
|
|
1079
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
1080
|
+
{ type: HTTPService },
|
|
1081
|
+
{ type: ActivatedRoute },
|
|
1082
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
1083
|
+
];
|
|
1084
|
+
|
|
1085
|
+
// Angular
|
|
1086
|
+
class AdmLogsComponent {
|
|
1087
|
+
constructor(_state, http, lc, route, backend) {
|
|
1088
|
+
this._state = _state;
|
|
1089
|
+
this.http = http;
|
|
1090
|
+
this.lc = lc;
|
|
1091
|
+
this.route = route;
|
|
1092
|
+
this.backend = backend;
|
|
1093
|
+
this._state.handleNavigation(this.lc.loc(this.route.snapshot.data["title"]), false);
|
|
1094
|
+
}
|
|
1095
|
+
ngOnInit() {
|
|
1096
|
+
this.http.get(this.backend + Repository["GET_Adm_GetServerLogs"]).subscribe(t => { this.Log = t; });
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
AdmLogsComponent.decorators = [
|
|
1100
|
+
{ type: Component, args: [{
|
|
1101
|
+
selector: "adm_logs",
|
|
1102
|
+
template: "<div class=\"row\">\r\n <div class=\"col-12 bottom-15\">\r\n <p *ngIf=\"Log\" class=\"app-whitespace-prewrap\" [innerHTML]=\"Log\"></p>\r\n </div>\r\n</div>"
|
|
1103
|
+
},] }
|
|
1104
|
+
];
|
|
1105
|
+
AdmLogsComponent.ctorParameters = () => [
|
|
1106
|
+
{ type: BaseModuleCommunicationsConsumer },
|
|
1107
|
+
{ type: HTTPService },
|
|
1108
|
+
{ type: LocalizationService },
|
|
1109
|
+
{ type: ActivatedRoute },
|
|
1110
|
+
{ type: String, decorators: [{ type: Inject, args: [ADM_BACKEND_URL,] }] }
|
|
1111
|
+
];
|
|
1112
|
+
|
|
1113
|
+
// Angular
|
|
1114
|
+
const ɵ0 = { title: "Search Application Processes", internalNavigation: false }, ɵ1 = { title: "Server Profiler", internalNavigation: false }, ɵ2 = { title: "Top Activities", internalNavigation: false }, ɵ3 = { title: "System Metrics", internalNavigation: false }, ɵ4 = { title: "Server Logs", internalNavigation: false }, ɵ5 = { title: "Search Application Audits", internalNavigation: false }, ɵ6 = { title: "Search Application Locks", internalNavigation: false };
|
|
1115
|
+
const routeConfig = [
|
|
1116
|
+
{
|
|
1117
|
+
path: "",
|
|
1118
|
+
children: [
|
|
1119
|
+
{ path: "serverworkers", component: AdmWrkComponent, data: ɵ0 },
|
|
1120
|
+
{ path: "profiler", component: AdmProfilerComponent, data: ɵ1 },
|
|
1121
|
+
{ path: "topact", component: AdmTopActivitiesComponent, data: ɵ2 },
|
|
1122
|
+
{ path: "metrics", component: AdmMetricsComponent, data: ɵ3 },
|
|
1123
|
+
{ path: "serverlogs", component: AdmLogsComponent, data: ɵ4 },
|
|
1124
|
+
{ path: "serveraudits", component: AdmAuditsComponent, data: ɵ5 },
|
|
1125
|
+
{ path: "serverenqueues", component: AdmEnqComponent, data: ɵ6 }
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
];
|
|
1129
|
+
const MODULES = [
|
|
1130
|
+
// Base
|
|
1131
|
+
CommonModule,
|
|
1132
|
+
FormsModule,
|
|
1133
|
+
// Material
|
|
1134
|
+
MatDatepickerModule,
|
|
1135
|
+
MatDayjsDateModule,
|
|
1136
|
+
MatIconModule,
|
|
1137
|
+
MatInputModule,
|
|
1138
|
+
// Bootstrap
|
|
1139
|
+
ModalModule,
|
|
1140
|
+
TooltipModule,
|
|
1141
|
+
BsDropdownModule,
|
|
1142
|
+
CsvModule,
|
|
1143
|
+
// Esfaenza e componenti visuali
|
|
1144
|
+
ContextMenuModule,
|
|
1145
|
+
LocalizationModule,
|
|
1146
|
+
EsTableModule,
|
|
1147
|
+
FormsAndValidationsModule,
|
|
1148
|
+
EsGertrudeModule,
|
|
1149
|
+
EsChartsModule,
|
|
1150
|
+
NgxMatDatetimePickerModule,
|
|
1151
|
+
RouterModule.forChild(routeConfig),
|
|
1152
|
+
];
|
|
1153
|
+
const COMPONENTS = [
|
|
1154
|
+
AdmWrkComponent,
|
|
1155
|
+
AdmProfilerComponent,
|
|
1156
|
+
AdmTopActivitiesComponent,
|
|
1157
|
+
AdmLogsComponent,
|
|
1158
|
+
AdmAuditsComponent,
|
|
1159
|
+
AdmEnqComponent,
|
|
1160
|
+
AdmMetricsComponent
|
|
1161
|
+
];
|
|
1162
|
+
class AdmModule {
|
|
1163
|
+
}
|
|
1164
|
+
AdmModule.decorators = [
|
|
1165
|
+
{ type: NgModule, args: [{
|
|
1166
|
+
imports: [...MODULES],
|
|
1167
|
+
declarations: [...COMPONENTS]
|
|
1168
|
+
},] }
|
|
1169
|
+
];
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* Generated bundle index. Do not edit.
|
|
1173
|
+
*/
|
|
1174
|
+
|
|
1175
|
+
export { ADM_BACKEND_URL, ADM_LOCALE, AdmModule, BaseModuleCommunicationsConsumer, routeConfig, ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5, ɵ6, AdmWrkComponent as ɵa, AdmWrkLoc as ɵb, AdmProfilerComponent as ɵc, AdmProfilerComponentLoc as ɵd, AdmTopActivitiesComponent as ɵe, AdmTopActivitieLoc as ɵf, AdmMetricsComponent as ɵg, AdmMetricsLoc as ɵh, AdmLogsComponent as ɵi, AdmAuditsComponent as ɵj, AdmAuditLoc as ɵk, AdmEnqComponent as ɵl, AdmEnqLoc as ɵm };
|
|
1176
|
+
//# sourceMappingURL=esfaenza-admin-module.js.map
|