Skip to content
Snippets Groups Projects
Commit 6b743c77 authored by Václav Bartoš's avatar Václav Bartoš
Browse files

TheHiveButton: added missing dependencies, minor improvements

parent 7adb5478
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
"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",
......
...@@ -26,16 +26,17 @@ import { ...@@ -26,16 +26,17 @@ import {
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public'; import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
const optionsTemplate = ( function optionsEditor({ stateParams, setValue }) {
return (
<EuiForm> <EuiForm>
<EuiFormRow label="Base URL of The Hive"> <EuiFormRow label="Base URL of The Hive">
<EuiFieldText value={editorState.params.url} /> <EuiFieldText value={stateParams.url} />
</EuiFormRow> </EuiFormRow>
<EuiFormRow label="API key"> <EuiFormRow label="API key">
<EuiFieldText value={editorState.params.apikey} /> <EuiFieldText value={stateParams.apikey} />
</EuiFormRow> </EuiFormRow>
<EuiFormRow label="Username" helpText="Used as the owner of cases created from here"> <EuiFormRow label="Username" helpText="Used as the owner of cases created from here">
<EuiFieldText value={editorState.params.owner} /> <EuiFieldText value={stateParams.owner} />
</EuiFormRow> </EuiFormRow>
</EuiForm> </EuiForm>
); );
...@@ -62,8 +63,8 @@ function TheHiveButtonVisProvider(Private) { ...@@ -62,8 +63,8 @@ function TheHiveButtonVisProvider(Private) {
owner: THEHIVE_OWNER, owner: THEHIVE_OWNER,
} }
}, },
editor: 'default', // editor: optionsEditor,
// editor: MyEditorController, editor: 'default',
editorConfig: { editorConfig: {
optionsTemplate: optionsTemplate, optionsTemplate: optionsTemplate,
defaultSize: DefaultEditorSize.MEDIUM, defaultSize: DefaultEditorSize.MEDIUM,
...@@ -95,22 +96,25 @@ function TheHiveButtonVisProvider(Private) { ...@@ -95,22 +96,25 @@ function TheHiveButtonVisProvider(Private) {
schema: 'metric', schema: 'metric',
}, },
], ],
editor: '<div class="hintbox"><i class="fa fa-danger text-info"></i> Some metric must be defined here, but it\'s setting is irrelevant. Just go to "Buckets" below and set up the field to get Observbles from.</div>'
}, },
{ {
group: 'buckets', group: 'buckets',
name: 'group', name: 'group',
title: 'Observables', title: 'Observables',
min: 1, min: 0,
max: 1, //max: 1,
aggFilter: ['terms'], aggFilter: ['terms'],
// defaults: [ defaults: [
// { {
// type: 'terms', type: 'terms',
// //schema: 'group', schema: 'group',
// field: 'ip', field: 'ip',
// size: 100, size: 1000,
// } orderBy: 'alphabetical',
// ] order: 'ascending',
}
]
}, },
]), ]),
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment