fix: remove view code loading
This commit is contained in:
@@ -60,7 +60,7 @@ export const yAxis = {
|
||||
// max: 100,
|
||||
// min: 0,
|
||||
nameTextStyle: {
|
||||
padding: [0, 0, 0, -25]
|
||||
padding: [0, 0, 0, -20]
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
|
||||
@@ -61,13 +61,13 @@ const TableRow: React.FC<
|
||||
}
|
||||
}, [rowSelection]);
|
||||
|
||||
useEffect(() => {
|
||||
if (expandedRowKeys?.includes(record[rowKey])) {
|
||||
setExpanded(true);
|
||||
} else {
|
||||
setExpanded(false);
|
||||
}
|
||||
}, [expandedRowKeys]);
|
||||
// useEffect(() => {
|
||||
// if (expandedRowKeys?.includes(record[rowKey])) {
|
||||
// setExpanded(true);
|
||||
// } else {
|
||||
// setExpanded(false);
|
||||
// }
|
||||
// }, [expandedRowKeys]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
|
||||
@@ -10,5 +10,5 @@ export default {
|
||||
'apikeys.form.expiration.7days': '7 days',
|
||||
'apikeys.form.expiration.1month': '1 month',
|
||||
'apikeys.form.expiration.6months': '6 months',
|
||||
'apikeys.form.expiration.never': 'never'
|
||||
'apikeys.form.expiration.never': 'No expiration'
|
||||
};
|
||||
|
||||
@@ -9,5 +9,5 @@ export default {
|
||||
'apikeys.form.expiration.7days': '7天',
|
||||
'apikeys.form.expiration.1month': '1个月',
|
||||
'apikeys.form.expiration.6months': '6个月',
|
||||
'apikeys.form.expiration.never': '永不'
|
||||
'apikeys.form.expiration.never': '永不过期'
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import EditorWrap from '@/components/editor-wrap';
|
||||
import { BulbOutlined } from '@ant-design/icons';
|
||||
import Editor from '@monaco-editor/react';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Modal, Spin } from 'antd';
|
||||
import { Button, Modal } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
|
||||
@@ -103,6 +103,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
const handleEditorDidMount = (editor: any, monaco: any) => {
|
||||
editorRef.current = editor;
|
||||
setLoaded(true);
|
||||
console.log('loaded====');
|
||||
};
|
||||
|
||||
const handleOnChangeLang = (value: string) => {
|
||||
@@ -146,7 +147,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
<div style={{ marginBottom: '10px' }}>
|
||||
{intl.formatMessage({ id: 'playground.viewcode.info' })}
|
||||
</div>
|
||||
<Spin spinning={!loaded}>
|
||||
<div>
|
||||
<EditorWrap
|
||||
copyText={codeValue}
|
||||
langOptions={langOptions}
|
||||
@@ -181,7 +182,9 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
>
|
||||
<span>
|
||||
{' '}
|
||||
{intl.formatMessage({ id: 'playground.viewcode.here' })}
|
||||
{intl.formatMessage({
|
||||
id: 'playground.viewcode.here'
|
||||
})}
|
||||
</span>
|
||||
</Button>
|
||||
)
|
||||
@@ -189,7 +192,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user