+ return
{
runningTasks.length ?
<>
diff --git a/web-console/src/views/sql-view.tsx b/web-console/src/views/sql-view.tsx
index a60cc3eaaa9..e8f90d72c3e 100644
--- a/web-console/src/views/sql-view.tsx
+++ b/web-console/src/views/sql-view.tsx
@@ -16,12 +16,12 @@
* limitations under the License.
*/
-import * as Hjson from "hjson";
+import * as Hjson from 'hjson';
import * as React from 'react';
-import ReactTable from "react-table";
+import ReactTable from 'react-table';
import { SqlControl } from '../components/sql-control';
-import { QueryPlanDialog } from "../dialogs/query-plan-dialog";
+import { QueryPlanDialog } from '../dialogs/query-plan-dialog';
import {
BasicQueryExplanation,
decodeRune,
@@ -32,7 +32,7 @@ import {
queryDruidSql, QueryManager, SemiJoinQueryExplanation
} from '../utils';
-import "./sql-view.scss";
+import './sql-view.scss';
export interface SqlViewProps extends React.Props
{
initSql: string | null;
@@ -77,7 +77,7 @@ export class SqlView extends React.Component {
} else {
const result = await queryDruidSql({
query,
- resultFormat: "array",
+ resultFormat: 'array',
header: true
});
@@ -101,9 +101,9 @@ export class SqlView extends React.Component {
const explainQuery = `explain plan for ${query}`;
const result = await queryDruidSql({
query: explainQuery,
- resultFormat: "object"
+ resultFormat: 'object'
});
- const data: BasicQueryExplanation | SemiJoinQueryExplanation | string = parseQueryPlan(result[0]["PLAN"]);
+ const data: BasicQueryExplanation | SemiJoinQueryExplanation | string = parseQueryPlan(result[0]['PLAN']);
return data;
},
onStateChange: ({ result, loading, error }) => {
diff --git a/web-console/src/views/tasks-view.tsx b/web-console/src/views/tasks-view.tsx
index d0c1555cfc4..2897c6d43ec 100644
--- a/web-console/src/views/tasks-view.tsx
+++ b/web-console/src/views/tasks-view.tsx
@@ -16,17 +16,17 @@
* limitations under the License.
*/
-import { Alert, Button, ButtonGroup, Intent, Label } from "@blueprintjs/core";
-import { IconNames } from "@blueprintjs/icons";
+import { Alert, Button, ButtonGroup, Intent, Label } from '@blueprintjs/core';
+import { IconNames } from '@blueprintjs/icons';
import axios from 'axios';
import * as classNames from 'classnames';
import * as React from 'react';
-import ReactTable from "react-table";
-import { Filter } from "react-table";
+import ReactTable from 'react-table';
+import { Filter } from 'react-table';
-import { TableColumnSelection } from "../components/table-column-selection";
-import { AsyncActionDialog } from "../dialogs/async-action-dialog";
-import { SpecDialog } from "../dialogs/spec-dialog";
+import { TableColumnSelection } from '../components/table-column-selection';
+import { AsyncActionDialog } from '../dialogs/async-action-dialog';
+import { SpecDialog } from '../dialogs/spec-dialog';
import { AppToaster } from '../singletons/toaster';
import {
addFilter,
@@ -35,12 +35,12 @@ import {
getDruidErrorMessage, LocalStorageKeys,
queryDruidSql,
QueryManager, TableColumnSelectionHandler
-} from "../utils";
+} from '../utils';
-import "./tasks-view.scss";
+import './tasks-view.scss';
-const supervisorTableColumns: string[] = ["Datasource", "Type", "Topic/Stream", "Status", "Actions"];
-const taskTableColumns: string[] = ["Task ID", "Type", "Datasource", "Created time", "Status", "Duration", "Actions"];
+const supervisorTableColumns: string[] = ['Datasource', 'Type', 'Topic/Stream', 'Status', 'Actions'];
+const taskTableColumns: string[] = ['Task ID', 'Type', 'Datasource', 'Created time', 'Status', 'Duration', 'Actions'];
export interface TasksViewProps extends React.Props {
taskId: string | null;
@@ -126,7 +126,7 @@ export class TasksView extends React.Component {
componentDidMount(): void {
this.supervisorQueryManager = new QueryManager({
processQuery: async (query: string) => {
- const resp = await axios.get("/druid/indexer/v1/supervisor?full");
+ const resp = await axios.get('/druid/indexer/v1/supervisor?full');
return resp.data;
},
onStateChange: ({ result, loading, error }) => {
@@ -328,11 +328,11 @@ ORDER BY "rank" DESC, "created_time" DESC`);
filterable
columns={[
{
- Header: "Datasource",
+ Header: 'Datasource',
id: 'datasource',
- accessor: "id",
+ accessor: 'id',
width: 300,
- show: supervisorTableColumnSelectionHandler.showColumn("Datasource")
+ show: supervisorTableColumnSelectionHandler.showColumn('Datasource')
},
{
Header: 'Type',
@@ -344,7 +344,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
if (!tuningConfig) return '';
return tuningConfig.type;
},
- show: supervisorTableColumnSelectionHandler.showColumn("Type")
+ show: supervisorTableColumnSelectionHandler.showColumn('Type')
},
{
Header: 'Topic/Stream',
@@ -356,10 +356,10 @@ ORDER BY "rank" DESC, "created_time" DESC`);
if (!ioConfig) return '';
return ioConfig.topic || ioConfig.stream || '';
},
- show: supervisorTableColumnSelectionHandler.showColumn("Topic/Stream")
+ show: supervisorTableColumnSelectionHandler.showColumn('Topic/Stream')
},
{
- Header: "Status",
+ Header: 'Status',
id: 'status',
accessor: (row) => row.spec.suspended ? 'Suspended' : 'Running',
Cell: row => {
@@ -373,7 +373,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
{value}
;
},
- show: supervisorTableColumnSelectionHandler.showColumn("Status")
+ show: supervisorTableColumnSelectionHandler.showColumn('Status')
},
{
Header: 'Actions',
@@ -397,7 +397,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
this.setState({ terminateSupervisorId: id })}>Terminate
;
},
- show: supervisorTableColumnSelectionHandler.showColumn("Actions")
+ show: supervisorTableColumnSelectionHandler.showColumn('Actions')
}
]}
defaultPageSize={10}
@@ -452,44 +452,44 @@ ORDER BY "rank" DESC, "created_time" DESC`);
onFilteredChange={(filtered, column) => {
this.setState({ taskFilter: filtered });
}}
- defaultSorted={[{id: "status", desc: true}]}
+ defaultSorted={[{id: 'status', desc: true}]}
pivotBy={groupTasksBy ? [groupTasksBy] : []}
columns={[
{
- Header: "Task ID",
- accessor: "task_id",
+ Header: 'Task ID',
+ accessor: 'task_id',
width: 300,
Aggregated: row => '',
- show: taskTableColumnSelectionHandler.showColumn("Task ID")
+ show: taskTableColumnSelectionHandler.showColumn('Task ID')
},
{
- Header: "Type",
- accessor: "type",
+ Header: 'Type',
+ accessor: 'type',
Cell: row => {
const value = row.value;
return
{ this.setState({ taskFilter: addFilter(taskFilter, 'type', value) }); }}>{value};
},
- show: taskTableColumnSelectionHandler.showColumn("Type")
+ show: taskTableColumnSelectionHandler.showColumn('Type')
},
{
- Header: "Datasource",
- accessor: "datasource",
+ Header: 'Datasource',
+ accessor: 'datasource',
Cell: row => {
const value = row.value;
return
{ this.setState({ taskFilter: addFilter(taskFilter, 'datasource', value) }); }}>{value};
},
- show: taskTableColumnSelectionHandler.showColumn("Datasource")
+ show: taskTableColumnSelectionHandler.showColumn('Datasource')
},
{
- Header: "Created time",
- accessor: "created_time",
+ Header: 'Created time',
+ accessor: 'created_time',
width: 120,
Aggregated: row => '',
- show: taskTableColumnSelectionHandler.showColumn("Created time")
+ show: taskTableColumnSelectionHandler.showColumn('Created time')
},
{
- Header: "Status",
- id: "status",
+ Header: 'Status',
+ id: 'status',
width: 110,
accessor: (row) => `${row.rank}_${row.created_time}_${row.status}`,
Cell: row => {
@@ -519,15 +519,15 @@ ORDER BY "rank" DESC, "created_time" DESC`);
const previewCount = countBy(previewValues);
return
{Object.keys(previewCount).sort().map(v => `${v} (${previewCount[v]})`).join(', ')};
},
- show: taskTableColumnSelectionHandler.showColumn("Status")
+ show: taskTableColumnSelectionHandler.showColumn('Status')
},
{
- Header: "Duration",
- accessor: "duration",
+ Header: 'Duration',
+ accessor: 'duration',
filterable: false,
Cell: (row) => row.value > 0 ? formatDuration(row.value) : '',
Aggregated: () => '',
- show: taskTableColumnSelectionHandler.showColumn("Duration")
+ show: taskTableColumnSelectionHandler.showColumn('Duration')
},
{
Header: 'Actions',
@@ -549,7 +549,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
;
},
Aggregated: row => '',
- show: taskTableColumnSelectionHandler.showColumn("Actions")
+ show: taskTableColumnSelectionHandler.showColumn('Actions')
}
]}
defaultPageSize={20}
diff --git a/web-console/tslint.json b/web-console/tslint.json
index daed15b9d92..6c6b84af9fe 100644
--- a/web-console/tslint.json
+++ b/web-console/tslint.json
@@ -1,125 +1,18 @@
{
- "extends": [
- "tslint:recommended",
- "tslint-react"
- ],
+ "extends": "awesome-code-style/tslint.json",
"rules": {
- "align": true,
- "array-type": [true, "array"],
- "arrow-parens": false,
- "ban": [false,
- ["_", "extend"],
- ["_", "isNull"],
- ["_", "isDefined"]
- ],
- "comment-format": [false,
- "check-space"
- ],
- "curly": [true, "ignore-same-line"],
"file-header": [true, "Licensed to the Apache Software Foundation \\(ASF\\).+"],
- "forin": false,
- "indent": [true, "spaces", 2],
- "interface-name": [true, "never-prefix"],
- "jsdoc-format": true,
- "label-position": true,
- "max-line-length": [true, 200],
- "max-classes-per-file": false,
- "member-access": false,
- "member-ordering": [true,
- {
- "order": [
- "static-field",
- "static-method",
- "instance-field",
- "constructor",
- "instance-method"
- ]
- }
- ],
- "no-any": false,
- "no-arg": true,
- "no-console": [true,
- "debug",
- "info",
- "time",
- "timeEnd",
- "trace"
- ],
- "no-empty": [true, "allow-empty-catch"],
- "no-empty-interface": false,
- "no-eval": true,
- "no-inferrable-types": true,
- "no-null-keyword": false,
- "no-parameter-properties": true,
- "no-require-imports": false,
"no-shadowed-variable": false,
- "no-string-literal": false,
- "no-switch-case-fall-through": false,
- "no-trailing-whitespace": true,
- "no-unused-expression": false,
- "no-use-before-declare": false,
- "object-literal-sort-keys": false,
- "one-line": [true,
- "check-catch",
- "check-else",
- "check-finally",
- "check-open-brace",
- "check-whitespace"
- ],
- "ordered-imports": [
- true,
- {
- "import-sources-order": "case-insensitive",
- "grouped-imports": true,
- "groups": [
- { "name": "parent directories", "match": "^\\.\\.", "order": 20 },
- { "name": "styles", "match": ".scss$", "order": 40 },
- { "name": "current directory", "match": "^\\.", "order": 30 },
- { "name": "libraries", "match": ".*", "order": 10 }
- ]
- }
- ],
- "prefer-const": [true, {"destructuring": "all"}],
- "quotemark": [false, "double", "jsx-double", "avoid-escape"],
- "semicolon": true,
- "switch-default": false,
- "trailing-comma": [true, {
- "singleline": "never",
- "multiline": "never"
- }],
- "triple-equals": [true, "allow-null-check"],
- "typedef": false,
- "typedef-whitespace": [true, {
- "call-signature": "nospace",
- "index-signature": "nospace",
- "parameter": "nospace",
- "property-declaration": "nospace",
- "variable-declaration": "nospace"
- }, {
- "call-signature": "onespace",
- "index-signature": "onespace",
- "parameter": "onespace",
- "property-declaration": "onespace",
- "variable-declaration": "onespace"
- }],
"variable-name": false,
- "whitespace": [true,
- "check-branch",
- "check-decl",
- "check-operator",
- "check-module",
- "check-separator",
- "check-type",
- "check-type-operator"
- ],
- "jsx-alignment": true,
- "jsx-boolean-value": [true, "never"],
- "jsx-curly-spacing": [true, "never"],
- "jsx-no-lambda": false,
- "jsx-no-multiline-js": false,
- "jsx-no-string-ref": true,
- "jsx-self-close": true,
- "jsx-space-before-trailing-slash": false,
- "jsx-wrap-multiline": false
+ "no-conditional-assignment": true,
+ "no-string-literal": false,
+ "object-literal-shorthand": false,
+ "no-require-imports": false,
+ "arrow-return-shorthand": false,
+ "no-var-requires": false,
+ "no-unused-variable": false
+ },
+ "linterOptions": {
+ "format": "useful"
}
}