Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions resources/web/docs_js/components/console_widget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ export const ConsoleForm = connect((state, props) =>
// ConsoleWidget isn't quite the right name for this any more....
export const ConsoleWidget = props => {
const modalAction = () => props.openModal(ConsoleForm, {setting: props.setting, url_label: props.url_label});

// Simple function to display a modal/tooltip
const showHelp = () => {
alert('1. To change the client language, use the dropdown.\n\n' +
'2. To copy the code in curl format:\n' +
' - Use gear icon (⚙) to set Elasticsearch URL + username.\n' +
' - Click "Copy as curl".\n\n' +
'3. To open the example in Kibana Console:\n'+
' - Use gear icon (⚙) to set Kibana Console URL.\n' +
' - Click "View in Console".')
};

return <div className="u-space-between">
<AlternativePicker langs={props.langs} />
<div className="u-space-between">
Expand All @@ -91,6 +103,11 @@ export const ConsoleWidget = props => {
title={props.langStrings(props.view_in_text)}
href={`${props[props.setting + "_url"]}?load_from=${props.baseUrl}${props.snippet}`}>{props.langStrings(props.view_in_text)}</a>
}

<a className="help_info" onClick={showHelp} style={{ textDecoration: 'none'}}>
ℹ️
</a>

<a className="console_settings" onClick={modalAction} title={props.langStrings(props.configure_text)}>&nbsp;</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/web/style/console_widget.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
background: #343741;
padding: 7px 15px 7px 0;
}
.view_in_link, .copy_as_curl {
.view_in_link, .copy_as_curl, .help_info {
color: #ffffff;
cursor: pointer;
font-weight: 500;
Expand Down