Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kibana-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gn4-3-wp8-t3.1 SOC
kibana-plugins
Commits
c6c1396d
Commit
c6c1396d
authored
4 years ago
by
Václav Bartoš
Browse files
Options
Downloads
Patches
Plain Diff
TheHiveButton: lists of observables are now collapsible
Collapsed automatically when there are more than 3 observables.
parent
0f4af460
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
thehive_button/package.json
+1
-3
1 addition, 3 deletions
thehive_button/package.json
thehive_button/public/vis_controller.js
+29
-23
29 additions, 23 deletions
thehive_button/public/vis_controller.js
with
30 additions
and
26 deletions
thehive_button/package.json
+
1
−
3
View file @
c6c1396d
...
@@ -12,9 +12,7 @@
...
@@ -12,9 +12,7 @@
"build"
:
"plugin-helpers build"
"build"
:
"plugin-helpers build"
},
},
"dependencies"
:
{
"dependencies"
:
{
"request"
:
"^2.88.0"
,
"request"
:
"^2.88.0"
"@elastic/eui"
:
"10.4.2"
,
"react"
:
"^16.8.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@elastic/eslint-config-kibana"
:
"link:../../packages/eslint-config-kibana"
,
"@elastic/eslint-config-kibana"
:
"link:../../packages/eslint-config-kibana"
,
...
...
This diff is collapsed.
Click to expand it.
thehive_button/public/vis_controller.js
+
29
−
23
View file @
c6c1396d
...
@@ -24,6 +24,7 @@ import {
...
@@ -24,6 +24,7 @@ import {
EuiSuperSelect
,
EuiSuperSelect
,
EuiBasicTable
,
EuiBasicTable
,
EuiCheckbox
,
EuiCheckbox
,
EuiAccordion
,
makeId
,
makeId
,
}
from
'
@elastic/eui
'
;
}
from
'
@elastic/eui
'
;
...
@@ -406,7 +407,7 @@ class ModalContent extends Component {
...
@@ -406,7 +407,7 @@ class ModalContent extends Component {
/>
/>
<
/EuiFormRow
>
<
/EuiFormRow
>
{
this
.
props
.
fields
.
length
>
0
&&
<
EuiTitle
size
=
"
s
"
><
h3
>
Add
observables
from
current
query
...
<
/h3></
EuiTitle
>
}
{
this
.
props
.
fields
.
length
>
0
&&
<>
<
EuiTitle
size
=
"
s
"
><
h3
>
Add
observables
from
current
query
...
<
/h3></
EuiTitle
>
<
EuiSpacer
size
=
"
m
"
/><
/>
}
{
this
.
props
.
fields
.
map
((
field
,
ix
)
=>
(
{
this
.
props
.
fields
.
map
((
field
,
ix
)
=>
(
<
ObservablesTable
<
ObservablesTable
key
=
{
field
.
name
+
"
:
"
+
this
.
props
.
resetCnt
}
key
=
{
field
.
name
+
"
:
"
+
this
.
props
.
resetCnt
}
...
@@ -508,28 +509,33 @@ class ObservablesTable extends Component {
...
@@ -508,28 +509,33 @@ class ObservablesTable extends Component {
return
(
return
(
<>
<>
<
EuiTitle
size
=
"
xs
"
><
h4
>
{
this
.
props
.
fieldName
}
<
/h4></
EuiTitle
>
<
EuiAccordion
<
EuiBasicTable
id
=
"
accordion-{this.props.fieldName}
"
ref
=
{
this
.
tableRef
}
buttonContent
=
{
<
EuiTitle
size
=
"
xs
"
><
h4
>
{
this
.
props
.
fieldName
}
({
n_obs
})
<
/h4></
EuiTitle
>
}
columns
=
{
this
.
columns
}
initialIsOpen
=
{
n_obs
<=
3
}
items
=
{
this
.
table_data
}
>
itemId
=
{(
item3
)
=>
item3
.
id
}
<
EuiBasicTable
selection
=
{
{
onSelectionChange
:
(
selectedItems
)
=>
this
.
props
.
onObsSelectionChange
(
this
.
props
.
fieldName
,
selectedItems
)
}
}
ref
=
{
this
.
tableRef
}
noItemsMessage
=
"
No observables found
"
columns
=
{
this
.
columns
}
rowProps
=
{{
items
=
{
this
.
table_data
}
// Hack to allow selection by clicking anywhere in the table row
itemId
=
{(
item3
)
=>
item3
.
id
}
// (except input elements)
selection
=
{
{
onSelectionChange
:
(
selectedItems
)
=>
this
.
props
.
onObsSelectionChange
(
this
.
props
.
fieldName
,
selectedItems
)
}
}
onClick
:
(
e
)
=>
{
noItemsMessage
=
"
No observables found
"
if
(
e
.
target
.
tagName
!=
"
INPUT
"
)
{
rowProps
=
{{
// simulate click on the first checkbox in the row to (de)select the row
// A hack to allow selection by clicking anywhere in the table row
e
.
currentTarget
.
querySelector
(
"
input
"
).
click
();
// (except input elements)
e
.
currentTarget
.
blur
();
// without this the focus remains on the row after click (results in different color)
onClick
:
(
e
)
=>
{
}
if
(
e
.
target
.
tagName
!=
"
INPUT
"
)
{
},
// simulate click on the first checkbox in the row to (de)select the row
tabIndex
:
"
-1
"
,
// prevents focus on row by keyboard navigation
e
.
currentTarget
.
querySelector
(
"
input
"
).
click
();
}}
e
.
currentTarget
.
blur
();
// without this the focus remains on the row after click (results in different color)
/
>
}
<
EuiSpacer
size
=
"
l
"
/>
},
tabIndex
:
"
-1
"
,
// prevents focus on row by keyboard navigation
}}
/
>
<
/EuiAccordion
>
<
EuiSpacer
size
=
"
m
"
/>
<
/
>
<
/
>
)
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment