Skip to content

Commit

Permalink
Revert plugins/main/public/components/overview/vulnerabilities/dashbo…
Browse files Browse the repository at this point in the history
…ards/overview/dashboard_panels_kpis.ts
  • Loading branch information
guidomodarelli committed Sep 27, 2024
1 parent ef2458d commit 684c32f
Showing 1 changed file with 11 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const getVisStateSeverityCritical = (indexPatternId: string) => {
bgColor: false,
labelColor: false,
subText: '',
fontSize: 40,
fontSize: 50,
},
},
},
Expand Down Expand Up @@ -119,7 +119,7 @@ const getVisStateSeverityHigh = (indexPatternId: string) => {
bgColor: false,
labelColor: false,
subText: '',
fontSize: 40,
fontSize: 50,
},
},
},
Expand Down Expand Up @@ -204,7 +204,7 @@ const getVisStateSeverityMedium = (indexPatternId: string) => {
bgColor: false,
labelColor: false,
subText: '',
fontSize: 40,
fontSize: 50,
},
},
},
Expand Down Expand Up @@ -289,7 +289,7 @@ const getVisStateSeverityLow = (indexPatternId: string) => {
bgColor: false,
labelColor: false,
subText: '',
fontSize: 40,
fontSize: 50,
},
},
},
Expand Down Expand Up @@ -341,87 +341,6 @@ const getVisStateSeverityLow = (indexPatternId: string) => {
};
};

const getVisStateEvaluatedEvaluationPending = (indexPatternId: string) => {
return {
id: 'vulnerabilities_evaluation_count',
title: 'Evaluation',
type: 'metric',
params: {
addLegend: false,
addTooltip: true,
metric: {
colorSchema: 'Green to Red',
colorsRange: [
{
from: 0,
to: 10000,
},
],
invertColors: false,
labels: {
show: true,
},
metricColorMode: 'None',
percentageMode: false,
style: {
bgColor: false,
bgFill: '#000',
fontSize: 40,
labelColor: false,
subText: '',
},
useRanges: false,
},
type: 'metric',
},
data: {
searchSource: {
query: {
language: 'kuery',
query: '',
},
filter: [],
index: indexPatternId,
},
references: [
{
name: 'kibanaSavedObjectMeta.searchSourceJSON.index',
type: 'index-pattern',
id: indexPatternId,
},
],
aggs: [
{
id: '1',
enabled: true,
type: 'count',
params: {
customLabel: 'Evaluation',
},
schema: 'metric',
},
{
id: '2',
enabled: true,
type: 'filters',
params: {
filters: [
{
input: {
language: 'kuery',
query: 'wazuh.vulnerability.under_evaluation:true',
},
label: 'Pending',
},
],
},
schema: 'group',
},
],
},
};
};

export const getKPIsPanel = (
indexPatternId: string,
): {
Expand All @@ -432,7 +351,7 @@ export const getKPIsPanel = (
return {
'1': {
gridData: {
w: 9,
w: 12,
h: 6,
x: 0,
y: 0,
Expand All @@ -446,9 +365,9 @@ export const getKPIsPanel = (
},
'2': {
gridData: {
w: 9,
w: 12,
h: 6,
x: 9,
x: 12,
y: 0,
i: '2',
},
Expand All @@ -460,9 +379,9 @@ export const getKPIsPanel = (
},
'3': {
gridData: {
w: 9,
w: 12,
h: 6,
x: 18,
x: 24,
y: 0,
i: '3',
},
Expand All @@ -474,9 +393,9 @@ export const getKPIsPanel = (
},
'4': {
gridData: {
w: 9,
w: 12,
h: 6,
x: 27,
x: 36,
y: 0,
i: '4',
},
Expand All @@ -486,19 +405,5 @@ export const getKPIsPanel = (
savedVis: getVisStateSeverityLow(indexPatternId),
},
},
'5': {
gridData: {
w: 12,
h: 6,
x: 36,
y: 0,
i: '5',
},
type: 'visualization',
explicitInput: {
id: '5',
savedVis: getVisStateEvaluatedEvaluationPending(indexPatternId),
},
},
};
};

0 comments on commit 684c32f

Please sign in to comment.