Skip to content

Commit

Permalink
feat: migrate all drawer for new layout on event page
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloSF0 committed Feb 28, 2025
1 parent 8b12ea5 commit e5dd427
Show file tree
Hide file tree
Showing 38 changed files with 413 additions and 766 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const adaptResponse = (response) => {
const data = body.data.activityHistoryEvents?.map((activityHistoryEvents) => ({
id: generateCurrentTimestamp(),
summary: buildSummary(activityHistoryEvents),
userId: activityHistoryEvents.userId,
ts: activityHistoryEvents.ts,
tsFormat: convertValueToDate(activityHistoryEvents.ts)
}))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { convertValueToDate } from '@/helpers/convert-date'
import { capitalizeFirstLetter } from '@/helpers'
import { buildSummary, capitalizeFirstLetter } from '@/helpers'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'

export const loadActivityHistory = async (filter) => {
Expand Down Expand Up @@ -44,10 +44,6 @@ const adaptResponse = (response) => {
title: activityHistoryEvents.title,
type: capitalizeFirstLetter(activityHistoryEvents.type),
ts: convertValueToDate(activityHistoryEvents.ts),
authorName: activityHistoryEvents.authorName,
accountId: activityHistoryEvents.accountId,
userId: activityHistoryEvents.userId,
authorEmail: activityHistoryEvents.authorEmail,
comment: activityHistoryEvents.comment
data: buildSummary(activityHistoryEvents)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const adaptResponse = (response) => {
const totalRecords = body.data.dataStreamedEvents?.length

const data = body.data.dataStreamedEvents?.map((dataStreamedEvents) => ({
configurationId: dataStreamedEvents.configurationId,
id: generateCurrentTimestamp(),
summary: buildSummary(dataStreamedEvents),
ts: dataStreamedEvents.ts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { convertValueToDate } from '@/helpers/convert-date'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadDataStream = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -52,15 +53,10 @@ const adaptResponse = (response) => {
return {
url: dataStreamedEvents.url,
ts: convertValueToDate(dataStreamedEvents.ts),
streamedLines: dataStreamedEvents.streamedLines,
dataStreamed: dataStreamedEvents.dataStreamed,
configurationId: dataStreamedEvents.configurationId,
source: dataStreamedEvents.source,
statusCode: dataStreamedEvents.statusCode,
endpointType: dataStreamedEvents.endpointType,
jobName: {
content: dataStreamedEvents.jobName,
severity: 'info'
}
},
data: buildSummary(dataStreamedEvents)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const adaptResponse = (response) => {
id: generateCurrentTimestamp(),
summary: buildSummary(edgeDnsQueriesEvents),
ts: edgeDnsQueriesEvents.ts,
tsFormat: convertValueToDate(edgeDnsQueriesEvents.ts)
tsFormat: convertValueToDate(edgeDnsQueriesEvents.ts),
uuid: edgeDnsQueriesEvents.uuid,
source: edgeDnsQueriesEvents.source
}))

return {
Expand Down
59 changes: 2 additions & 57 deletions src/services/real-time-events-service/edge-dns/load-edge-dns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadEdgeDNS = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -45,69 +46,13 @@ const adapt = (filter) => {
return convertGQL(formatFilter, table)
}

const levelMap = {
ERROR: {
content: 'Error',
severity: 'danger',
icon: 'pi pi-times-circle'
},
WARN: {
content: 'Warning',
severity: 'warning',
icon: 'pi pi-exclamation-triangle'
},
INFO: {
content: 'Info',
severity: 'info',
icon: 'pi pi-info-circle'
},
DEBUG: {
content: 'Debug',
severity: 'success',
icon: 'pi pi-check-circle'
},
TRACE: {
content: 'Trace',
severity: 'info',
icon: 'pi pi-code'
}
}

const qtypeMap = (value) => {
const defaultText = value
? 'Address Mapping record (A Record), also known as a DNS host record, stores a hostname and its corresponding IPv4 address.'
: '-'

const mapType = {
AAAA: 'IP Version 6 Address record (AAAA Record) stores a hostname and its corresponding IPv6 address.',
ANAME:
'ALIAS record is a virtual record type created to provide CNAME, like behavior on apex domains.',
CAA: 'A CAA record allows a DNS domain name holder to specify one or more Certification Authorities (CAs) authorized to issue certificates for that domain or subdomain.',
CNAME:
'Canonical Name record (CNAME Record) can be used to alias a hostname to another hostname. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.',
MX: 'Mail exchanger record (MX Record) specifies an SMTP email server for the domain, used to route outgoing emails to an email server.',
NS: 'NS-records identify the DNS servers responsible (authoritative) for a zone. A zone should contain one NS-record for each of its own DNS servers (primary and secondaries).',
PTR: 'PTR records are used for the Reverse DNS (Domain Name System) lookup. Using the IP address, you can get the associated domain/hostname. An A record should exist for every PTR record. The usage of a reverse DNS setup for a mail server is a good solution.',
SRV: 'A Service record (SRV record) is a specification of data in the Domain Name System defining the location. For example: the hostname and port number, of servers for specified services. It’s defined in RFC 2782, and its type code is 33.',
TXT: 'A TXT record (short for text record) is a type of resource record in the Domain Name System (DNS) used to provide the ability to associate arbitrary text with a host or other name, such as human readable information about a server, network, data center, or other accounting information.'
}

return mapType[value] || defaultText
}

const adaptResponse = (response) => {
const { body } = response
const [edgeDnsQueriesEvents = {}] = body.data.idnsQueriesEvents

return {
level: levelMap[edgeDnsQueriesEvents.level],
ts: edgeDnsQueriesEvents.ts,
qtype: edgeDnsQueriesEvents.qtype,
qTypeDescription: qtypeMap(edgeDnsQueriesEvents.qtype),
uuid: edgeDnsQueriesEvents.uuid,
zoneId: edgeDnsQueriesEvents.zoneId,
statusCode: edgeDnsQueriesEvents.statusCode,
resolutionType: edgeDnsQueriesEvents.resolutionType,
solutionId: edgeDnsQueriesEvents.solutionId
data: buildSummary(edgeDnsQueriesEvents)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const adapt = (filter) => {
const table = {
dataset: 'cellsConsoleEvents',
limit: 10000,
fields: ['configurationId', 'functionId', 'id', 'level', 'lineSource', 'source', 'ts'],
fields: ['configurationId', 'functionId', 'id', 'level', 'lineSource', 'source', 'ts', 'line'],
orderBy: 'ts_ASC'
}
return convertGQL(filter, table)
Expand All @@ -41,6 +41,9 @@ const adaptResponse = (body) => {
const parser = cellsConsoleEventsList?.length
? cellsConsoleEventsList.map((cellsConsoleEvents) => ({
summary: buildSummary(cellsConsoleEvents),
configurationId: cellsConsoleEvents.configurationId,
source: cellsConsoleEvents.source,
line: cellsConsoleEvents.line,
id: generateCurrentTimestamp(),
tsFormat: convertValueToDate(cellsConsoleEvents.ts),
ts: cellsConsoleEvents.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { convertValueToDate } from '@/helpers/convert-date'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadEdgeFunctionsConsole = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -87,11 +88,6 @@ const adaptResponse = (response) => {
lineSource: cellsConsoleEvents.lineSource,
level: levelMap[cellsConsoleEvents.level],
ts: convertValueToDate(cellsConsoleEvents.ts),
line: cellsConsoleEvents.line,
id: cellsConsoleEvents.id,
solutionId: cellsConsoleEvents.solutionId,
functionId: cellsConsoleEvents.functionId,
configurationId: cellsConsoleEvents.configurationId,
source: cellsConsoleEvents.source
data: buildSummary(cellsConsoleEvents)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const adaptResponse = (response) => {
id: generateCurrentTimestamp(),
summary: buildSummary(edgeFunctionsEvents),
ts: edgeFunctionsEvents.ts,
tsFormat: convertValueToDate(edgeFunctionsEvents.ts)
tsFormat: convertValueToDate(edgeFunctionsEvents.ts),
configurationId: edgeFunctionsEvents.configurationId
}))

return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import convertGQL from '@/helpers/convert-gql'
import { convertValueToDate } from '@/helpers/convert-date'

import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadEdgeFunctions = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -53,15 +53,8 @@ const adaptResponse = (response) => {

return {
id: edgeFunctionsEvents.ts + edgeFunctionsEvents.configurationId,
data: buildSummary(edgeFunctionsEvents),
functionLanguage: edgeFunctionsEvents.functionLanguage,
ts: convertValueToDate(edgeFunctionsEvents.ts),
edgeFunctionsList: edgeFunctionsEvents.edgeFunctionsList?.split(';'),
edgeFunctionsTime: edgeFunctionsEvents.edgeFunctionsTime,
edgeFunctionsInitiatorTypeList: edgeFunctionsEvents.edgeFunctionsInitiatorTypeList,
edgeFunctionsInstanceIdList: edgeFunctionsEvents.edgeFunctionsInstanceIdList,
edgeFunctionsSolutionId: edgeFunctionsEvents.edgeFunctionsSolutionId,
source: edgeFunctionsEvents.source,
virtualHostId: edgeFunctionsEvents.virtualhostid,
configurationId: edgeFunctionsEvents.configurationId
ts: convertValueToDate(edgeFunctionsEvents.ts)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ const adapt = (filter) => {
const table = {
dataset: 'imagesProcessedEvents',
limit: 10000,
fields: ['configurationId', 'host', 'requestUri', 'status', 'bytesSent', 'httpReferer', 'ts'],
fields: [
'configurationId',
'host',
'requestUri',
'status',
'bytesSent',
'httpReferer',
'ts',
'httpUserAgent'
],
orderBy: 'ts_ASC'
}
return convertGQL(filter, table)
Expand All @@ -40,6 +49,9 @@ const adaptResponse = (response) => {

const data = body.data.imagesProcessedEvents?.map((imagesProcessedEvents) => ({
id: generateCurrentTimestamp(),
configurationId: imagesProcessedEvents.configurationId,
httpUserAgent: imagesProcessedEvents.httpUserAgent,
httpReferer: imagesProcessedEvents.httpReferer,
summary: buildSummary(imagesProcessedEvents),
ts: imagesProcessedEvents.ts,
tsFormat: convertValueToDate(imagesProcessedEvents.ts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { convertValueToDate } from '@/helpers/convert-date'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadImageProcessor = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -66,29 +67,9 @@ const adaptResponse = (response) => {
const { body } = response
const [imagesProcessedEvents = {}] = body.data.imagesProcessedEvents
return {
bytesSent: imagesProcessedEvents.bytesSent,
configurationId: imagesProcessedEvents.configurationId,
host: imagesProcessedEvents.host,
httpReferer: imagesProcessedEvents.httpReferer,
httpUserAgent: imagesProcessedEvents.httpUserAgent,
referenceError: imagesProcessedEvents.referenceError,
remoteAddr: imagesProcessedEvents.remoteAddr,
remotePort: imagesProcessedEvents.remotePort,
requestMethod: imagesProcessedEvents.requestMethod,
requestTime: imagesProcessedEvents.requestTime,
requestUri: imagesProcessedEvents.requestUri,
scheme: imagesProcessedEvents.scheme?.toUpperCase(),
solution: imagesProcessedEvents.solution,
sslCipher: imagesProcessedEvents.sslCipher,
sslProtocol: imagesProcessedEvents.sslProtocol,
sslSessionReused: imagesProcessedEvents.sslSessionReused,
status: imagesProcessedEvents.status,
tcpinfoRtt: imagesProcessedEvents.tcpinfoRtt,
host: imagesProcessedEvents.host,
ts: convertValueToDate(imagesProcessedEvents.ts),
upstreamCacheStatus: imagesProcessedEvents.upstreamCacheStatus,
upstreamResponseTime: imagesProcessedEvents.upstreamResponseTime,
upstreamResponseTimeStr: imagesProcessedEvents.upstreamResponseTimeStr,
upstreamStatus: imagesProcessedEvents.upstreamStatus,
upstreamStatusStr: imagesProcessedEvents.upstreamStatusStr
data: buildSummary(imagesProcessedEvents)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ const adaptResponse = (response) => {
const totalRecords = body.data.l2CacheEvents?.length

const data = body.data.l2CacheEvents?.map((tieredCacheEvents) => ({
configurationId: tieredCacheEvents.configurationId,
source: tieredCacheEvents.source,
host: tieredCacheEvents.host,
proxyHost: tieredCacheEvents.proxyHost,
id: generateCurrentTimestamp(),
summary: buildSummary(tieredCacheEvents),
ts: tieredCacheEvents.ts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import convertGQL from '@/helpers/convert-gql'
import { AxiosHttpClientSignalDecorator } from '../../axios/AxiosHttpClientSignalDecorator'
import { convertValueToDate } from '@/helpers/convert-date'
import { makeRealTimeEventsBaseUrl } from '../make-real-time-events-service'
import { buildSummary } from '@/helpers'

export const loadTieredCache = async (filter) => {
const payload = adapt(filter)
Expand Down Expand Up @@ -75,36 +76,10 @@ const adaptResponse = (response) => {
const [l2CacheEvents = {}] = body.data.l2CacheEvents

return {
bytesSent: l2CacheEvents.bytesSent,
cacheKey: l2CacheEvents.cacheKey,
cacheTtl: l2CacheEvents.cacheTtl,
configurationId: l2CacheEvents.configurationId,
host: l2CacheEvents.host,
clientId: l2CacheEvents.clientId,
proxyHost: l2CacheEvents.proxyHost,
proxyStatus: l2CacheEvents.proxyStatus,
proxyUpstream: l2CacheEvents.proxyUpstream,
referenceError: l2CacheEvents.referenceError,
remoteAddr: l2CacheEvents.remoteAddr,
remotePort: l2CacheEvents.remotePort,
requestLength: l2CacheEvents.requestLength,
requestMethod: l2CacheEvents.requestMethod,
requestTime: l2CacheEvents.requestTime,
requestUri: l2CacheEvents.requestUri,
scheme: l2CacheEvents.scheme?.toUpperCase(),
sentHttpContentType: l2CacheEvents.sentHttpContentType,
serverProtocol: l2CacheEvents.serverProtocol?.toUpperCase(),
solution: l2CacheEvents.solution,
status: l2CacheEvents.status,
tcpinfoRtt: l2CacheEvents.tcpinfoRtt,
proxyHost: l2CacheEvents.proxyHost,
ts: convertValueToDate(l2CacheEvents.ts),
upstreamBytesReceived: l2CacheEvents.upstreamBytesReceived,
upstreamBytesReceivedStr: l2CacheEvents.upstreamBytesReceivedStr,
upstreamCacheStatus: l2CacheEvents.upstreamCacheStatus,
upstreamConnectTime: l2CacheEvents.upstreamConnectTime,
upstreamHeaderTime: l2CacheEvents.upstreamHeaderTime,
upstreamResponseTime: l2CacheEvents.upstreamResponseTime,
upstreamStatus: l2CacheEvents.upstreamStatus,
source: l2CacheEvents.source
serverProtocol: l2CacheEvents.serverProtocol?.toUpperCase(),
data: buildSummary(l2CacheEvents)
}
}
Loading

0 comments on commit e5dd427

Please sign in to comment.