diff --git a/web/config/router.config.js b/web/config/router.config.js index d3b4271c..1ced84e2 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -94,15 +94,15 @@ export default [ ] }, //devtools - { - routes:[ - { path: '/', redirect: '/' }, - ], - path: '/dev_tool', - name: 'devtool', - icon: 'code', - component: './DevTool/Console', - }, + // { + // routes:[ + // { path: '/', redirect: '/' }, + // ], + // path: '/dev_tool', + // name: 'devtool', + // icon: 'code', + // component: './DevTool/Console', + // }, //alerting { diff --git a/web/src/components/infini/resize_bar.js b/web/src/components/infini/resize_bar.js index d3bbde52..5a34df4b 100644 --- a/web/src/components/infini/resize_bar.js +++ b/web/src/components/infini/resize_bar.js @@ -4,6 +4,7 @@ export const ResizeBar = () => { return
+
; }; \ No newline at end of file diff --git a/web/src/components/infini/resize_bar.scss b/web/src/components/infini/resize_bar.scss index ffa4abd4..af15713f 100644 --- a/web/src/components/infini/resize_bar.scss +++ b/web/src/components/infini/resize_bar.scss @@ -2,12 +2,13 @@ display: flex; height: 10px; background: #eee; - border-top: 1px solid #bbb; + // border-top: 1px solid #bbb; align-items: center; justify-content: center; .dash{ - height: 2px; - width: 24px; - background: #999; + height: 1px; + width: 16px; + background: #666; + margin-top: 1px; } } \ No newline at end of file diff --git a/web/src/components/kibana/console/components/ConsoleOutput.tsx b/web/src/components/kibana/console/components/ConsoleOutput.tsx index a959ff9c..690b30af 100644 --- a/web/src/components/kibana/console/components/ConsoleOutput.tsx +++ b/web/src/components/kibana/console/components/ConsoleOutput.tsx @@ -83,6 +83,10 @@ function ConsoleOutput({clusterID}: props) { } else if (error) { const mode = modeForContentType(error.response.contentType); + if(mode == 'ace/mode/json'){ + editor.update(JSON.stringify(JSON.parse(error.response.value), null, 2), mode); + return + } editor.update(error.response.value as string, mode); } else { editor.update(''); diff --git a/web/src/components/kibana/console/hooks/use_send_current_request_to_es/index.ts b/web/src/components/kibana/console/hooks/use_send_current_request_to_es/index.ts index e160894d..619ed777 100644 --- a/web/src/components/kibana/console/hooks/use_send_current_request_to_es/index.ts +++ b/web/src/components/kibana/console/hooks/use_send_current_request_to_es/index.ts @@ -60,9 +60,10 @@ export const useSendCurrentRequestToES = () => { console.log('No request selected. Select a request by placing the cursor inside it.'); return; } - const {url, method} = requests[0]; + const {url, method, data} = requests[0]; if(method === 'LOAD'){ - const cmd = getCommand(url); + const rawUrl = data[0].slice(4).trim(); + const cmd = getCommand(rawUrl); // const curPostion = editor.currentReqRange //(editor.getCoreEditor().getCurrentPosition()); const lineNumber = editor.getCoreEditor().getCurrentPosition().lineNumber; let crange = await editor.getRequestRange(lineNumber) diff --git a/web/src/components/kibana/console/hooks/use_send_current_request_to_es/send_request_to_es.ts b/web/src/components/kibana/console/hooks/use_send_current_request_to_es/send_request_to_es.ts index fb20e22c..5609b3d3 100644 --- a/web/src/components/kibana/console/hooks/use_send_current_request_to_es/send_request_to_es.ts +++ b/web/src/components/kibana/console/hooks/use_send_current_request_to_es/send_request_to_es.ts @@ -119,8 +119,9 @@ export function sendRequestToES(args: EsRequestArgs): Promise } else { let value; let contentType: string; + let resObj:any = {}; if (xhr.responseText) { - const resObj = JSON.parse(xhr.responseText) + resObj = JSON.parse(xhr.responseText) if(resObj.error){ value = resObj.error; contentType = 'text/plain'; @@ -143,11 +144,13 @@ export function sendRequestToES(args: EsRequestArgs): Promise timeMs: Date.now() - startTime, statusCode: xhr.status, statusText: xhr.statusText, + header: resObj.response_header, }, request: { data: esData, method: esMethod, path: esPath, + header: resObj.request_header, }, }); }