Web console: allow link overrides for docs, and more (#10100)

* link overrides

* change doc version

* fix snapshots
This commit is contained in:
Vadim Ogievetsky 2020-06-30 12:46:50 -07:00 committed by GitHub
parent fc555980e8
commit c01fd56182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 197 additions and 196 deletions

View File

@ -40,7 +40,7 @@ exports.SQL_KEYWORDS = [
'ON', 'ON',
'RIGHT', 'RIGHT',
'OUTER', 'OUTER',
'FULL' 'FULL',
]; ];
exports.SQL_EXPRESSION_PARTS = [ exports.SQL_EXPRESSION_PARTS = [

View File

@ -159,7 +159,7 @@ exports[`header bar matches snapshot 1`] = `
/> />
<Blueprint3.MenuItem <Blueprint3.MenuItem
disabled={false} disabled={false}
href="https://druid.apache.org/docs/0.17.0" href="https://druid.apache.org/docs/0.19.0"
icon="th" icon="th"
multiline={false} multiline={false}
popoverProps={Object {}} popoverProps={Object {}}

View File

@ -32,20 +32,14 @@ import {
import { IconNames } from '@blueprintjs/icons'; import { IconNames } from '@blueprintjs/icons';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { AboutDialog } from '../../dialogs/about-dialog/about-dialog';
import { CoordinatorDynamicConfigDialog } from '../../dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog';
import { DoctorDialog } from '../../dialogs/doctor-dialog/doctor-dialog';
import { OverlordDynamicConfigDialog } from '../../dialogs/overlord-dynamic-config-dialog/overlord-dynamic-config-dialog';
import { Capabilities } from '../../utils/capabilities';
import { import {
DRUID_ASF_SLACK, AboutDialog,
DRUID_DOCS, CoordinatorDynamicConfigDialog,
DRUID_DOCS_API, DoctorDialog,
DRUID_DOCS_SQL, OverlordDynamicConfigDialog,
DRUID_DOCS_VERSION, } from '../../dialogs';
DRUID_GITHUB, import { getLink } from '../../links';
DRUID_USER_GROUP, import { Capabilities } from '../../utils/capabilities';
} from '../../variables';
import { ExternalLink } from '../external-link/external-link'; import { ExternalLink } from '../external-link/external-link';
import { PopoverText } from '../popover-text/popover-text'; import { PopoverText } from '../popover-text/popover-text';
@ -137,9 +131,10 @@ const RestrictedMode = React.memo(function RestrictedMode(props: RestrictedModeP
message = ( message = (
<p> <p>
It appears that the SQL endpoint is disabled. The console will fall back to{' '} It appears that the SQL endpoint is disabled. The console will fall back to{' '}
<ExternalLink href={DRUID_DOCS_API}>native Druid APIs</ExternalLink> and will be limited <ExternalLink href={getLink('DOCS_API')}>native Druid APIs</ExternalLink> and will be
in functionality. Look at <ExternalLink href={DRUID_DOCS_SQL}>the SQL docs</ExternalLink>{' '} limited in functionality. Look at{' '}
to enable the SQL endpoint. <ExternalLink href={getLink('DOCS_SQL')}>the SQL docs</ExternalLink> to enable the SQL
endpoint.
</p> </p>
); );
break; break;
@ -205,9 +200,7 @@ const RestrictedMode = React.memo(function RestrictedMode(props: RestrictedModeP
{message} {message}
<p> <p>
For more info check out the{' '} For more info check out the{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/operations/management-uis.html#druid-console`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/operations/management-uis.html#druid-console`}
>
console documentation console documentation
</ExternalLink> </ExternalLink>
. .
@ -239,15 +232,25 @@ export const HeaderBar = React.memo(function HeaderBar(props: HeaderBarProps) {
const helpMenu = ( const helpMenu = (
<Menu> <Menu>
<MenuItem icon={IconNames.GRAPH} text="About" onClick={() => setAboutDialogOpen(true)} /> <MenuItem icon={IconNames.GRAPH} text="About" onClick={() => setAboutDialogOpen(true)} />
<MenuItem icon={IconNames.TH} text="Docs" href={DRUID_DOCS} target="_blank" /> <MenuItem icon={IconNames.TH} text="Docs" href={getLink('DOCS')} target="_blank" />
<MenuItem icon={IconNames.USER} text="User group" href={DRUID_USER_GROUP} target="_blank" /> <MenuItem
icon={IconNames.USER}
text="User group"
href={getLink('USER_GROUP')}
target="_blank"
/>
<MenuItem <MenuItem
icon={IconNames.CHAT} icon={IconNames.CHAT}
text="ASF Slack channel" text="ASF Slack channel"
href={DRUID_ASF_SLACK} href={getLink('SLACK')}
target="_blank"
/>
<MenuItem
icon={IconNames.GIT_BRANCH}
text="GitHub"
href={getLink('GITHUB')}
target="_blank" target="_blank"
/> />
<MenuItem icon={IconNames.GIT_BRANCH} text="GitHub" href={DRUID_GITHUB} target="_blank" />
</Menu> </Menu>
); );

View File

@ -21,12 +21,7 @@ import { IconNames } from '@blueprintjs/icons';
import React from 'react'; import React from 'react';
import { ExternalLink } from '../../components'; import { ExternalLink } from '../../components';
import { import { getLink } from '../../links';
DRUID_COMMUNITY,
DRUID_DEVELOPER_GROUP,
DRUID_USER_GROUP,
DRUID_WEBSITE,
} from '../../variables';
export interface AboutDialogProps { export interface AboutDialogProps {
onClose: () => void; onClose: () => void;
@ -50,19 +45,19 @@ export const AboutDialog = React.memo(function AboutDialog(props: AboutDialogPro
</p> </p>
<p> <p>
For help and support with Druid, please refer to the{' '} For help and support with Druid, please refer to the{' '}
<ExternalLink href={DRUID_COMMUNITY}>community page</ExternalLink> and the{' '} <ExternalLink href={getLink('COMMUNITY')}>community page</ExternalLink> and the{' '}
<ExternalLink href={DRUID_USER_GROUP}>user groups</ExternalLink>. <ExternalLink href={getLink('USER_GROUP')}>user groups</ExternalLink>.
</p> </p>
<p> <p>
Druid is made with by a community of passionate developers. To contribute, join in the Druid is made with by a community of passionate developers. To contribute, join in the
discussion on the{' '} discussion on the{' '}
<ExternalLink href={DRUID_DEVELOPER_GROUP}>developer group</ExternalLink>. <ExternalLink href={getLink('DEVELOPER_GROUP')}>developer group</ExternalLink>.
</p> </p>
</div> </div>
<div className={Classes.DIALOG_FOOTER}> <div className={Classes.DIALOG_FOOTER}>
<div className={Classes.DIALOG_FOOTER_ACTIONS}> <div className={Classes.DIALOG_FOOTER_ACTIONS}>
<Button onClick={onClose}>Close</Button> <Button onClick={onClose}>Close</Button>
<AnchorButton intent={Intent.PRIMARY} href={DRUID_WEBSITE} target="_blank"> <AnchorButton intent={Intent.PRIMARY} href={getLink('WEBSITE')} target="_blank">
Visit Druid Visit Druid
</AnchorButton> </AnchorButton>
</div> </div>

View File

@ -20,7 +20,7 @@ import { Button, Classes, Dialog, Intent } from '@blueprintjs/core';
import React from 'react'; import React from 'react';
import { AutoForm, ExternalLink } from '../../components'; import { AutoForm, ExternalLink } from '../../components';
import { DRUID_DOCS_VERSION } from '../../variables'; import { getLink } from '../../links';
import './compaction-dialog.scss'; import './compaction-dialog.scss';
@ -116,9 +116,7 @@ export class CompactionDialog extends React.PureComponent<
type: 'json', type: 'json',
info: ( info: (
<p> <p>
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/tasks.html#task-context`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/tasks.html#task-context`}
>
Task context Task context
</ExternalLink>{' '} </ExternalLink>{' '}
for compaction tasks. for compaction tasks.
@ -137,7 +135,7 @@ export class CompactionDialog extends React.PureComponent<
info: ( info: (
<p> <p>
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/configuration/index.html#compact-task-tuningconfig`} href={`${getLink('DOCS')}/configuration/index.html#compact-task-tuningconfig`}
> >
Tuning config Tuning config
</ExternalLink>{' '} </ExternalLink>{' '}

View File

@ -58,7 +58,7 @@ exports[`coordinator dynamic config matches snapshot 1`] = `
Edit the coordinator dynamic configuration on the fly. For more information please refer to the Edit the coordinator dynamic configuration on the fly. For more information please refer to the
<a <a
href="https://druid.apache.org/docs/0.17.0/configuration/index.html#dynamic-configuration" href="https://druid.apache.org/docs/0.19.0/configuration/index.html#dynamic-configuration"
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >

View File

@ -21,11 +21,11 @@ import { IconNames } from '@blueprintjs/icons';
import axios from 'axios'; import axios from 'axios';
import React from 'react'; import React from 'react';
import { SnitchDialog } from '..';
import { AutoForm, ExternalLink } from '../../components'; import { AutoForm, ExternalLink } from '../../components';
import { getLink } from '../../links';
import { AppToaster } from '../../singletons/toaster'; import { AppToaster } from '../../singletons/toaster';
import { getDruidErrorMessage, QueryManager } from '../../utils'; import { getDruidErrorMessage, QueryManager } from '../../utils';
import { DRUID_DOCS_VERSION } from '../../variables';
import { SnitchDialog } from '../snitch-dialog/snitch-dialog';
import './coordinator-dynamic-config-dialog.scss'; import './coordinator-dynamic-config-dialog.scss';
@ -127,9 +127,7 @@ export class CoordinatorDynamicConfigDialog extends React.PureComponent<
<p> <p>
Edit the coordinator dynamic configuration on the fly. For more information please refer Edit the coordinator dynamic configuration on the fly. For more information please refer
to the{' '} to the{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/configuration/index.html#dynamic-configuration`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/configuration/index.html#dynamic-configuration`}
>
documentation documentation
</ExternalLink> </ExternalLink>
. .

View File

@ -17,6 +17,7 @@
*/ */
export * from './about-dialog/about-dialog'; export * from './about-dialog/about-dialog';
export * from './doctor-dialog/doctor-dialog';
export * from './async-action-dialog/async-action-dialog'; export * from './async-action-dialog/async-action-dialog';
export * from './compaction-dialog/compaction-dialog'; export * from './compaction-dialog/compaction-dialog';
export * from './coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog'; export * from './coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog';

View File

@ -58,7 +58,7 @@ exports[`overload dynamic config matches snapshot 1`] = `
Edit the overlord dynamic configuration on the fly. For more information please refer to the Edit the overlord dynamic configuration on the fly. For more information please refer to the
<a <a
href="https://druid.apache.org/docs/0.17.0/configuration/index.html#overlord-dynamic-configuration" href="https://druid.apache.org/docs/0.19.0/configuration/index.html#overlord-dynamic-configuration"
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >

View File

@ -21,11 +21,11 @@ import { IconNames } from '@blueprintjs/icons';
import axios from 'axios'; import axios from 'axios';
import React from 'react'; import React from 'react';
import { SnitchDialog } from '..';
import { AutoForm, ExternalLink } from '../../components'; import { AutoForm, ExternalLink } from '../../components';
import { getLink } from '../../links';
import { AppToaster } from '../../singletons/toaster'; import { AppToaster } from '../../singletons/toaster';
import { getDruidErrorMessage, QueryManager } from '../../utils'; import { getDruidErrorMessage, QueryManager } from '../../utils';
import { DRUID_DOCS_VERSION } from '../../variables';
import { SnitchDialog } from '../snitch-dialog/snitch-dialog';
import './overlord-dynamic-config-dialog.scss'; import './overlord-dynamic-config-dialog.scss';
@ -128,7 +128,7 @@ export class OverlordDynamicConfigDialog extends React.PureComponent<
Edit the overlord dynamic configuration on the fly. For more information please refer to Edit the overlord dynamic configuration on the fly. For more information please refer to
the{' '} the{' '}
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/configuration/index.html#overlord-dynamic-configuration`} href={`${getLink('DOCS')}/configuration/index.html#overlord-dynamic-configuration`}
> >
documentation documentation
</ExternalLink> </ExternalLink>

View File

@ -58,7 +58,7 @@ exports[`retention dialog matches snapshot 1`] = `
Druid uses rules to determine what data should be retained in the cluster. The rules are evaluated in order from top to bottom. For more information please refer to the Druid uses rules to determine what data should be retained in the cluster. The rules are evaluated in order from top to bottom. For more information please refer to the
<a <a
href="https://druid.apache.org/docs/0.17.0/operations/rule-configuration.html" href="https://druid.apache.org/docs/0.19.0/operations/rule-configuration.html"
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >

View File

@ -21,10 +21,10 @@ import { IconNames } from '@blueprintjs/icons';
import axios from 'axios'; import axios from 'axios';
import React from 'react'; import React from 'react';
import { SnitchDialog } from '..';
import { ExternalLink, RuleEditor } from '../../components'; import { ExternalLink, RuleEditor } from '../../components';
import { getLink } from '../../links';
import { QueryManager } from '../../utils'; import { QueryManager } from '../../utils';
import { DRUID_DOCS_VERSION } from '../../variables';
import { SnitchDialog } from '../snitch-dialog/snitch-dialog';
import './retention-dialog.scss'; import './retention-dialog.scss';
@ -183,9 +183,7 @@ export class RetentionDialog extends React.PureComponent<
<p> <p>
Druid uses rules to determine what data should be retained in the cluster. The rules are Druid uses rules to determine what data should be retained in the cluster. The rules are
evaluated in order from top to bottom. For more information please refer to the{' '} evaluated in order from top to bottom. For more information please refer to the{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/operations/rule-configuration.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/operations/rule-configuration.html`}
>
documentation documentation
</ExternalLink> </ExternalLink>
. .

View File

@ -29,6 +29,7 @@ import './ace-modes/dsql';
import './ace-modes/hjson'; import './ace-modes/hjson';
import './bootstrap/react-table-defaults'; import './bootstrap/react-table-defaults';
import { ConsoleApplication } from './console-application'; import { ConsoleApplication } from './console-application';
import { Links, setLinkOverrides } from './links';
import { UrlBaser } from './singletons/url-baser'; import { UrlBaser } from './singletons/url-baser';
import './entry.scss'; import './entry.scss';
@ -58,6 +59,9 @@ interface ConsoleConfig {
// Extra context properties that will be added to all query requests // Extra context properties that will be added to all query requests
mandatoryQueryContext?: Record<string, any>; mandatoryQueryContext?: Record<string, any>;
// Allow for link overriding to different docs
linkOverrides?: Links;
} }
const consoleConfig: ConsoleConfig = (window as any).consoleConfig; const consoleConfig: ConsoleConfig = (window as any).consoleConfig;
@ -75,6 +79,9 @@ if (consoleConfig.customHeaderName && consoleConfig.customHeaderValue) {
if (consoleConfig.customHeaders) { if (consoleConfig.customHeaders) {
Object.assign(axios.defaults.headers, consoleConfig.customHeaders); Object.assign(axios.defaults.headers, consoleConfig.customHeaders);
} }
if (consoleConfig.linkOverrides) {
setLinkOverrides(consoleConfig.linkOverrides);
}
ReactDOM.render( ReactDOM.render(
React.createElement(ConsoleApplication, { React.createElement(ConsoleApplication, {

94
web-console/src/links.ts Normal file
View File

@ -0,0 +1,94 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
// This is set to the latest available version and should be updated to the next version before release
import hasOwnProp from 'has-own-prop';
const DRUID_DOCS_VERSION = '0.19.0';
function fillVersion(str: string): string {
return str.replace(/\{\{VERSION}}/g, DRUID_DOCS_VERSION);
}
export interface Links {
websiteHref: string;
githubHref: string;
docsHref: string;
communityHref: string;
slackHref: string;
userGroup: string;
developerGroup: string;
}
const DEFAULT_LINKS: Links = {
websiteHref: 'https://druid.apache.org',
githubHref: 'https://github.com/apache/druid',
docsHref: fillVersion('https://druid.apache.org/docs/{{VERSION}}'),
communityHref: 'https://druid.apache.org/community/',
slackHref: 'https://druid.apache.org/community/join-slack',
userGroup: 'https://groups.google.com/forum/#!forum/druid-user',
developerGroup: 'https://lists.apache.org/list.html?dev@druid.apache.org',
};
const links = DEFAULT_LINKS;
export function setLinkOverrides(linkOverrides: Links) {
const keys = Object.keys(DEFAULT_LINKS) as (keyof Links)[];
for (const k of keys) {
if (hasOwnProp(linkOverrides, k)) {
links[k] = fillVersion(String(linkOverrides[k]));
}
}
}
export type LinkNames =
| 'WEBSITE'
| 'GITHUB'
| 'DOCS'
| 'DOCS_SQL'
| 'DOCS_RUNE'
| 'DOCS_API'
| 'COMMUNITY'
| 'SLACK'
| 'USER_GROUP'
| 'DEVELOPER_GROUP';
export function getLink(linkName: LinkNames): string {
switch (linkName) {
case 'WEBSITE':
return links.websiteHref;
case 'GITHUB':
return links.githubHref;
case 'DOCS':
return links.docsHref;
case 'DOCS_SQL':
return `${links.docsHref}/querying/sql.html`;
case 'DOCS_RUNE':
return `${links.docsHref}/querying/querying.html`;
case 'DOCS_API':
return `${links.docsHref}/operations/api-reference.html`;
case 'COMMUNITY':
return links.communityHref;
case 'SLACK':
return links.slackHref;
case 'USER_GROUP':
return links.userGroup;
case 'DEVELOPER_GROUP':
return links.developerGroup;
}
}

View File

@ -21,7 +21,7 @@ import React from 'react';
import { Field } from '../components/auto-form/auto-form'; import { Field } from '../components/auto-form/auto-form';
import { ExternalLink } from '../components/external-link/external-link'; import { ExternalLink } from '../components/external-link/external-link';
import { DRUID_DOCS_VERSION } from '../variables'; import { getLink } from '../links';
import { import {
BASIC_TIME_FORMATS, BASIC_TIME_FORMATS,
@ -175,13 +175,13 @@ export function getIngestionDocLink(spec: IngestionSpec): string {
switch (type) { switch (type) {
case 'kafka': case 'kafka':
return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kafka-ingestion.html`; return `${getLink('DOCS')}/development/extensions-core/kafka-ingestion.html`;
case 'kinesis': case 'kinesis':
return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kinesis-ingestion.html`; return `${getLink('DOCS')}/development/extensions-core/kinesis-ingestion.html`;
default: default:
return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/native-batch.html#firehoses`; return `${getLink('DOCS')}/ingestion/native-batch.html#firehoses`;
} }
} }
@ -317,9 +317,7 @@ const INPUT_FORMAT_FORM_FIELDS: Field<InputFormat>[] = [
<p>The parser used to parse the data.</p> <p>The parser used to parse the data.</p>
<p> <p>
For more information see{' '} For more information see{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/data-formats.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/data-formats.html`}
>
the documentation the documentation
</ExternalLink> </ExternalLink>
. .
@ -609,12 +607,7 @@ const FLATTEN_FIELD_FORM_FIELDS: Field<FlattenField>[] = [
info: ( info: (
<> <>
Specify a flatten{' '} Specify a flatten{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/flatten-json`}>expression</ExternalLink>.
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/flatten-json`}
>
expression
</ExternalLink>
.
</> </>
), ),
}, },
@ -656,12 +649,7 @@ const TRANSFORM_FORM_FIELDS: Field<Transform>[] = [
info: ( info: (
<> <>
A valid Druid{' '} A valid Druid{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/misc/math-expr.html`}>expression</ExternalLink>.
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/misc/math-expr.html`}
>
expression
</ExternalLink>
.
</> </>
), ),
}, },
@ -931,7 +919,9 @@ const METRIC_SPEC_FORM_FIELDS: Field<MetricSpec>[] = [
<p> <p>
Supported modes are <Code>ignore</Code>, <Code>overflow</Code>, and <Code>clip</Code>. See Supported modes are <Code>ignore</Code>, <Code>overflow</Code>, and <Code>clip</Code>. See
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/approximate-histograms.html#outlier-handling-modes`} href={`${getLink(
'DOCS',
)}/development/extensions-core/approximate-histograms.html#outlier-handling-modes`}
> >
outlier handling modes outlier handling modes
</ExternalLink>{' '} </ExternalLink>{' '}
@ -1024,9 +1014,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: ( info: (
<p> <p>
Druid connects to raw data through{' '} Druid connects to raw data through{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/firehose.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/firehose.html`}
>
inputSources inputSources
</ExternalLink> </ExternalLink>
. You can change your selected inputSource here. . You can change your selected inputSource here.
@ -1079,9 +1067,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
required: true, required: true,
info: ( info: (
<> <>
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/firehose.html#localfirehose`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/firehose.html#localfirehose`}
>
inputSource.baseDir inputSource.baseDir
</ExternalLink> </ExternalLink>
<p>Specifies the directory to search recursively for files to be ingested.</p> <p>Specifies the directory to search recursively for files to be ingested.</p>
@ -1105,9 +1091,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
], ],
info: ( info: (
<> <>
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/firehose.html#localfirehose`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/firehose.html#localfirehose`}
>
inputSource.filter inputSource.filter
</ExternalLink> </ExternalLink>
<p> <p>
@ -1177,11 +1161,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: ( info: (
<p> <p>
The{' '} The{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/querying/filters.html`}>filter</ExternalLink>{' '}
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/filters.html`}
>
filter
</ExternalLink>{' '}
to apply to the data as part of querying. to apply to the data as part of querying.
</p> </p>
), ),
@ -1241,9 +1221,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<> <>
<p> <p>
JSON array of{' '} JSON array of{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/development/extensions-core/s3.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/s3.html`}
>
S3 Objects S3 Objects
</ExternalLink> </ExternalLink>
. .
@ -1405,9 +1383,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<> <>
<p> <p>
JSON array of{' '} JSON array of{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/development/extensions-core/azure.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/azure.html`}
>
S3 Objects S3 Objects
</ExternalLink> </ExternalLink>
. .
@ -1465,9 +1441,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<> <>
<p> <p>
JSON array of{' '} JSON array of{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/development/extensions-core/google.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/google.html`}
>
Google Cloud Storage Objects Google Cloud Storage Objects
</ExternalLink> </ExternalLink>
. .
@ -1500,7 +1474,9 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: ( info: (
<> <>
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kafka-ingestion#kafkasupervisorioconfig`} href={`${getLink(
'DOCS',
)}/development/extensions-core/kafka-ingestion#kafkasupervisorioconfig`}
> >
consumerProperties consumerProperties
</ExternalLink> </ExternalLink>
@ -1524,7 +1500,9 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: ( info: (
<> <>
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kafka-ingestion#kafkasupervisorioconfig`} href={`${getLink(
'DOCS',
)}/development/extensions-core/kafka-ingestion#kafkasupervisorioconfig`}
> >
consumerProperties consumerProperties
</ExternalLink> </ExternalLink>
@ -1575,9 +1553,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: ( info: (
<> <>
The Amazon Kinesis stream endpoint for a region. You can find a list of endpoints{' '} The Amazon Kinesis stream endpoint for a region. You can find a list of endpoints{' '}
<ExternalLink <ExternalLink href={`https://docs.aws.amazon.com/general/latest/gr/ak.html`}>
href={`http://docs.aws.amazon.com/general/${DRUID_DOCS_VERSION}/gr/rande.html#ak_region`}
>
here here
</ExternalLink> </ExternalLink>
. .

View File

@ -1,31 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
// This is set to the latest available version and should be updated to the next version before release
export const DRUID_DOCS_VERSION = '0.17.0';
export const DRUID_WEBSITE = 'https://druid.apache.org';
export const DRUID_GITHUB = 'https://github.com/apache/druid';
export const DRUID_DOCS = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}`;
export const DRUID_DOCS_SQL = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/sql.html`;
export const DRUID_DOCS_RUNE = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/querying.html`;
export const DRUID_COMMUNITY = 'https://druid.apache.org/community/';
export const DRUID_USER_GROUP = 'https://groups.google.com/forum/#!forum/druid-user';
export const DRUID_ASF_SLACK = 'https://druid.apache.org/community/join-slack';
export const DRUID_DEVELOPER_GROUP = 'https://lists.apache.org/list.html?dev@druid.apache.org';
export const DRUID_DOCS_API = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/operations/api-reference.html`;

View File

@ -54,6 +54,7 @@ import {
} from '../../components'; } from '../../components';
import { FormGroupWithInfo } from '../../components/form-group-with-info/form-group-with-info'; import { FormGroupWithInfo } from '../../components/form-group-with-info/form-group-with-info';
import { AsyncActionDialog } from '../../dialogs'; import { AsyncActionDialog } from '../../dialogs';
import { getLink } from '../../links';
import { AppToaster } from '../../singletons/toaster'; import { AppToaster } from '../../singletons/toaster';
import { UrlBaser } from '../../singletons/url-baser'; import { UrlBaser } from '../../singletons/url-baser';
import { import {
@ -146,7 +147,6 @@ import {
SampleStrategy, SampleStrategy,
} from '../../utils/sampler'; } from '../../utils/sampler';
import { computeFlattenPathsForData } from '../../utils/spec-utils'; import { computeFlattenPathsForData } from '../../utils/spec-utils';
import { DRUID_DOCS_VERSION } from '../../variables';
import { ExamplePicker } from './example-picker/example-picker'; import { ExamplePicker } from './example-picker/example-picker';
import { FilterTable, filterTableSelectedColumnName } from './filter-table/filter-table'; import { FilterTable, filterTableSelectedColumnName } from './filter-table/filter-table';
@ -811,9 +811,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
return ( return (
<p> <p>
If you do not see your source of raw data here, you can try to ingest it by submitting a{' '} If you do not see your source of raw data here, you can try to ingest it by submitting a{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/index.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html`}
>
JSON task or supervisor spec JSON task or supervisor spec
</ExternalLink> </ExternalLink>
. .
@ -916,9 +914,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
</p> </p>
<p> <p>
For more information please refer to the{' '} For more information please refer to the{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/operations/including-extensions`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/operations/including-extensions`}
>
documentation on loading extensions documentation on loading extensions
</ExternalLink> </ExternalLink>
. .
@ -1060,9 +1056,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<Callout className="intro"> <Callout className="intro">
<p> <p>
Druid ingests raw data and converts it into a custom,{' '} Druid ingests raw data and converts it into a custom,{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/design/segments.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/design/segments.html`}
>
indexed format indexed format
</ExternalLink>{' '} </ExternalLink>{' '}
that is optimized for analytic queries. that is optimized for analytic queries.
@ -1311,9 +1305,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
{canFlatten && ( {canFlatten && (
<p> <p>
If you have nested data, you can{' '} If you have nested data, you can{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/index.html#flattenspec`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#flattenspec`}
>
flatten flatten
</ExternalLink>{' '} </ExternalLink>{' '}
it here. If the provided flattening capabilities are not sufficient, please it here. If the provided flattening capabilities are not sufficient, please
@ -1321,9 +1313,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
</p> </p>
)} )}
<p>Ensure that your data appears correctly in a row/column orientation.</p> <p>Ensure that your data appears correctly in a row/column orientation.</p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/data-formats.html`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/data-formats.html`}
/>
</Callout> </Callout>
{!selectedFlattenField && ( {!selectedFlattenField && (
<> <>
@ -1462,7 +1452,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
/> />
<AnchorButton <AnchorButton
icon={IconNames.INFO_SIGN} icon={IconNames.INFO_SIGN}
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/flatten-json.html`} href={`${getLink('DOCS')}/ingestion/flatten-json.html`}
target="_blank" target="_blank"
minimal minimal
/> />
@ -1574,9 +1564,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
column. If you do not have any time columns, you can choose "Constant value" to create column. If you do not have any time columns, you can choose "Constant value" to create
a default one. a default one.
</p> </p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/index.html#timestampspec`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#timestampspec`}
/>
</Callout> </Callout>
<FormGroup label="Timestamp spec"> <FormGroup label="Timestamp spec">
<ButtonGroup> <ButtonGroup>
@ -1724,16 +1712,12 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<p className="optional">Optional</p> <p className="optional">Optional</p>
<p> <p>
Druid can perform per-row{' '} Druid can perform per-row{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/ingestion/transform-spec.html#transforms`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/transform-spec.html#transforms`}
>
transforms transforms
</ExternalLink>{' '} </ExternalLink>{' '}
of column values allowing you to create new derived columns or alter existing column. of column values allowing you to create new derived columns or alter existing column.
</p> </p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/index.html#transforms`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#transforms`}
/>
</Callout> </Callout>
{Boolean(transformQueryState.error && transforms.length) && ( {Boolean(transformQueryState.error && transforms.length) && (
<FormGroup> <FormGroup>
@ -1964,16 +1948,10 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<p className="optional">Optional</p> <p className="optional">Optional</p>
<p> <p>
Druid can{' '} Druid can{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/querying/filters.html`}>filter</ExternalLink>{' '}
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/filters.html`}
>
filter
</ExternalLink>{' '}
out unwanted data by applying per-row filters. out unwanted data by applying per-row filters.
</p> </p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/index.html#filter`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#filter`}
/>
</Callout> </Callout>
{!showGlobalFilter && this.renderColumnFilterControls()} {!showGlobalFilter && this.renderColumnFilterControls()}
{!selectedFilter && this.renderGlobalFilterControls()} {!selectedFilter && this.renderGlobalFilterControls()}
@ -2239,9 +2217,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
want to change the type, click on the column header. want to change the type, click on the column header.
</p> </p>
)} )}
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/schema-design.html`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/schema-design.html`}
/>
</Callout> </Callout>
{!somethingSelected && ( {!somethingSelected && (
<> <>
@ -2252,14 +2228,12 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<p> <p>
Select whether or not you want to set an explicit list of{' '} Select whether or not you want to set an explicit list of{' '}
<ExternalLink <ExternalLink
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/ingestion-spec.html#dimensionsspec`} href={`${getLink('DOCS')}/ingestion/ingestion-spec.html#dimensionsspec`}
> >
dimensions dimensions
</ExternalLink>{' '} </ExternalLink>{' '}
and{' '} and{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/querying/aggregations.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/aggregations.html`}
>
metrics metrics
</ExternalLink> </ExternalLink>
. Explicitly setting dimensions and metrics can lead to better compression and . Explicitly setting dimensions and metrics can lead to better compression and
@ -2304,9 +2278,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<PopoverText> <PopoverText>
<p> <p>
If you enable{' '} If you enable{' '}
<ExternalLink <ExternalLink href={`${getLink('DOCS')}/tutorials/tutorial-rollup.html`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/tutorials/tutorial-rollup.html`}
>
roll-up roll-up
</ExternalLink> </ExternalLink>
, Druid will try to pre-aggregate data before indexing it to conserve storage. , Druid will try to pre-aggregate data before indexing it to conserve storage.
@ -2315,18 +2287,12 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
</p> </p>
<p> <p>
If you enable rollup, you must specify which columns are{' '} If you enable rollup, you must specify which columns are{' '}
<a <a href={`${getLink('DOCS')}/ingestion/ingestion-spec.html#dimensionsspec`}>
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/ingestion-spec.html#dimensionsspec`}
>
dimensions dimensions
</a>{' '} </a>{' '}
(fields you want to group and filter on), and which are{' '} (fields you want to group and filter on), and which are{' '}
<a <a href={`${getLink('DOCS')}/querying/aggregations.html`}>metrics</a> (fields
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/aggregations.html`} you want to aggregate on).
>
metrics
</a>{' '}
(fields you want to aggregate on).
</p> </p>
</PopoverText> </PopoverText>
} }
@ -2779,9 +2745,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<Callout className="intro"> <Callout className="intro">
<p className="optional">Optional</p> <p className="optional">Optional</p>
<p>Configure how Druid will partition data.</p> <p>Configure how Druid will partition data.</p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/index.html#partitioning`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#partitioning`}
/>
</Callout> </Callout>
</div> </div>
{this.renderNextBar({ {this.renderNextBar({
@ -2845,9 +2809,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
<Callout className="intro"> <Callout className="intro">
<p className="optional">Optional</p> <p className="optional">Optional</p>
<p>Fine tune how Druid will ingest data.</p> <p>Fine tune how Druid will ingest data.</p>
<LearnMore <LearnMore href={`${getLink('DOCS')}/ingestion/index.html#tuningconfig`} />
href={`https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/index.html#tuningconfig`}
/>
</Callout> </Callout>
</div> </div>
{this.renderNextBar({ {this.renderNextBar({

View File

@ -33,6 +33,7 @@ import { IconNames } from '@blueprintjs/icons';
import React from 'react'; import React from 'react';
import { MenuCheckbox } from '../../../components'; import { MenuCheckbox } from '../../../components';
import { getLink } from '../../../links';
import { pluralIfNeeded } from '../../../utils'; import { pluralIfNeeded } from '../../../utils';
import { import {
getUseApproximateCountDistinct, getUseApproximateCountDistinct,
@ -43,7 +44,6 @@ import {
setUseApproximateTopN, setUseApproximateTopN,
setUseCache, setUseCache,
} from '../../../utils/query-context'; } from '../../../utils/query-context';
import { DRUID_DOCS_RUNE, DRUID_DOCS_SQL } from '../../../variables';
export interface RunButtonProps { export interface RunButtonProps {
runeMode: boolean; runeMode: boolean;
@ -100,7 +100,7 @@ export class RunButton extends React.PureComponent<RunButtonProps> {
<MenuItem <MenuItem
icon={IconNames.HELP} icon={IconNames.HELP}
text={runeMode ? 'Native query documentation' : 'DruidSQL documentation'} text={runeMode ? 'Native query documentation' : 'DruidSQL documentation'}
href={runeMode ? DRUID_DOCS_RUNE : DRUID_DOCS_SQL} href={getLink(runeMode ? 'DOCS_RUNE' : 'DOCS_SQL')}
target="_blank" target="_blank"
/> />
<MenuItem icon={IconNames.HISTORY} text="Query history" onClick={onHistory} /> <MenuItem icon={IconNames.HISTORY} text="Query history" onClick={onHistory} />