mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
updated api debugger for invalid import cause render crash and for stringify results
This commit is contained in:
parent
9a123db67a
commit
2d05c017e2
@ -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>
|
||||
)
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
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 {
|
||||
Row,
|
||||
Col,
|
||||
@ -49,17 +48,14 @@ export default class RequestPage extends React.Component {
|
||||
paramsForm = React.createRef();
|
||||
bodyDataForm = React.createRef();
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
// Default sets
|
||||
method: 'GET',
|
||||
url: '',
|
||||
ParamsKeys: [1],
|
||||
BodyKeys: [1],
|
||||
result: null,
|
||||
visible: true,
|
||||
};
|
||||
state = {
|
||||
// Default sets
|
||||
method: 'GET',
|
||||
url: '',
|
||||
ParamsKeys: [1],
|
||||
BodyKeys: [1],
|
||||
result: null,
|
||||
visible: true,
|
||||
}
|
||||
|
||||
handleRequest = () => {
|
||||
@ -103,8 +99,7 @@ export default class RequestPage extends React.Component {
|
||||
const frame = {
|
||||
method,
|
||||
endpoint: `${method} ${url}`,
|
||||
body,
|
||||
verbose: true
|
||||
body
|
||||
}
|
||||
console.log(frame)
|
||||
api_request(frame, (err, res) => {
|
||||
@ -346,7 +341,7 @@ export default class RequestPage extends React.Component {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div className={styles.result}>{result}</div>
|
||||
<div className={styles.result}>{JSON.stringify(result)}</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
@ -3,7 +3,6 @@ import * as Icons from 'components/Icons'
|
||||
import { ListedMenu } from 'components'
|
||||
|
||||
import ApiDebug from './debuggers/api'
|
||||
import AntdDebug from './debuggers/antd'
|
||||
import CoreDebug from './debuggers/core'
|
||||
import ThemeDebug from './debuggers/theme'
|
||||
import SocketDebug from './debuggers/socket'
|
||||
@ -13,7 +12,6 @@ import InternalDebug from './debuggers/internals'
|
||||
|
||||
const Debuggers = {
|
||||
api: <ApiDebug />,
|
||||
antd: <AntdDebug />,
|
||||
core: <CoreDebug />,
|
||||
theme: <ThemeDebug />,
|
||||
socket: <SocketDebug />,
|
||||
@ -27,12 +25,6 @@ const menuList = [
|
||||
title: "API V3 Requester",
|
||||
icon: <Icons.Globe />,
|
||||
},
|
||||
{
|
||||
key: "antd",
|
||||
title: "Antd",
|
||||
icon: <Icons.AntDesignOutlined />,
|
||||
require: "embedded"
|
||||
},
|
||||
{
|
||||
key: "core",
|
||||
title: "Core",
|
||||
|
Loading…
x
Reference in New Issue
Block a user