updated api debugger for invalid import cause render crash and for stringify results

This commit is contained in:
srgooglo 2020-10-12 09:02:10 +02:00
parent 9a123db67a
commit 2d05c017e2
3 changed files with 11 additions and 40 deletions

View File

@ -1,16 +0,0 @@
import React from 'react'
import themeStyle from 'theme/base/vars.less'
export default class AntdDebug extends React.Component{
state = {
styleLink: document.getElementById('theme-style'),
body: document.getElementsByTagName('body')[0]
}
render(){
return(
<div>
{JSON.stringify(themeStyle)}
</div>
)
}
}

View File

@ -1,5 +1,4 @@
import React from 'react'; import React from 'react';
import {v3_request} from 'api';
import {api_request} from 'core/libs/v3_model' import {api_request} from 'core/libs/v3_model'
import { import {
Row, Row,
@ -49,9 +48,7 @@ export default class RequestPage extends React.Component {
paramsForm = React.createRef(); paramsForm = React.createRef();
bodyDataForm = React.createRef(); bodyDataForm = React.createRef();
constructor(props) { state = {
super(props);
this.state = {
// Default sets // Default sets
method: 'GET', method: 'GET',
url: '', url: '',
@ -59,7 +56,6 @@ export default class RequestPage extends React.Component {
BodyKeys: [1], BodyKeys: [1],
result: null, result: null,
visible: true, visible: true,
};
} }
handleRequest = () => { handleRequest = () => {
@ -103,8 +99,7 @@ export default class RequestPage extends React.Component {
const frame = { const frame = {
method, method,
endpoint: `${method} ${url}`, endpoint: `${method} ${url}`,
body, body
verbose: true
} }
console.log(frame) console.log(frame)
api_request(frame, (err, res) => { api_request(frame, (err, res) => {
@ -346,7 +341,7 @@ export default class RequestPage extends React.Component {
</Col> </Col>
</Row> </Row>
<div className={styles.result}>{result}</div> <div className={styles.result}>{JSON.stringify(result)}</div>
</Col> </Col>
</Row> </Row>
</div> </div>

View File

@ -3,7 +3,6 @@ import * as Icons from 'components/Icons'
import { ListedMenu } from 'components' import { ListedMenu } from 'components'
import ApiDebug from './debuggers/api' import ApiDebug from './debuggers/api'
import AntdDebug from './debuggers/antd'
import CoreDebug from './debuggers/core' import CoreDebug from './debuggers/core'
import ThemeDebug from './debuggers/theme' import ThemeDebug from './debuggers/theme'
import SocketDebug from './debuggers/socket' import SocketDebug from './debuggers/socket'
@ -13,7 +12,6 @@ import InternalDebug from './debuggers/internals'
const Debuggers = { const Debuggers = {
api: <ApiDebug />, api: <ApiDebug />,
antd: <AntdDebug />,
core: <CoreDebug />, core: <CoreDebug />,
theme: <ThemeDebug />, theme: <ThemeDebug />,
socket: <SocketDebug />, socket: <SocketDebug />,
@ -27,12 +25,6 @@ const menuList = [
title: "API V3 Requester", title: "API V3 Requester",
icon: <Icons.Globe />, icon: <Icons.Globe />,
}, },
{
key: "antd",
title: "Antd",
icon: <Icons.AntDesignOutlined />,
require: "embedded"
},
{ {
key: "core", key: "core",
title: "Core", title: "Core",