Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Support v7.1.1 Compatibility (#13)
Browse files Browse the repository at this point in the history
* SQL Kibana plugin (#2)

* Add files via upload

* Removed Config file

* Added copyright and fixed build errors

* Create THIRD-PARTY

* Update THIRD-PARTY

* Removed sorting in nested tables

* Update THIRD-PARTY

* Update THIRD-PARTY

* Update package.json

* Update app.js

* Update README.md

* Changed package name

* Test

* Third version

* Delete app.css

* Renamed folders and added tests

* Delete yarn.lock

* Removed duplicated folders

* Delete main.tsx

* Added main file

* Dummy change

* Delete Header.tsx

* Adding Header

* Removed QueryResultsContainer and QueryResultsBodyContainer, moved functions and constants to utils folder

* Removed hacks file

* Refactoring

* Addressed comments on first PR

* Removed commented line, added missing types in utils

* Added column id for default sorting

* Added copyright in app.js

* Added unit tests

* Added unit tests

* Delete index.js

We are not using TestCafe anymore

* Update package.json

* Feature a (#3)

* Add files via upload

* Removed Config file

* Added copyright and fixed build errors

* Create THIRD-PARTY

* Update THIRD-PARTY

* Removed sorting in nested tables

* Update THIRD-PARTY

* Update THIRD-PARTY

* Update package.json

* Update app.js

* Update README.md

* Changed package name

* Test

* Third version

* Delete app.css

* Renamed folders and added tests

* Delete yarn.lock

* Removed duplicated folders

* Delete main.tsx

* Added main file

* Dummy change

* Delete Header.tsx

* Adding Header

* Removed QueryResultsContainer and QueryResultsBodyContainer, moved functions and constants to utils folder

* Removed hacks file

* Refactoring

* Addressed comments on first PR

* Removed commented line, added missing types in utils

* Added column id for default sorting

* Added copyright in app.js

* Added unit tests

* Added unit tests

* Delete index.js

We are not using TestCafe anymore

* Updated package.json

* Feature a (#4)

* Add files via upload

* Removed Config file

* Added copyright and fixed build errors

* Create THIRD-PARTY

* Update THIRD-PARTY

* Removed sorting in nested tables

* Update THIRD-PARTY

* Update THIRD-PARTY

* Update package.json

* Update app.js

* Update README.md

* Changed package name

* Test

* Third version

* Delete app.css

* Renamed folders and added tests

* Delete yarn.lock

* Removed duplicated folders

* Delete main.tsx

* Added main file

* Dummy change

* Delete Header.tsx

* Adding Header

* Removed QueryResultsContainer and QueryResultsBodyContainer, moved functions and constants to utils folder

* Removed hacks file

* Refactoring

* Addressed comments on first PR

* Removed commented line, added missing types in utils

* Added column id for default sorting

* Added copyright in app.js

* Added unit tests

* Added unit tests

* Delete index.js

We are not using TestCafe anymore

* Updated package.json

* Added kibana plugin helper

* Feature a (#5)

* Add files via upload

* Removed Config file

* Added copyright and fixed build errors

* Create THIRD-PARTY

* Update THIRD-PARTY

* Removed sorting in nested tables

* Update THIRD-PARTY

* Update THIRD-PARTY

* Update package.json

* Update app.js

* Update README.md

* Changed package name

* Test

* Third version

* Delete app.css

* Renamed folders and added tests

* Delete yarn.lock

* Removed duplicated folders

* Delete main.tsx

* Added main file

* Dummy change

* Delete Header.tsx

* Adding Header

* Removed QueryResultsContainer and QueryResultsBodyContainer, moved functions and constants to utils folder

* Removed hacks file

* Refactoring

* Addressed comments on first PR

* Removed commented line, added missing types in utils

* Added column id for default sorting

* Added copyright in app.js

* Added unit tests

* Added unit tests

* Delete index.js

We are not using TestCafe anymore

* Updated package.json

* Added kibana plugin helper

* Updated index.ts with latest service url

* Opendistro-1.3 compatible with ES and Kibana 7.3 (#8)

* updated kibana version (#9)

* Fixed the issue that response failed to be delivered in the console (#10)

* Fixed the issue that response failed to be delivered in the console

* Supported v7.1.1 compatibility
  • Loading branch information
chloe-zh authored Dec 5, 2019
1 parent 01847ab commit 3d3c140
Show file tree
Hide file tree
Showing 56 changed files with 31,842 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .kibana-plugin-helpers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"styleSheetToCompile": "public/app.scss",
"buildSourcePatterns": [
"package.json",
"tsconfig.json",
"yarn.lock",
".yarnrc",
"index.js",
"{lib,public,server,test}/**/*",
"!__tests__"
]
}
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
## Open Distro for Elasticsearch SQL Kibana Plugin
# Open Distro for Elasticsearch SQL Kibana

The Open Distro for Elasticsearch SQL Kibana plugin lets you query your Elasticsearch data using SQL syntax from a dedicated Kibana UI. You can then download data in JSON, JDBC, or CSV format.


## Documentation

Please see our [documentation](https://opendistro.github.io/for-elasticsearch-docs/).


## Setup

1. Download Elasticsearch for the version that matches the [Kibana version specified in package.json](./package.json#L8).
1. Download and install the appropriate [Open Distro for Elasticsearch Sql plugin](https://github.com/opendistro-for-elasticsearch/sql).
1. Download the Kibana source code for the [version specified in package.json](./package.json#L8) you want to set up.

See the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) for more instructions on setting up your development environment.

1. Change your node version to the version specified in `.node-version` inside the Kibana root directory.
1. Create a `kibana-extra` directory as a sibling directory to the Kibana source code directory.
1. Check out this package from version control into the `kibana-extra` directory.
1. Run `yarn kbn bootstrap` inside `kibana-extra/opendistro-elasticsearch-sql-kibana`.

Ultimately, your directory structure should look like this:

```md
.
├── kibana
├── kibana-extra
│ └── opendistro-elasticsearch-sql-kibana
```


## Build

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opendistro-kibana-sql-1.0.0.0.zip`


## Run

- `yarn start`

Starts Kibana and includes this plugin. Kibana will be available on `localhost:5601`.

- `NODE_PATH=../../kibana/node_modules yarn test:jest`

Runs the plugin tests.


## Contributing to Open Distro for Elasticsearch SQL Kibana

- Refer to [CONTRIBUTING.md](./CONTRIBUTING.md).
- Since this is a Kibana plugin, it can be useful to review the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) alongside the documentation around [Kibana plugins](https://www.elastic.co/guide/en/kibana/master/kibana-plugins.html) and [plugin development](https://www.elastic.co/guide/en/kibana/master/plugin-development.html).



## License

This library is licensed under the Apache 2.0 License.
This code is licensed under the Apache 2.0 License.

## Copyright

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
397 changes: 397 additions & 0 deletions THIRD-PARTY

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// babelrc doesn't respect NODE_PATH anymore but using require does.
// Alternative to install them locally in node_modules
module.exports = {
presets: [require("@babel/preset-env"), require("@babel/preset-react"), require("@babel/preset-typescript")],
plugins: [require("@babel/plugin-proposal-class-properties"), require("@babel/plugin-proposal-object-rest-spread")],
};

54 changes: 54 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

import query from './server/routes/query';
import translate from './server/routes/translate';
import QueryService from './server/services/QueryService';
import TranslateService from './server/services/TranslateService';
import { createSqlCluster } from './server/clusters';

export const PLUGIN_NAME = 'opendistro-sql-kibana';

export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
name: PLUGIN_NAME,
uiExports: {
app: {
title: 'SQL Console',
description: 'SQL Console',
main: 'plugins/' + PLUGIN_NAME + '/app',
icon:'plugins/' + PLUGIN_NAME + '/icons/sql.svg',
},
styleSheetPaths: require('path').resolve(__dirname, 'public/app.scss'),
},

config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default();
},

init(server, options) { // eslint-disable-line no-unused-vars
// Create Clusters
createSqlCluster(server);
const client = server.plugins.elasticsearch;

// Add server routes and initialize the plugin here
query(server, new QueryService(client));
translate(server, new TranslateService(client));
}
});
}
Loading

0 comments on commit 3d3c140

Please sign in to comment.