Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Apache Druid ConsoleEntry

From Leeroopedia


Knowledge Sources
Domains Web_Console, Application_Bootstrap
Last Updated 2026-02-10 10:00 GMT

Overview

ConsoleEntry is the main entry point module for the Druid web console application, responsible for bootstrapping configuration, initializing singletons, mounting the React application, and setting up input mode detection.

Description

The module reads a global `consoleConfig` object from the window to configure the application. It initializes the Api singleton with base URL, custom headers, and BigInt-safe JSON parsing; sets up the QueryRunner default executor for druid-query-toolkit; configures link overrides and localStorage namespacing; and renders the ConsoleApplication root component inside a Blueprint OverlaysProvider. After mounting, it initializes mouse tooltip behavior and installs keyboard/mouse event listeners that toggle CSS classes for focus ring management between mouse and tab navigation modes.

Usage

Loaded as the Webpack entry point for the Druid web console. It is executed once when the browser loads the console page and is not imported by any other module.

Code Reference

Source Location

Signature

// No exports - this is the application entry point

interface ConsoleConfig {
  title?: string;
  baseURL?: string;
  customHeaderName?: string;
  customHeaderValue?: string;
  customHeaders?: Record<string, string>;
  baseQueryContext?: QueryContext;
  defaultQueryContext?: QueryContext;
  mandatoryQueryContext?: QueryContext;
  serverQueryContext?: QueryContext;
  linkOverrides?: Links;
  localStorageNamespace?: string;
}

Import

// Entry point - loaded by Webpack, not imported directly
// Configuration via window.consoleConfig

I/O Contract

Inputs

Name Type Required Description
window.consoleConfig ConsoleConfig Yes Global configuration object injected into the page by the Druid router
window.consoleConfig.title string No Custom page title
window.consoleConfig.baseURL string No Base URL for all API calls (for proxied deployments)
window.consoleConfig.customHeaderName string No Custom HTTP header name added to all requests
window.consoleConfig.customHeaderValue string No Custom HTTP header value added to all requests
window.consoleConfig.customHeaders Record<string, string> No Multiple custom HTTP headers added to all requests
window.consoleConfig.baseQueryContext QueryContext No Base context passed to ConsoleApplication
window.consoleConfig.defaultQueryContext QueryContext No Default context for new query tabs
window.consoleConfig.mandatoryQueryContext QueryContext No Context properties added to all query requests
window.consoleConfig.serverQueryContext QueryContext No Server-side default query context
window.consoleConfig.linkOverrides Links No Custom documentation link overrides
window.consoleConfig.localStorageNamespace string No Namespace prefix for localStorage keys

Outputs

Name Type Description
Rendered application React root The ConsoleApplication component mounted into the .app-container DOM element

Usage Examples

HTML page embedding the console

<div class="app-container"></div>
<script>
  window.consoleConfig = {
    title: 'My Druid Console',
    baseURL: '/druid-proxy',
    defaultQueryContext: { useApproximateCountDistinct: true },
  };
</script>
<script src="public/main.js"></script>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment