From d97c0d19a0e53cf651eab5331094fe70654db6ee Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Wed, 1 May 2019 01:53:03 -0700 Subject: [PATCH] add url baser (#7585) --- web-console/src/console-application.tsx | 2 ++ web-console/src/singletons/url-baser.ts | 26 +++++++++++++++++++++++++ web-console/src/views/home-view.tsx | 3 ++- web-console/src/views/tasks-view.tsx | 19 +++++++++--------- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 web-console/src/singletons/url-baser.ts diff --git a/web-console/src/console-application.tsx b/web-console/src/console-application.tsx index 4f5ea47cda0..dad1b5677b8 100644 --- a/web-console/src/console-application.tsx +++ b/web-console/src/console-application.tsx @@ -26,6 +26,7 @@ import { HashRouter, Route, Switch } from 'react-router-dom'; import { HeaderActiveTab, HeaderBar } from './components/header-bar'; import {Loader} from './components/loader'; import { AppToaster } from './singletons/toaster'; +import { UrlBaser } from './singletons/url-baser'; import {QueryManager} from './utils'; import {DRUID_DOCS_API, DRUID_DOCS_SQL, LEGACY_COORDINATOR_CONSOLE, LEGACY_OVERLORD_CONSOLE} from './variables'; import { DatasourcesView } from './views/datasource-view'; @@ -113,6 +114,7 @@ export class ConsoleApplication extends React.Component {this.renderCard({ - href: '/status', + href: UrlBaser.base('/status'), icon: IconNames.GRAPH, title: 'Status', loading: state.statusLoading, diff --git a/web-console/src/views/tasks-view.tsx b/web-console/src/views/tasks-view.tsx index 6f11c87d439..c179d49c272 100644 --- a/web-console/src/views/tasks-view.tsx +++ b/web-console/src/views/tasks-view.tsx @@ -28,6 +28,7 @@ import { ViewControlBar } from '../components/view-control-bar'; import { AsyncActionDialog } from '../dialogs/async-action-dialog'; import { SpecDialog } from '../dialogs/spec-dialog'; import { AppToaster } from '../singletons/toaster'; +import { UrlBaser } from '../singletons/url-baser'; import { addFilter, booleanCustomTableFilter, @@ -434,10 +435,10 @@ ORDER BY "rank" DESC, "created_time" DESC`); this.setState({ suspendSupervisorId: id })}>Suspend; return
- Payload    - Status    - Stats    - History    + Payload    + Status    + Stats    + History    {suspendResume}    this.setState({ resetSupervisorId: id })}>Reset    this.setState({ terminateSupervisorId: id })}>Terminate @@ -593,11 +594,11 @@ ORDER BY "rank" DESC, "created_time" DESC`); const id = row.value; const { status } = row.original; return
- Payload    - Status    - Reports    - Log (all)    - Log (last 8kb)    + Payload    + Status    + Reports    + Log (all)    + Log (last 8kb)    {(status === 'RUNNING' || status === 'WAITING' || status === 'PENDING') && this.setState({ killTaskId: id })}>Kill}
; },