forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also clean up and simplify scope destroying Fix sorting on scripted date and boolean fields (elastic#9261) The elasticsearch API only [supports][1][2] sort scripts of type `number` and `string`. Since dates need to be returned as millis since the epoch for visualizations to work anyway, we can simply add a condition to send dates as type number in the sort API. ES will cast booleans if we tell them its a string, so we can add a similar condition there as well. [1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-sort.html#_script_based_sorting [2]: https://github.com/elastic/elasticsearch/blob/aeb97ff41298e26b107a733837dfe17f123c0c9b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java#L359 Fixes: elastic#9257 Add docs on all available console server config options (elastic#9288) settings: do not query ES for settings in non-green status (elastic#9308) If the ui settings status is not green, that means there is at least one dependency (so elasticsearch at the moment) that is not met in order for it to function correctly, so we shouldn't attempt to determine user settings at all. This ensures that when something like the version check fails in the elasticsearch plugin, Kibana correctly behaves by not attempting requests to elasticsearch, which prevents 500 errors and allows users to see the error status on the status page. We also now periodically check for compatible elasticsearch versions so that Kibana can automatically recover if the elasticsearch node is upgraded to the appropriate version. Change loading screen background to white to make it less distracting when navigating between apps. (elastic#9313) more refactoring Fix sorting on scripted date and boolean fields (elastic#9261) The elasticsearch API only [supports][1][2] sort scripts of type `number` and `string`. Since dates need to be returned as millis since the epoch for visualizations to work anyway, we can simply add a condition to send dates as type number in the sort API. ES will cast booleans if we tell them its a string, so we can add a similar condition there as well. [1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-sort.html#_script_based_sorting [2]: https://github.com/elastic/elasticsearch/blob/aeb97ff41298e26b107a733837dfe17f123c0c9b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java#L359 Fixes: elastic#9257 Add docs on all available console server config options (elastic#9288) settings: do not query ES for settings in non-green status (elastic#9308) If the ui settings status is not green, that means there is at least one dependency (so elasticsearch at the moment) that is not met in order for it to function correctly, so we shouldn't attempt to determine user settings at all. This ensures that when something like the version check fails in the elasticsearch plugin, Kibana correctly behaves by not attempting requests to elasticsearch, which prevents 500 errors and allows users to see the error status on the status page. We also now periodically check for compatible elasticsearch versions so that Kibana can automatically recover if the elasticsearch node is upgraded to the appropriate version. Change loading screen background to white to make it less distracting when navigating between apps. (elastic#9313) Skip assertion when the test blips. (elastic#9251) Tests fails intermittently, and for identical reasons. When this occurs, skip the test. This only occurs in CI and cannot be reproduced locally. Additional changes: - Use async/await to improve legibility. - Move async behaviour to beforeEach and keep test stubs synchronous to improve labeling of tests. [git] ignore extra files in the root config/ directory (elastic#9296) upgrade makelogs (elastic#9295) build: remove deepModules hackery (elastic#9327) The deepModules hacks in the build system were added to support the long paths that resulted from npm2, but npm3 fundamentally addresses that problem, so deepModules is no longer necessary. In practical terms, npm3 shouldn't ever cause path lengths to become so long that they trigger path length problems on certain operating systems. more cleanup and tests Save/rename flow fix (elastic#9087) * Save/rename flow fix - Use auto generated ids instead of coupling the id to the title which creates problems. - Adjust UI to make the save flow more understandable. - Remove confirmation on overwrite since we will now be creating duplicate objects even if they have the same title. * use undefined instead of null * Change titleChanged function name * address code review comments * Add isSaving flag to avoid checkbox flicker, fix regression bug from refactor. Added tests and fixed a couple bugs Updated info message * Update doc and nav title with new name on rename don't hardcode Dashboard
- Loading branch information
1 parent
c54eb3f
commit e76f638
Showing
44 changed files
with
915 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[[configuring-console]] | ||
== Configuring Console | ||
|
||
You can add the following options in the `config/kibana.yml` file: | ||
|
||
`console.enabled`:: *Default: true* Set to false to disable Console. Toggling this will cause the server to regenerate assets on the next startup, which may cause a delay before pages start being served. | ||
|
||
`console.proxyFilter`:: *Default: `.*`* A list of regular expressions that are used to validate any outgoing request from Console. If none | ||
of these match, the request will be rejected. See <<securing-console>> for more details. | ||
|
||
`console.proxyConfig`:: A list of configuration options that are based on the proxy target. Use this to set custom timeouts or SSL settings for specific hosts. This is done by defining a set of `match` criteria using wildcards/globs which will be checked against each request. The configuration from all matching rules will then be merged together to configure the proxy used for that request. | ||
+ | ||
The valid match keys are `match.protocol`, `match.host`, `match.port`, and `match.path`. All of these keys default to `*`, which means they will match any value. | ||
+ | ||
Example: | ||
+ | ||
[source,yaml] | ||
-------- | ||
console.proxyConfig: | ||
- match: | ||
host: "*.internal.org" # allow any host that ends in .internal.org | ||
port: "{9200..9299}" # allow any port from 9200-9299 | ||
ssl: | ||
ca: "/opt/certs/internal.ca" | ||
# "key" and "cert" are also valid options here | ||
- match: | ||
protocol: "https" | ||
ssl: | ||
verify: false # allows any certificate to be used, even self-signed certs | ||
# since this rule has no "match" section it matches everything | ||
- timeout: 180000 # 3 minutes | ||
-------- | ||
|
||
[[securing-console]] | ||
=== Securing Console | ||
|
||
Console is meant to be used as a local development tool. As such, it will send requests to any host & port combination, | ||
just as a local curl command would. To overcome the CORS limitations enforced by browsers, Console's Node.js backend | ||
serves as a proxy to send requests on behalf of the browser. However, if put on a server and exposed to the internet | ||
this can become a security risk. In those cases, we highly recommend you lock down the proxy by setting the | ||
`console.proxyFilter` setting. The setting accepts a list of regular expressions that are evaluated against each URL | ||
the proxy is requested to retrieve. If none of the regular expressions match the proxy will reject the request. | ||
|
||
Here is an example configuration the only allows Console to connect to localhost: | ||
|
||
[source,yaml] | ||
-------- | ||
console.proxyFilter: | ||
- ^https?://(localhost|127\.0\.0\.1|\[::0\]).* | ||
-------- | ||
|
||
You will need to restart Kibana for these changes to take effect. | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/core_plugins/kibana/public/dashboard/components/panel/lib/panel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
export const DEFAULT_PANEL_WIDTH = 3; | ||
export const DEFAULT_PANEL_HEIGHT = 2; | ||
|
||
/** | ||
* Represents a panel on a grid. Keeps track of position in the grid and what visualization it | ||
* contains. | ||
* | ||
* @param id - Id of the visualization contained in the panel. | ||
* @param type - Type of the visualization in the panel. | ||
* @param panelId - Unique id to represent this panel in the grid. | ||
* @constructor | ||
*/ | ||
function Panel(id, type, panelId) { | ||
/** | ||
* A reference to the gridster widget holding this panel. Used to | ||
* update the size and column attributes. | ||
*/ | ||
this.$el; | ||
|
||
/** | ||
* Width of the panel. | ||
* @type {number} | ||
*/ | ||
this.size_x = DEFAULT_PANEL_WIDTH; | ||
|
||
/** | ||
* Height of the panel. | ||
* @type {number} | ||
*/ | ||
this.size_y = DEFAULT_PANEL_HEIGHT; | ||
|
||
/** | ||
* Column index in the grid. | ||
* @type {number} | ||
*/ | ||
this.col; | ||
|
||
/** | ||
* Row index of the panel in the grid. | ||
* @type {number} | ||
*/ | ||
this.row; | ||
|
||
/** | ||
* Height of the panel. | ||
* @type {number} | ||
*/ | ||
this.id = id; | ||
|
||
/** | ||
* Unique identifier for this panel. Guaranteed to be unique among the current | ||
* panels in the grid. | ||
* @type {number} | ||
*/ | ||
this.panelId = panelId; | ||
|
||
/** | ||
* Type of visualization this panel contains. | ||
* @type {string} | ||
*/ | ||
this.type = type; | ||
} | ||
|
||
/** | ||
* Factory function to create a panel object. | ||
* | ||
* @param id {string} - The id of the visualization this panel contains | ||
* @param type {string} - The type of visualization this panel contains | ||
* @param panelId {number} - A unique identifier for this panel in the grid | ||
* @returns {Panel} | ||
*/ | ||
export function createNewPanel(id, type, panelId) { | ||
return new Panel(id, type, panelId); | ||
} |
45 changes: 45 additions & 0 deletions
45
src/core_plugins/kibana/public/dashboard/components/panel/lib/panel_utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from 'plugins/kibana/dashboard/components/panel/lib/panel'; | ||
|
||
export class PanelUtils { | ||
/** | ||
* Fills in default parameters where not specified. | ||
* @param panel {Panel} | ||
*/ | ||
static initializeDefaults(panel) { | ||
panel.size_x = panel.size_x || DEFAULT_PANEL_WIDTH; | ||
panel.size_y = panel.size_y || DEFAULT_PANEL_HEIGHT; | ||
|
||
if (!panel.id) { | ||
// In the interest of backwards comparability | ||
if (panel.visId) { | ||
panel.id = panel.visId; | ||
panel.type = 'visualization'; | ||
delete panel.visId; | ||
} else { | ||
throw new Error('Missing object id on panel'); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Ensures that the panel object has the latest size/pos info. | ||
* @param panel {Panel} | ||
*/ | ||
static refreshSizeAndPosition(panel) { | ||
const data = panel.$el.coords().grid; | ||
panel.size_x = data.size_x; | ||
panel.size_y = data.size_y; | ||
panel.col = data.col; | ||
panel.row = data.row; | ||
} | ||
|
||
/** | ||
* $el is a circular structure because it contains a reference to it's parent panel, | ||
* so it needs to be removed before it can be serialized (we also don't | ||
* want it to show up in the url). | ||
* @param panel | ||
*/ | ||
static makeSerializeable(panel) { | ||
delete panel.$el; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.