diff --git a/package.json b/package.json index 6affa2eb4..0857657a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azion-console-kit", - "version": "1.22.3", + "version": "1.22.4", "private": false, "type": "module", "repository": { diff --git a/src/assets/c3.scss b/src/assets/c3.scss index aa5718624..a866ff7d2 100644 --- a/src/assets/c3.scss +++ b/src/assets/c3.scss @@ -191,6 +191,7 @@ C3 dependency omits its styling for some reason. Thus it was needed to add this border: 1px solid var(--surface-border); box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); width: max-content; + max-width: 500px; } .c3-tooltip { diff --git a/src/helpers/real-time-filters-rules.js b/src/helpers/real-time-filters-rules.js index 4769f659d..3835d4129 100644 --- a/src/helpers/real-time-filters-rules.js +++ b/src/helpers/real-time-filters-rules.js @@ -10,8 +10,8 @@ const FILTER_BLACK_LIST = [ 'naxsiAttackFamilyIlike' ] -const SUPPORTED_FILTER_TYPE = ['String', 'Int', 'Float', 'IntRange', 'FloatRange'] -const FIELDS_LIKE = ['configurationIdIn', 'zoneIdIn', 'edgeFunctionIdIn'] +const SUPPORTED_FILTER_TYPE = ['String', 'Int', 'Float', 'IntRange', 'FloatRange', 'GenericScalar'] +const FIELDS_LIKE = ['configurationIdIn', 'zoneIdIn', 'edgeFunctionIdIn', 'botCategoryIn'] const ALIAS_MAPPING = { configurationId: 'domain' @@ -52,7 +52,8 @@ const MOST_RELEVANT_FIELDS = { const FILTER_LIKE_TYPE = { configurationIdIn: 'ArrayObject', zoneIdIn: 'ArrayObject', - edgeFunctionIdIn: 'ArrayObject' + edgeFunctionIdIn: 'ArrayObject', + botCategoryIn: 'ArrayObject' } const FILTER_LIKE_ALIAS = { diff --git a/src/modules/real-time-metrics/chart/format-c3-graph-props.js b/src/modules/real-time-metrics/chart/format-c3-graph-props.js index 4c8e5a024..a3d787a8f 100644 --- a/src/modules/real-time-metrics/chart/format-c3-graph-props.js +++ b/src/modules/real-time-metrics/chart/format-c3-graph-props.js @@ -108,7 +108,9 @@ export function formatC3XAxis(chartData, resultChart) { xAxis.min = CHART_RULES.RESET_COUNT xAxis.tick = { ...xAxis.tick, - width: CHART_RULES.LABEL.rotatedWidth + width: CHART_RULES.LABEL.rotatedWidth, + multiline: true, + multilineMax: 2 } } diff --git a/src/modules/real-time-metrics/constants/dashboards.js b/src/modules/real-time-metrics/constants/dashboards.js index b950572c9..5a8c636b0 100644 --- a/src/modules/real-time-metrics/constants/dashboards.js +++ b/src/modules/real-time-metrics/constants/dashboards.js @@ -139,6 +139,12 @@ const PAGES_DASHBOARDS = { label: 'Overview', path: 'overview', dataset: 'botManagerMetrics' + }, + { + id: '659868342290523846', + label: 'Breakdown', + path: 'breakdown', + dataset: 'securityMetrics' } ] } diff --git a/src/modules/real-time-metrics/constants/help-center-urls.js b/src/modules/real-time-metrics/constants/help-center-urls.js index 1f39c65a9..54bbf3243 100644 --- a/src/modules/real-time-metrics/constants/help-center-urls.js +++ b/src/modules/real-time-metrics/constants/help-center-urls.js @@ -78,7 +78,7 @@ const HELP_CENTER_URLS = { } }, botManager: { - botManagerSummary: { + botManagerOverview: { badBotHits: '/real-time-metrics/bot-manager-advanced/overview/bad-bot-hits', goodBotHits: '/real-time-metrics/bot-manager-advanced/overview/good-bot-hits', botHits: '/real-time-metrics/bot-manager-advanced/overview/bot-hits', @@ -86,11 +86,18 @@ const HELP_CENTER_URLS = { botTraffic: '/real-time-metrics/bot-manager-advanced/overview/bot-traffic', topBotAction: '/real-time-metrics/bot-manager-advanced/overview/top-bot-action', botCaptchaLine: '/real-time-metrics/bot-manager-advanced/overview/bot-captcha-line-graph', - topBotCaptchaPie: '/real-time-metrics/bot-manager-advanced/overview/top-bot-captcha-pie-graph', - topBotClassification: '/real-time-metrics/bot-manager-advanced/overview/top-bot-classifications', + topBotCaptchaPie: + '/real-time-metrics/bot-manager-advanced/overview/top-bot-captcha-pie-graph', + topBotClassification: + '/real-time-metrics/bot-manager-advanced/overview/top-bot-classifications', botActivityMap: '/real-time-metrics/bot-manager-advanced/overview/bot-activity-map' + }, + botManagerBreakdown: { + impactedUrls: '/real-time-metrics/bot-manager-advanced/breakdown/impacted-urls', + topIps: '/real-time-metrics/bot-manager-advanced/breakdown/top-ips', + topImpactedUrls: '/real-time-metrics/bot-manager-advanced/breakdown/top-impacted-urls' } - }, + } } export default HELP_CENTER_URLS diff --git a/src/modules/real-time-metrics/constants/reports-texts.js b/src/modules/real-time-metrics/constants/reports-texts.js index deebd1cbc..5aecd86dd 100644 --- a/src/modules/real-time-metrics/constants/reports-texts.js +++ b/src/modules/real-time-metrics/constants/reports-texts.js @@ -175,7 +175,7 @@ const REPORTS_TEXTS = { } }, botManager: { - botManagerSummary: { + botManagerOverview: { badBotHits: { description: 'Number of requests identified as bad bots.' }, @@ -206,6 +206,18 @@ const REPORTS_TEXTS = { botActivityMap: { description: 'Sum of requests identified as bots, presented by the country of origin.' } + }, + botManagerBreakdown: { + impactedUrls: { + description: 'Sum of the detected bot actions, broken down by the affected URLs.' + }, + topIps: { + description: + 'Sum of the detected bot actions, broken down by the highest-ranking IP addresses.' + }, + topImpactedUrls: { + description: 'Sum of the detected bot actions, broken down by the most affected URLs.' + } } } } diff --git a/src/modules/real-time-metrics/constants/reports.js b/src/modules/real-time-metrics/constants/reports.js index 57b3167c6..d58f70c9a 100644 --- a/src/modules/real-time-metrics/constants/reports.js +++ b/src/modules/real-time-metrics/constants/reports.js @@ -832,13 +832,13 @@ const REPORTS = [ }, /** * SECURE - * Bot Manager - Bot Manager Summary + * Bot Manager - Bot Manager Overview */ { id: '892249168369791027', chartOwner: 'azion', label: 'Bad Bot Hits', - description: REPORTS_TEXTS.botManager.botManagerSummary.badBotHits.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.badBotHits.description, aggregationType: 'sum', columns: 3, type: 'big-numbers', @@ -862,13 +862,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'inverse', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.badBotHits + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.badBotHits }, { id: '934654293238823255', chartOwner: 'azion', label: 'Good Bot Hits', - description: REPORTS_TEXTS.botManager.botManagerSummary.goodBotHits.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.goodBotHits.description, aggregationType: 'sum', columns: 3, type: 'big-numbers', @@ -892,13 +892,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'neutral', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.goodBotHits + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.goodBotHits }, { id: '259047966206560862', chartOwner: 'azion', label: 'Bot Hits', - description: REPORTS_TEXTS.botManager.botManagerSummary.botHits.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botHits.description, aggregationType: 'sum', columns: 3, type: 'big-numbers', @@ -922,13 +922,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'inverse', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.botHits + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.botHits }, { id: '541669034905662013', chartOwner: 'azion', label: 'Transactions', - description: REPORTS_TEXTS.botManager.botManagerSummary.transactions.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.transactions.description, aggregationType: 'sum', columns: 3, type: 'big-numbers', @@ -949,13 +949,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'neutral', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.transactions + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.transactions }, { id: '329891149133127508', chartOwner: 'azion', label: 'Bot Traffic', - description: REPORTS_TEXTS.botManager.botManagerSummary.botTraffic.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botTraffic.description, aggregationType: 'sum', columns: 6, type: 'line', @@ -975,13 +975,13 @@ const REPORTS = [ orderDirection: 'ASC', dashboardId: '371360344901061482', variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.botTraffic + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.botTraffic }, { id: '577704475532819772', chartOwner: 'azion', label: 'Top Bot Action', - description: REPORTS_TEXTS.botManager.botManagerSummary.botAction.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botAction.description, aggregationType: 'sum', columns: 6, type: 'pie', @@ -1007,13 +1007,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.topBotAction + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.topBotAction }, { id: '071851224118431167', chartOwner: 'azion', label: 'Bot CAPTCHA', - description: REPORTS_TEXTS.botManager.botManagerSummary.botCaptcha.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botCaptcha.description, aggregationType: 'sum', columns: 6, type: 'line', @@ -1028,21 +1028,19 @@ const REPORTS = [ variable: 'requests' } ], - filters: { - actionEq: 'redirect' - }, + filters: {}, limit: 5000, groupBy: ['challengeSolved'], orderDirection: 'ASC', dashboardId: '371360344901061482', - variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.botCaptchaLine + variationType: 'inverse', + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.botCaptchaLine }, { id: '455330743572401794', chartOwner: 'azion', label: 'Top Bot CAPTCHA', - description: REPORTS_TEXTS.botManager.botManagerSummary.botCaptcha.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botCaptcha.description, aggregationType: 'sum', columns: 6, type: 'pie', @@ -1057,22 +1055,20 @@ const REPORTS = [ variable: 'requests' } ], - filters: { - actionEq: 'redirect' - }, + filters: {}, limit: 2, groupBy: ['challengeSolved'], fields: ['challengeSolved'], orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.topBotCaptchaPie + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.topBotCaptchaPie }, { id: '424388331488145485', chartOwner: 'azion', label: 'Top Bot Classifications', - description: REPORTS_TEXTS.botManager.botManagerSummary.botClassification.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botClassification.description, aggregationType: 'sum', columns: 6, type: 'ordered-bar', @@ -1098,13 +1094,13 @@ const REPORTS = [ orderDirection: 'DESC', dashboardId: '371360344901061482', variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.topBotClassification + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.topBotClassification }, { id: '190246009413028885', chartOwner: 'azion', label: 'Bot Activity Map', - description: REPORTS_TEXTS.botManager.botManagerSummary.botActivityMap.description, + description: REPORTS_TEXTS.botManager.botManagerOverview.botActivityMap.description, aggregationType: 'sum', columns: 6, type: 'map', @@ -1128,7 +1124,104 @@ const REPORTS = [ orderDirection: 'ASC', dashboardId: '371360344901061482', variationType: 'regular', - helpCenterPath: HELP_CENTER_URLS.botManager.botManagerSummary.botActivityMap + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerOverview.botActivityMap + }, + /** + * SECURE + * Bot Manager - Bot Manager Breakdown + */ + { + id: '847143804009563421', + chartOwner: 'azion', + label: 'Impacted URLs', + description: REPORTS_TEXTS.botManager.botManagerBreakdown.impactedUrls.description, + aggregationType: 'sum', + columns: 3, + type: 'big-numbers', + xAxis: 'ts', + isTopX: false, + rotated: false, + dataset: 'securityMetrics', + dataUnit: 'count', + limit: 10000, + aggregations: [ + { + aggregation: 'sum', + variable: 'value' + } + ], + filters: { + metricEq: 'uniq_request_url', + datasetEq: 'bot_manager' + }, + groupBy: [], + fields: [], + orderDirection: 'DESC', + dashboardId: '659868342290523846', + variationType: 'inverse', + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerBreakdown.impactedUrls + }, + { + id: '978435123222265554', + chartOwner: 'azion', + label: 'Top IPs', + description: REPORTS_TEXTS.botManager.botManagerBreakdown.topIps.description, + aggregationType: 'sum', + columns: 6, + type: 'ordered-bar', + xAxis: 'cat', + isTopX: true, + rotated: true, + dataUnit: 'count', + dataset: 'securityMetrics', + aggregations: [ + { + aggregation: 'sum', + variable: 'value' + } + ], + filters: { + datasetEq: 'bot_manager', + metricEq: 'top_remote_addr' + }, + limit: 10, + groupBy: ['dimension1'], + fields: ['dimension1'], + orderDirection: 'DESC', + dashboardId: '659868342290523846', + variationType: 'regular', + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerBreakdown.topIps + }, + { + id: '1030427483148242', + chartOwner: 'azion', + label: 'Top Impacted URLs', + description: REPORTS_TEXTS.botManager.botManagerBreakdown.topImpactedUrls.description, + aggregationType: 'sum', + columns: 6, + type: 'ordered-bar', + xAxis: 'cat', + isTopX: true, + rotated: true, + dataUnit: 'count', + dataset: 'securityMetrics', + aggregations: [ + { + aggregation: 'sum', + variable: 'value' + } + ], + filters: { + datasetEq: 'bot_manager', + metricEq: 'top_request_url' + }, + limit: 10, + groupBy: ['dimension1'], + fields: ['dimension1'], + orderDirection: 'DESC', + dashboardId: '659868342290523846', + variationType: 'regular', + helpCenterPath: HELP_CENTER_URLS.botManager.botManagerBreakdown.topImpactedUrls }, /** * OBSERVE diff --git a/src/modules/real-time-metrics/constants/services-operator-in.js b/src/modules/real-time-metrics/constants/services-operator-in.js index a2ba4b254..53276b153 100644 --- a/src/modules/real-time-metrics/constants/services-operator-in.js +++ b/src/modules/real-time-metrics/constants/services-operator-in.js @@ -1,13 +1,15 @@ import { searchEdgeFunctionsService, searchDomainsService, - searchEdgeDnsService + searchEdgeDnsService, + searchBotCategoryService } from '@/services/real-time-metrics-services' const MAP_SERVICE_OPERATION = { configurationIdIn: searchDomainsService, zoneIdIn: searchEdgeDnsService, - edgeFunctionIdIn: searchEdgeFunctionsService + edgeFunctionIdIn: searchEdgeFunctionsService, + botCategoryIn: searchBotCategoryService } export default MAP_SERVICE_OPERATION diff --git a/src/modules/real-time-metrics/index.js b/src/modules/real-time-metrics/index.js index f8cef5392..bd01da13c 100644 --- a/src/modules/real-time-metrics/index.js +++ b/src/modules/real-time-metrics/index.js @@ -301,10 +301,16 @@ const setCurrentReportValue = (reportInfo) => { if (reportIdx < 0) return + if (Array.isArray(reportInfo.resultQuery[0]) && !reportInfo.resultQuery[0][1]) { + reportInfo.resultQuery = [] + } + reports.current[reportIdx] = { ...reports.current[reportIdx], - ...reportInfo + ...reportInfo, + done: true } + notify(reportObservers, reports) } diff --git a/src/modules/real-time-metrics/reports/convert-beholder-to-chart.js b/src/modules/real-time-metrics/reports/convert-beholder-to-chart.js index c80448fb0..3e272235f 100644 --- a/src/modules/real-time-metrics/reports/convert-beholder-to-chart.js +++ b/src/modules/real-time-metrics/reports/convert-beholder-to-chart.js @@ -330,6 +330,18 @@ const formatTsChartData = ({ }) const seriesArray = fillSeriesWithZeroes(series, countValues) + + if (report.id === '071851224118431167') { + seriesArray.forEach((serie) => { + // linter complains about ternary + if (serie[0] === 'false') { + serie[0] = 'Not Solved' + } + if (serie[0] === 'true') { + serie[0] = 'Solved' + } + }) + } // ensures that the X-axis is the first set of data. return [xAxisData, ...seriesArray] } @@ -429,7 +441,11 @@ const formatBigNumbers = ({ report, data }) => { const aggregation = report.aggregationType const total = data[dataset].reduce((acc, current) => acc + current[aggregation || fieldName], 0) - const { unit, value } = formatDataUnit(total, report) + let { unit, value } = formatDataUnit(total, report) + + if (report.id === '847143804009563421') { + unit = 'URLs' + } return [ { @@ -504,6 +520,10 @@ const formatMapChartData = ({ report, data }) => { return result }) + if (!heatmap.length) { + return [] + } + return [ { bubbles: [], diff --git a/src/modules/real-time-metrics/reports/convert-report-meta-to-gql.js b/src/modules/real-time-metrics/reports/convert-report-meta-to-gql.js index ae9f0499a..33bb89be3 100644 --- a/src/modules/real-time-metrics/reports/convert-report-meta-to-gql.js +++ b/src/modules/real-time-metrics/reports/convert-report-meta-to-gql.js @@ -123,6 +123,7 @@ export default class GqlRules { if (Object.keys(this.filters).length) { Object.keys(this.queryFilters).forEach((key) => { + if (key === 'datasets') return // used internally by the advanced filter filtersStr += FiltersToGraphQLString(key, this.queryFilters[key]) }) } @@ -150,7 +151,7 @@ export default class GqlRules { ${filtersStr} } ) { - ${fields.join('\n')} + ${[...new Set(fields)].join('\n')} } }` diff --git a/src/plugins/analytics/AnalyticsTrackerAdapter.js b/src/plugins/analytics/AnalyticsTrackerAdapter.js index 68587e4c5..4200d0e05 100644 --- a/src/plugins/analytics/AnalyticsTrackerAdapter.js +++ b/src/plugins/analytics/AnalyticsTrackerAdapter.js @@ -3,7 +3,8 @@ import { SignInTracker, CreateTracker, ProductTracker, - WafRulesTracker + WafRulesTracker, + RealTimeMetricsTracker } from './trackers' /** @@ -35,6 +36,8 @@ export class AnalyticsTrackerAdapter { #productTracker = null /** @type {WafTracker} */ #wafRulesTracker = null + /** @type {RealTimeMetricsTracker} */ + #realTimeMetricsTracker = null /** * Creates an instance of AnalyticsTrackerAdapter. @@ -49,6 +52,7 @@ export class AnalyticsTrackerAdapter { this.#createTracker = new CreateTracker(this) this.#productTracker = new ProductTracker(this) this.#wafRulesTracker = new WafRulesTracker(this) + this.#realTimeMetricsTracker = new RealTimeMetricsTracker(this) } /** @@ -135,4 +139,11 @@ export class AnalyticsTrackerAdapter { get wafRules() { return this.#wafRulesTracker } + + /** + * @return {RealTimeMetricsTracker} + */ + get realTimeMetrics() { + return this.#realTimeMetricsTracker + } } diff --git a/src/plugins/analytics/trackers/RealTimeMetricsTracker.js b/src/plugins/analytics/trackers/RealTimeMetricsTracker.js new file mode 100644 index 000000000..b21dd8413 --- /dev/null +++ b/src/plugins/analytics/trackers/RealTimeMetricsTracker.js @@ -0,0 +1,30 @@ +export class RealTimeMetricsTracker { + /** + * Interface for TrackerAdapter. + * @typedef {Object} trackerAdapter + * @property {function({eventName: string, props: Object}): void} addEvent - Method to add an event. + */ + #trackerAdapter + + /** + * @param {trackerAdapter} trackerAdapter + */ + constructor(adapter) { + this.#trackerAdapter = adapter + } + + /** + * @param {Object} payload + * @param {AzionProductsNames} payload.productName + * @returns {AnalyticsTrackerAdapter} + */ + clickedToRealTimeMetrics({ eventName, payload }) { + this.#trackerAdapter.addEvent({ + eventName, + props: { + ...payload + } + }) + return this.#trackerAdapter + } +} diff --git a/src/plugins/analytics/trackers/index.js b/src/plugins/analytics/trackers/index.js index 326a99c82..629dda453 100644 --- a/src/plugins/analytics/trackers/index.js +++ b/src/plugins/analytics/trackers/index.js @@ -3,5 +3,6 @@ import { SignInTracker } from './SignInTracker' import { CreateTracker } from './CreateTracker' import { ProductTracker } from './ProductTracker' import { WafRulesTracker } from './WafRulesTracker' +import { RealTimeMetricsTracker } from './RealTimeMetricsTracker' -export { SignUpTracker, SignInTracker, CreateTracker, ProductTracker, WafRulesTracker } +export { SignUpTracker, SignInTracker, CreateTracker, ProductTracker, WafRulesTracker, RealTimeMetricsTracker } diff --git a/src/services/billing-services/list-payment-history-service.js b/src/services/billing-services/list-payment-history-service.js index a8fb3bea3..f8a4a7381 100644 --- a/src/services/billing-services/list-payment-history-service.js +++ b/src/services/billing-services/list-payment-history-service.js @@ -33,7 +33,7 @@ const STATUS_AS_TAG = { const adapt = (httpResponse) => { const managerUrl = getStaticUrlsByEnvironment('manager') - const parseBilling = httpResponse.body.data?.map((card) => { + const parseBilling = httpResponse.body.results?.map((card) => { const typeCard = card.card_brand?.toLowerCase() const statusTag = STATUS_AS_TAG[card.status] || STATUS_AS_TAG.NotCharged const invoiceUrl = card.invoice_url ? `${managerUrl}${card.invoice_url}` : null diff --git a/src/services/compare-with-azion/get-test-from-webpagetest.js b/src/services/compare-with-azion/get-test-from-webpagetest.js index 5c08119d6..79b139cd8 100644 --- a/src/services/compare-with-azion/get-test-from-webpagetest.js +++ b/src/services/compare-with-azion/get-test-from-webpagetest.js @@ -1,15 +1,7 @@ import { AxiosHttpClientAdapter } from '../axios/AxiosHttpClientAdapter' import makeWebpagetestApi from '../axios/makeWebpagetestApi' -// import { makeWebpagetestBaseUrlExternal } from './make-base-webpagetest-url' export const getResultFromWebpagetest = async (id) => { - if (!id) { - return { - status: 400, - error: `Invalid ID param.` - } - } - let httpResponse = await AxiosHttpClientAdapter.request( { url: `/jsonResult.php?test=${id}`, diff --git a/src/services/compare-with-azion/get-test.js b/src/services/compare-with-azion/get-test.js index de901f4a0..037178377 100644 --- a/src/services/compare-with-azion/get-test.js +++ b/src/services/compare-with-azion/get-test.js @@ -2,14 +2,7 @@ import { AxiosHttpClientAdapter } from '../axios/AxiosHttpClientAdapter' import makeCompareWithAzionApi from '../axios/makeCompareWithAzionApi' import { makeWebpagetestBaseUrl } from './make-base-url' -export const getTestById = async (id, clientId = undefined) => { - if (!id) { - return { - status: 400, - error: `Invalid testId param.` - } - } - +export const getTestById = async (id, clientId) => { let url = `${makeWebpagetestBaseUrl()}/db/test?id=${id}` if (clientId) { @@ -28,13 +21,6 @@ export const getTestById = async (id, clientId = undefined) => { } export const getAllTestsByClientId = async (clientId) => { - if (!clientId) { - return { - status: 400, - error: `Invalid clientId param.` - } - } - let httpResponse = await AxiosHttpClientAdapter.request( { url: `${makeWebpagetestBaseUrl()}/db/all-clientid-tests?clientId=${clientId}`, diff --git a/src/services/real-time-metrics-services/index.js b/src/services/real-time-metrics-services/index.js index 48fa6ea05..43de7374a 100644 --- a/src/services/real-time-metrics-services/index.js +++ b/src/services/real-time-metrics-services/index.js @@ -2,10 +2,12 @@ import { searchDomainsService } from './search-domains-service' import { searchEdgeDnsService } from './search-edge-dns-service' import { searchEdgeFunctionsService } from './search-edge-functions' import { loadRealTimeMetricsData } from './load-real-time-metrics-data' +import { searchBotCategoryService } from './search-bot-category-service' export { searchDomainsService, searchEdgeDnsService, searchEdgeFunctionsService, - loadRealTimeMetricsData + loadRealTimeMetricsData, + searchBotCategoryService } diff --git a/src/services/real-time-metrics-services/search-bot-category-service.js b/src/services/real-time-metrics-services/search-bot-category-service.js new file mode 100644 index 000000000..2b33c5aad --- /dev/null +++ b/src/services/real-time-metrics-services/search-bot-category-service.js @@ -0,0 +1,8 @@ +export const searchBotCategoryService = () => { + return [ + { label: 'Legitimate', value: 'legitimate' }, + { label: 'Good Bot', value: 'good bot' }, + { label: 'Bad Bot', value: 'bad bot' }, + { label: 'Under Evaluation', value: 'under evaluation' } + ] +} diff --git a/src/templates/advanced-filter/component/fields/multiselect-filter.vue b/src/templates/advanced-filter/component/fields/multiselect-filter.vue index 3d12cc00b..4282b5ba9 100644 --- a/src/templates/advanced-filter/component/fields/multiselect-filter.vue +++ b/src/templates/advanced-filter/component/fields/multiselect-filter.vue @@ -1,5 +1,5 @@