You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by vo...@apache.org on 2022/07/15 00:01:36 UTC

[druid] branch master updated: show json and add search box (#12784)

This is an automated email from the ASF dual-hosted git repository.

vogievetsky pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 50f1f5840d show json and add search box (#12784)
50f1f5840d is described below

commit 50f1f5840d2f090179ebafbe53a27cea54e7734d
Author: Yuanli Han <44...@users.noreply.github.com>
AuthorDate: Fri Jul 15 08:01:30 2022 +0800

    show json and add search box (#12784)
---
 web-console/src/bootstrap/ace.ts                   |  1 +
 web-console/src/components/show-json/show-json.tsx | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/web-console/src/bootstrap/ace.ts b/web-console/src/bootstrap/ace.ts
index 50ec648f56..1d8ea64d06 100644
--- a/web-console/src/bootstrap/ace.ts
+++ b/web-console/src/bootstrap/ace.ts
@@ -18,6 +18,7 @@
 
 import 'ace-builds/src-noconflict/ace'; // Import Ace editor and all the sub components used in the app
 import 'ace-builds/src-noconflict/ext-language_tools';
+import 'ace-builds/src-noconflict/ext-searchbox';
 import 'ace-builds/src-noconflict/theme-solarized_dark';
 import '../ace-modes/dsql';
 import '../ace-modes/hjson';
diff --git a/web-console/src/components/show-json/show-json.tsx b/web-console/src/components/show-json/show-json.tsx
index 18b331e41e..c840c95e24 100644
--- a/web-console/src/components/show-json/show-json.tsx
+++ b/web-console/src/components/show-json/show-json.tsx
@@ -16,10 +16,11 @@
  * limitations under the License.
  */
 
-import { Button, ButtonGroup, Intent, TextArea } from '@blueprintjs/core';
+import { Button, ButtonGroup, Intent } from '@blueprintjs/core';
 import copy from 'copy-to-clipboard';
 import * as JSONBig from 'json-bigint-native';
 import React from 'react';
+import AceEditor from 'react-ace';
 
 import { useQueryManager } from '../../hooks';
 import { Api, AppToaster, UrlBaser } from '../../singletons';
@@ -84,7 +85,18 @@ export const ShowJson = React.memo(function ShowJson(props: ShowJsonProps) {
         {jsonState.loading ? (
           <Loader />
         ) : (
-          <TextArea readOnly value={!jsonState.error ? jsonValue : jsonState.getErrorMessage()} />
+          <AceEditor
+            mode="hjson"
+            theme="tomorrow"
+            readOnly
+            fontSize={12}
+            width="100%"
+            height="100%"
+            showPrintMargin={false}
+            showGutter={false}
+            value={!jsonState.error ? jsonValue : jsonState.getErrorMessage()}
+            style={{}}
+          />
         )}
       </div>
     </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org