vogievetsky commented on a change in pull request #7493: No SQL mode in web
console
URL: https://github.com/apache/incubator-druid/pull/7493#discussion_r277103202
##########
File path: web-console/src/console-application.tsx
##########
@@ -45,45 +47,53 @@ export interface ConsoleApplicationProps extends
React.Props<any> {
export interface ConsoleApplicationState {
aboutDialogOpen: boolean;
+ noSqlMode: boolean;
+ capabilitiesLoading: boolean;
}
export class ConsoleApplication extends
React.Component<ConsoleApplicationProps, ConsoleApplicationState> {
static MESSAGE_KEY = 'druid-console-message';
static MESSAGE_DISMISSED = 'dismissed';
+ private capabilitiesQueryManager: QueryManager<string, string>;
- static async ensureSql() {
+ static async discoverCapabilities(): Promise<'working-with-sql' |
'working-without-sql' | 'broken'> {
try {
await axios.post('/druid/v2/sql', { query: 'SELECT 1337' });
} catch (e) {
const { response } = e;
- if (response.status !== 405 || response.statusText !== 'Method Not
Allowed') return true; // other failure
+ if (response.status !== 405 || response.statusText !== 'Method Not
Allowed') return 'working-with-sql'; // other failure
try {
await axios.get('/status');
} catch (e) {
- return true; // total failure
+ return 'broken'; // total failure
}
-
// Status works but SQL 405s => the SQL endpoint is disabled
- AppToaster.show({
- icon: IconNames.ERROR,
- intent: Intent.DANGER,
- timeout: 120000,
- /* tslint:disable:jsx-alignment */
- message: <>
- It appears that the SQL endpoint is disabled. Either <a
- href={DRUID_DOCS_SQL}>enable the SQL endpoint</a> or use the old <a
- href={LEGACY_COORDINATOR_CONSOLE}>coordinator</a> and <a
- href={LEGACY_OVERLORD_CONSOLE}>overlord</a> consoles that do not
rely on the SQL endpoint.
- </>
- /* tslint:enable:jsx-alignment */
- });
- return false;
+ return 'working-without-sql';
}
- return true;
+ return 'working-with-sql';
}
- static async shownNotifications() {
- await ConsoleApplication.ensureSql();
+ static shownNotifications(capabilities: string) {
+ let message: JSX.Element = <></>;
+ /* tslint:disable:jsx-alignment */
+ if (capabilities === 'working-without-sql') {
+ message = <>
+ It appears that the SQL endpoint is disabled. No SQL endpoint is
+ used and all requests rely on <a href={DRUID_DOCS_API}>native Druid
query API</a>,
+ but you may still <a href={DRUID_DOCS_SQL}>enable the SQL endpoint</a>
Review comment:
can this instead be ("No SQL endpoint" does not make sense):
```
It appears that the SQL endpoint is disabled. The console will fall back to
<a href={DRUID_DOCS_API} target="_blank">native Druid APIs</a> and will be
limited in functionality. Look at <a href={DRUID_DOCS_SQL} target="_blank">the
SQL docs</a> to enable the SQL endpoint.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]