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