mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve monitoring the solution
This commit is contained in:
Generated
+35
@@ -175,6 +175,7 @@
|
|||||||
"ng-lazyload-image": "^9.1.2",
|
"ng-lazyload-image": "^9.1.2",
|
||||||
"ng2-pdf-viewer": "^3.0.8",
|
"ng2-pdf-viewer": "^3.0.8",
|
||||||
"ngx-cookie-service": "^12.0.3",
|
"ngx-cookie-service": "^12.0.3",
|
||||||
|
"ngx-cropper": "^2.0.0-beta",
|
||||||
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
|
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
|
||||||
"ngx-image-compress": "^11.0.3",
|
"ngx-image-compress": "^11.0.3",
|
||||||
"ngx-image-cropper": "^5.0.1",
|
"ngx-image-cropper": "^5.0.1",
|
||||||
@@ -28580,6 +28581,24 @@
|
|||||||
"@angular/core": "^12.0.0"
|
"@angular/core": "^12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ngx-cropper": {
|
||||||
|
"version": "2.0.0-beta",
|
||||||
|
"resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz",
|
||||||
|
"integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"cropperjs": "^1.4.1",
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": "^6.0.0-rc.0 || ^6.0.0",
|
||||||
|
"@angular/core": "^6.0.0-rc.0 || ^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ngx-cropper/node_modules/tslib": {
|
||||||
|
"version": "1.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
|
},
|
||||||
"node_modules/ngx-extended-pdf-viewer": {
|
"node_modules/ngx-extended-pdf-viewer": {
|
||||||
"version": "13.0.0-alpha.2",
|
"version": "13.0.0-alpha.2",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
|
||||||
@@ -66448,6 +66467,22 @@
|
|||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ngx-cropper": {
|
||||||
|
"version": "2.0.0-beta",
|
||||||
|
"resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz",
|
||||||
|
"integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==",
|
||||||
|
"requires": {
|
||||||
|
"cropperjs": "^1.4.1",
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ngx-extended-pdf-viewer": {
|
"ngx-extended-pdf-viewer": {
|
||||||
"version": "13.0.0-alpha.2",
|
"version": "13.0.0-alpha.2",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
|
||||||
|
|||||||
@@ -193,6 +193,7 @@
|
|||||||
"ng-lazyload-image": "^9.1.2",
|
"ng-lazyload-image": "^9.1.2",
|
||||||
"ng2-pdf-viewer": "^3.0.8",
|
"ng2-pdf-viewer": "^3.0.8",
|
||||||
"ngx-cookie-service": "^12.0.3",
|
"ngx-cookie-service": "^12.0.3",
|
||||||
|
"ngx-cropper": "^2.0.0-beta",
|
||||||
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
|
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
|
||||||
"ngx-image-compress": "^11.0.3",
|
"ngx-image-compress": "^11.0.3",
|
||||||
"ngx-image-cropper": "^5.0.1",
|
"ngx-image-cropper": "^5.0.1",
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ import { calendarReducer } from './services/Repositorys/Agenda/agenda-memory-sou
|
|||||||
|
|
||||||
import {MatMenuModule} from '@angular/material/menu';
|
import {MatMenuModule} from '@angular/material/menu';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
|
import { AngularCropperjsModule } from 'angular-cropperjs';
|
||||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
// import { AngularFireModule } from '@angular/fire';
|
// import { AngularFireModule } from '@angular/fire';
|
||||||
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||||
@@ -191,7 +191,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
ImageCropperModule,
|
ImageCropperModule,
|
||||||
|
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatIconModule,
|
MatIconModule
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
DiplomaOptionsPage,
|
DiplomaOptionsPage,
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class ProfilePage implements OnInit {
|
|||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XTracerAsync({name:'profile/notificationClick', bugPrint: true, module:'notification'})
|
@XTracerAsync({name:'profile/notificationClick', bugPrint: true, module:'notification', autoFinish: false})
|
||||||
async notificatinsRoutes (index, item: NotificationTable, tracing?: TracingType) {
|
async notificatinsRoutes (index, item: NotificationTable, tracing?: TracingType) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -152,7 +152,9 @@ export class ProfilePage implements OnInit {
|
|||||||
this.isloading = true
|
this.isloading = true
|
||||||
if (item.service === "agenda") {
|
if (item.service === "agenda") {
|
||||||
|
|
||||||
|
tracing.addEvent('start getEventById')
|
||||||
let res = await this.agendaDataRepository.getEventById(item.idObject, tracing)
|
let res = await this.agendaDataRepository.getEventById(item.idObject, tracing)
|
||||||
|
tracing.addEvent('end getEventById')
|
||||||
|
|
||||||
if(item.idObject) {
|
if(item.idObject) {
|
||||||
|
|
||||||
@@ -168,9 +170,9 @@ export class ProfilePage implements OnInit {
|
|||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
tracing.setAttribute('outcome', 'success')
|
tracing.setAttribute('outcome', 'success')
|
||||||
} else {
|
} else {
|
||||||
tracing.setAttribute('outcome', 'success')
|
|
||||||
tracing.setAttribute('data.exist', 'false')
|
|
||||||
|
|
||||||
|
tracing.setAttribute('data.exist', 'false')
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
|
|
||||||
if (isHttpError(res.error)) {
|
if (isHttpError(res.error)) {
|
||||||
if(res.error.status == 404) {
|
if(res.error.status == 404) {
|
||||||
@@ -202,9 +204,10 @@ export class ProfilePage implements OnInit {
|
|||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
this.isloading = false
|
this.isloading = false
|
||||||
} else {
|
} else {
|
||||||
tracing.setAttribute('outcome', 'success')
|
|
||||||
console.log('evento não existe')
|
console.log('evento não existe')
|
||||||
tracing.setAttribute('data.exist', 'false')
|
tracing.setAttribute('data.exist', 'false')
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
this.objectRead[item.notificationId] = true
|
this.objectRead[item.notificationId] = true
|
||||||
this.isloading = false
|
this.isloading = false
|
||||||
}
|
}
|
||||||
@@ -223,8 +226,11 @@ export class ProfilePage implements OnInit {
|
|||||||
|
|
||||||
} else if (item.service === "gabinete-digital") {
|
} else if (item.service === "gabinete-digital") {
|
||||||
this.isloading = true
|
this.isloading = true
|
||||||
|
|
||||||
|
tracing.addEvent('start getTask')
|
||||||
this.processesService.GetTask(item.idObject).subscribe((task) => {
|
this.processesService.GetTask(item.idObject).subscribe((task) => {
|
||||||
|
|
||||||
|
tracing.addEvent('end getTask')
|
||||||
if (item.service === "gabinete-digital" && item.object === "expedientes") {
|
if (item.service === "gabinete-digital" && item.object === "expedientes") {
|
||||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', item.idObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', item.idObject, 'gabinete-digital']));
|
||||||
} else if (item.service === "gabinete-digital" && item.object === "despachos") {
|
} else if (item.service === "gabinete-digital" && item.object === "despachos") {
|
||||||
@@ -258,9 +264,29 @@ export class ProfilePage implements OnInit {
|
|||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
this.isloading = false
|
this.isloading = false
|
||||||
|
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
|
tracing.addEvent('end getTask')
|
||||||
|
tracing.log('gabinete notification not found', {
|
||||||
|
notificationObject: item
|
||||||
|
})
|
||||||
|
|
||||||
this.objectRead[item.notificationId] = true
|
this.objectRead[item.notificationId] = true
|
||||||
this.isloading = false
|
this.isloading = false
|
||||||
|
|
||||||
|
|
||||||
|
if(isHttpError(error)) {
|
||||||
|
tracing.setAttribute('getTask.http.status.code', error.status?.toString())
|
||||||
|
if(error.status == 400) {
|
||||||
|
tracing.setAttribute('outcome', 'failed')
|
||||||
|
} else {
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tracing.setAttribute('outcome', 'failed')
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -268,10 +294,14 @@ export class ProfilePage implements OnInit {
|
|||||||
if (item.service === "accoes" && item.idObject === "accao") {
|
if (item.service === "accoes" && item.idObject === "accao") {
|
||||||
this.zone.run(() => this.router.navigate(['/home/publications', item.idObject]));
|
this.zone.run(() => this.router.navigate(['/home/publications', item.idObject]));
|
||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
|
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
}
|
}
|
||||||
else if (item.service === "accoes" && item.idObject === "publicacao") {
|
else if (item.service === "accoes" && item.idObject === "publicacao") {
|
||||||
this.zone.run(() => this.router.navigate(['/home/publications/view-publications', item.folderId, item.idObject]));
|
this.zone.run(() => this.router.navigate(['/home/publications/view-publications', item.folderId, item.idObject]));
|
||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
|
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (item.service === "chat") {
|
} else if (item.service === "chat") {
|
||||||
@@ -285,22 +315,30 @@ export class ProfilePage implements OnInit {
|
|||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tracing.setAttribute('outcome', 'success')
|
||||||
this.deleteNotification(item);
|
this.deleteNotification(item);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
console.log({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId})
|
console.log({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId})
|
||||||
|
|
||||||
|
tracing.log('click notification no route', {
|
||||||
|
notificationObject: item
|
||||||
|
})
|
||||||
tracing.setAttribute('notification.route', 'false')
|
tracing.setAttribute('notification.route', 'false')
|
||||||
tracing.setAttribute('outcome', 'failed')
|
|
||||||
tracing.setAttribute('parameters', JSON.stringify({Service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId}))
|
tracing.setAttribute('parameters', JSON.stringify({Service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId}))
|
||||||
|
tracing.setAttribute('outcome', 'failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.log({service:item.service, Object, IdObject:item.idObject, FolderId: item.folderId})
|
console.log({service:item.service, Object, IdObject:item.idObject, FolderId: item.folderId})
|
||||||
|
|
||||||
tracing.setAttribute('outcome', 'failed')
|
tracing.log('click notification catch', {
|
||||||
|
notificationObject: item
|
||||||
|
})
|
||||||
tracing.setAttribute('parameters', JSON.stringify({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId}))
|
tracing.setAttribute('parameters', JSON.stringify({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId}))
|
||||||
tracing.setAttribute('error', JSON.stringify(error))
|
tracing.setAttribute('error', JSON.stringify(error))
|
||||||
|
tracing.setAttribute('outcome', 'failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<!-- Aside left -->
|
<!-- Aside left -->
|
||||||
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="TaskService.showLoaderNum != 0"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||||
<div class="title-container">
|
<div class="title-container">
|
||||||
<div class="title d-flex justify-center">
|
<div class="title d-flex justify-center">
|
||||||
<ion-label *ngIf="hideRefreshBtn">Gabinete Digital</ion-label>
|
<ion-label *ngIf="hideRefreshBtn">Gabinete Digital</ion-label>
|
||||||
|
|||||||
@@ -462,10 +462,10 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
async loadAllProcesses() {
|
async loadAllProcesses() {
|
||||||
|
|
||||||
// this.skeletonLoader = true
|
this.skeletonLoader = true
|
||||||
await this.TaskService.LoadTask()
|
await this.TaskService.LoadTask();
|
||||||
this.dynamicSearch()
|
this.dynamicSearch();
|
||||||
// this.skeletonLoader = false
|
this.skeletonLoader = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ export function APIReturn(schema: z.ZodTypeAny, path: string) {
|
|||||||
tracing?.setAttribute?.('map.error.schema-'+i, JSON.stringify(schema))
|
tracing?.setAttribute?.('map.error.schema-'+i, JSON.stringify(schema))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracing.log('API return '+ path, {
|
||||||
|
data: result?.value,
|
||||||
|
issues: error?.errors
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Throw any other unexpected errors
|
// Throw any other unexpected errors
|
||||||
// throw error;
|
// throw error;
|
||||||
@@ -74,6 +79,11 @@ export function APINODReturn(schema: z.ZodTypeAny, data , path: string, tracing?
|
|||||||
tracing?.setAttribute('map.error.schema-'+i, JSON.stringify(schema))
|
tracing?.setAttribute('map.error.schema-'+i, JSON.stringify(schema))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracing.log('API return '+ path, {
|
||||||
|
data,
|
||||||
|
issues: error?.errors
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
// Throw any other unexpected errors
|
// Throw any other unexpected errors
|
||||||
|
|||||||
@@ -52,11 +52,13 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
const span = _tracerInstance.startSpan(name);
|
const span = _tracerInstance.startSpan(name);
|
||||||
|
let finish = false
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
event: {},
|
event: {},
|
||||||
tags: {},
|
tags: {},
|
||||||
status: {} as any,
|
status: {} as any,
|
||||||
|
logs:[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const returnObject = {
|
const returnObject = {
|
||||||
@@ -83,14 +85,22 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
|
|
||||||
if(key =='outcome' && value == 'failed') {
|
if(key =='outcome' && value == 'failed') {
|
||||||
returnObject.hasError('error')
|
returnObject.hasError('error')
|
||||||
|
if(!autoFinish) {
|
||||||
|
returnObject.finish()
|
||||||
|
}
|
||||||
|
} else if (key =='outcome' && value == 'success') {
|
||||||
|
span.setStatus({code: SpanStatusCode.OK, message:name})
|
||||||
|
if(!autoFinish) {
|
||||||
|
returnObject.finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
log(message: string, data: Object) {
|
log(message: string, dataObject: Object) {
|
||||||
const spanId = span.spanContext().spanId;
|
const spanId = span.spanContext().spanId;
|
||||||
const _tracer = OpentelemetryLogging.getTracer('logging')
|
const _tracer = OpentelemetryLogging.getTracer('logging')
|
||||||
const spanContext = _tracer.startSpan(name)
|
const spanContext = _tracer.startSpan(name)
|
||||||
|
|
||||||
data = convertAttributesToString(data)
|
dataObject = convertAttributesToString(dataObject)
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
@@ -99,7 +109,7 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
payload: {
|
payload: {
|
||||||
message: message,
|
message: message,
|
||||||
object: {
|
object: {
|
||||||
...data,
|
...dataObject,
|
||||||
spanId,
|
spanId,
|
||||||
name,
|
name,
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
@@ -110,11 +120,15 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.logs.push(dataObject)
|
||||||
|
|
||||||
},
|
},
|
||||||
getAttribute: (key: string) => {
|
getAttribute: (key: string) => {
|
||||||
return data.tags[key]
|
return data.tags[key]
|
||||||
},
|
},
|
||||||
finish: () => {
|
finish: () => {
|
||||||
|
if(finish) return
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
span.end();
|
span.end();
|
||||||
UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name})
|
UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name})
|
||||||
@@ -123,6 +137,8 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
if(bugPrint && (data.tags['outcome'] == 'failed' || data.status?.code == SpanStatusCode.ERROR)) {
|
if(bugPrint && (data.tags['outcome'] == 'failed' || data.status?.code == SpanStatusCode.ERROR)) {
|
||||||
console.error(name, data)
|
console.error(name, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish = true
|
||||||
},
|
},
|
||||||
hasError:(message: string) => {
|
hasError:(message: string) => {
|
||||||
if(data.status?.code != SpanStatusCode.ERROR) {
|
if(data.status?.code != SpanStatusCode.ERROR) {
|
||||||
|
|||||||
@@ -124,10 +124,9 @@ export class NotificationsService {
|
|||||||
if (this.platform.is('ios')) {
|
if (this.platform.is('ios')) {
|
||||||
FCM.getToken()
|
FCM.getToken()
|
||||||
.then(r => {
|
.then(r => {
|
||||||
|
tracing.setAttribute('notification.token', 'true')
|
||||||
this.postToken(r.token, geturl, tracing)
|
this.postToken(r.token, geturl, tracing)
|
||||||
this.token = r.token
|
this.token = r.token
|
||||||
tracing.setAttribute('notification.token', 'true')
|
|
||||||
tracing.setAttribute('outcome', 'success')
|
|
||||||
// alert(this.token)
|
// alert(this.token)
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@@ -139,9 +138,10 @@ export class NotificationsService {
|
|||||||
|
|
||||||
PushNotifications.addListener('registration',
|
PushNotifications.addListener('registration',
|
||||||
(token: Token) => {
|
(token: Token) => {
|
||||||
|
|
||||||
|
tracing.setAttribute('notification.token', 'true')
|
||||||
this.postToken(token.value, geturl, tracing)
|
this.postToken(token.value, geturl, tracing)
|
||||||
this.token = token.value
|
this.token = token.value
|
||||||
tracing.setAttribute('notification.token', 'true')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -157,13 +157,11 @@ export class NotificationsService {
|
|||||||
this.token = token
|
this.token = token
|
||||||
tracing.setAttribute('notification.token', 'true')
|
tracing.setAttribute('notification.token', 'true')
|
||||||
tracing.setAttribute('outcome', 'success')
|
tracing.setAttribute('outcome', 'success')
|
||||||
tracing.finish()
|
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error('Permission denied:', error);
|
console.error('Permission denied:', error);
|
||||||
tracing.setAttribute('notification.token', 'false')
|
tracing.setAttribute('notification.token', 'false')
|
||||||
tracing.setAttribute('outcome', 'failed')
|
tracing.setAttribute('outcome', 'failed')
|
||||||
tracing.finish()
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+42
@@ -62,3 +62,45 @@ platformBrowserDynamic().bootstrapModule(AppModule)
|
|||||||
defineCustomElements(window);
|
defineCustomElements(window);
|
||||||
|
|
||||||
console.log(environment.version.lastCommitTime)
|
console.log(environment.version.lastCommitTime)
|
||||||
|
|
||||||
|
// error-capture.js
|
||||||
|
|
||||||
|
// Function to capture error details
|
||||||
|
function captureError(message, sourceURL, lineno, colno, error) {
|
||||||
|
const errorDetails = {
|
||||||
|
message: message || 'Unknown error',
|
||||||
|
sourceURL: sourceURL || 'Unknown source',
|
||||||
|
lineNumber: lineno || 'Unknown line',
|
||||||
|
columnNumber: colno || 'Unknown column',
|
||||||
|
stack: error ? error.stack : 'No stack trace'
|
||||||
|
};
|
||||||
|
|
||||||
|
// Log to console
|
||||||
|
console.error('Error Details:', JSON.stringify(errorDetails, null, 2));
|
||||||
|
|
||||||
|
// Optionally, send to server or write to a local storage
|
||||||
|
// Example: Sending to server (requires server-side handling)
|
||||||
|
// fetch('/log-error', {
|
||||||
|
// method: 'POST',
|
||||||
|
// headers: {
|
||||||
|
// 'Content-Type': 'application/json'
|
||||||
|
// },
|
||||||
|
// body: JSON.stringify(errorDetails)
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Example: Storing in localStorage
|
||||||
|
// localStorage.setItem('errorLog', JSON.stringify(errorDetails));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Capture errors from synchronous code
|
||||||
|
window.onerror = function(message, sourceURL, lineno, colno, error) {
|
||||||
|
captureError(message, sourceURL, lineno, colno, error);
|
||||||
|
// Return true to prevent default handling (optional)
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Capture errors from promise rejections
|
||||||
|
window.addEventListener('unhandledrejection', function(event) {
|
||||||
|
const { reason } = event;
|
||||||
|
captureError(reason.message || 'Unhandled rejection', 'Unknown source', 'Unknown line', 'Unknown column', reason);
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "2e7ebc71c",
|
"shortSHA": "8f0625eed",
|
||||||
"SHA": "2e7ebc71cea8c47f27fe163f1d460d9694e0b0ea",
|
"SHA": "8f0625eed4612d4f1564895de23a9ec633f54ca0",
|
||||||
"branch": "feature/agenda-api-peter",
|
"branch": "feature/agenda-api-peter",
|
||||||
"lastCommitAuthor": "'Peter Maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Mon Jul 29 17:23:41 2024 +0100'",
|
"lastCommitTime": "'Mon Jul 29 17:36:35 2024 +0100'",
|
||||||
"lastCommitMessage": "fix video controls",
|
"lastCommitMessage": "expand click area",
|
||||||
"lastCommitNumber": "5893",
|
"lastCommitNumber": "5894",
|
||||||
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/services/monitoring/opentelemetry/opentelemetry.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.html\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.scss\n\tmodified: version/git-version.ts",
|
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: package-lock.json\n\tmodified: package.json\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/decorator/api-validate-schema.decorator.ts\n\tmodified: src/app/services/monitoring/opentelemetry/tracer.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/main.ts",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user