Skip to content

Commit

Permalink
PullRequest: 227 fix/dev-4.2.2-bp-bugs-xyh-1109
Browse files Browse the repository at this point in the history
Merge branch 'fix/dev-4.2.2-bp-bugs-xyh-1109 of [email protected]:oceanbase/oceanbase-developer-center.git into dev-4.2.2

https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/227


Signed-off-by: 晓康 <[email protected]>


* Fixes oceanbase/odc#729

* Fixes oceanbase/odc#729(style)
  • Loading branch information
bluesky-xyh committed Nov 9, 2023
1 parent 5a826e8 commit feb67c7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { SettingStore } from '@/store/setting';
import { formatMessage } from '@/util/intl';
import { formatBytes, getBlobValueKey } from '@/util/utils';
import type { FormatterProps } from '@oceanbase-odc/ob-react-data-grid';
import { Alert, Button, Image, Input, Modal, Radio, Row, Space, Spin } from 'antd';
import { Alert, Button, Image, Input, Modal, Radio, Row, Space, Spin, Typography } from 'antd';
import { UploadFile } from 'antd/es/upload/interface';
import Cookies from 'js-cookie';
import { inject, observer } from 'mobx-react';
Expand Down Expand Up @@ -92,10 +92,7 @@ const CreateFileLoader = (params: { request: Request; callback: Callback }) => {
fileLoader(size);
if (isFinish) {
callback({
content: contents
?.slice(1)
?.map((item) => item?.content)
?.join(''),
content: contents?.map((item) => item?.content)?.join(''),
size,
});
}
Expand Down Expand Up @@ -241,7 +238,7 @@ const BlobViewModal: React.FC<IProps> = (props) => {
case DISPLAY_MODE.TEXT:
case DISPLAY_MODE.HEXTEXT: {
const maxSizeText = formatBytes(maxTextSize);

const disabled = !isModeEditable || !resultContext.isEditing;
return (
<Spin spinning={loading}>
<div style={{ display: 'flex', flexDirection: 'column', height: 500 }}>
Expand All @@ -260,19 +257,25 @@ const BlobViewModal: React.FC<IProps> = (props) => {
)}
{mode === DISPLAY_MODE.HEXTEXT ? (
<HexEditor
disabled={!isModeEditable || !resultContext.isEditing}
disabled={disabled}
value={hexText}
onChange={(v) => {
setHexText(v);
}}
/>
) : disabled ? (
<div className={styles['contenttext-disabled']}>
<Typography.Text disabled>
{mode == DISPLAY_MODE.TEXT ? text : hexText}
</Typography.Text>
</div>
) : (
<Input.TextArea
className={styles.contenttext}
style={{ resize: 'none', wordBreak: 'break-all' }}
autoSize={false}
value={mode == DISPLAY_MODE.TEXT ? text : hexText}
disabled={!isModeEditable || !resultContext.isEditing}
disabled={disabled}
onChange={(e) => {
if (mode === DISPLAY_MODE.TEXT) {
setText(e.target.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
.textNull {
color: var(--text-color-secondary);
}
.contenttext {
.contenttext,
.contenttext-disabled {
flex: 1;
padding: 8px;
background: #f8f9fb;
border: none;
white-space: pre;
&:focus {
box-shadow: none;
}
Expand All @@ -45,3 +47,10 @@
cursor: unset;
}
}
.contenttext-disabled {
border: 1px solid #d9d9d9;
overflow-y: scroll;
color: rgba(0, 0, 0, 0.85);
background-color: #f8f9fb;
cursor: unset;
}

0 comments on commit feb67c7

Please sign in to comment.