Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kne-components/components-admin",
"version": "1.1.24",
"version": "1.1.25",
"description": "用于实现一个后台管理系统的必要组件",
"scripts": {
"init": "husky",
Expand Down Expand Up @@ -89,6 +89,7 @@
"@kne/captcha-button": "^1.0.1",
"@kne/count-down": "^0.2.2",
"@kne/is-empty": "^1.0.1",
"@kne/json-view": "^0.1.0",
"@kne/react-icon": "^0.1.4",
"@kne/react-intl": "^0.1.9",
"@kne/react-org-chart": "^0.1.6",
Expand Down
11 changes: 4 additions & 7 deletions src/components/Task/Actions/ErrorDetail.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { createWithRemoteLoader } from '@kne/remote-loader';
import { Button } from 'antd';
import style from '../style.module.scss';
import withLocale from '../withLocale';
import { useIntl } from '@kne/react-intl';
import JsonView from '@kne/json-view';
import '@kne/json-view/dist/index.css';

const ErrorDetail = createWithRemoteLoader({
modules: ['components-core:Modal@useModal', 'components-core:InfoPage']
Expand All @@ -21,14 +22,10 @@ const ErrorDetail = createWithRemoteLoader({
children: (
<InfoPage>
<InfoPage.Part title={formatMessage({ id: 'InputParams' })}>
<div className={style['error-box']}>
<pre>{JSON.stringify(data.input, null, 2)}</pre>
</div>
<JsonView data={data.input} collapsedFrom={1} />
</InfoPage.Part>
<InfoPage.Part title={formatMessage({ id: 'ErrorInfo' })}>
<div className={style['error-box']}>
<pre>{JSON.stringify(data.error, null, 2)}</pre>
</div>
<JsonView data={data.error} collapsedFrom={1} />
</InfoPage.Part>
</InfoPage>
)
Expand Down
61 changes: 30 additions & 31 deletions src/components/Task/Actions/ResultDetail.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
import { createWithRemoteLoader } from '@kne/remote-loader';
import { Button } from 'antd';
import style from '../style.module.scss';
import withLocale from '../withLocale';
import { useIntl } from '@kne/react-intl';
import JsonView from '@kne/json-view';
import '@kne/json-view/dist/index.css';

const ResultDetail = createWithRemoteLoader({
modules: ['components-core:Modal@useModal', 'components-core:InfoPage']
})(withLocale(({ remoteModules, data, ...props }) => {
const [useModal, InfoPage] = remoteModules;
const { formatMessage } = useIntl();
const modal = useModal();
})(
withLocale(({ remoteModules, data, ...props }) => {
const [useModal, InfoPage] = remoteModules;
const { formatMessage } = useIntl();
const modal = useModal();

return (
<Button
{...props}
onClick={() => {
modal({
title: formatMessage({ id: 'TaskResultTitle' }),
footer: null,
children: (
<InfoPage>
<InfoPage.Part title={formatMessage({ id: 'InputParams' })}>
<div className={style['error-box']}>
<pre>{JSON.stringify(data.input, null, 2)}</pre>
</div>
</InfoPage.Part>
<InfoPage.Part title={formatMessage({ id: 'OutputResult' })}>
<div className={style['error-box']}>
<pre>{JSON.stringify(data.output, null, 2)}</pre>
</div>
</InfoPage.Part>
</InfoPage>
)
});
}}
/>
);
}));
return (
<Button
{...props}
onClick={() => {
modal({
title: formatMessage({ id: 'TaskResultTitle' }),
footer: null,
children: (
<InfoPage>
<InfoPage.Part title={formatMessage({ id: 'InputParams' })}>
<JsonView data={data.input} collapsedFrom={1} />
</InfoPage.Part>
<InfoPage.Part title={formatMessage({ id: 'OutputResult' })}>
<JsonView data={data.output} collapsedFrom={1} />
</InfoPage.Part>
</InfoPage>
)
});
}}
/>
);
})
);

export default ResultDetail;
8 changes: 3 additions & 5 deletions src/components/Task/Actions/ViewLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Button } from 'antd';
import style from '../style.module.scss';
import withLocale from '../withLocale';
import { useIntl } from '@kne/react-intl';
import JsonView from '@kne/json-view';
import '@kne/json-view/dist/index.css';

const ViewLogs = createWithRemoteLoader({
modules: ['components-core:Modal@useModal', 'components-core:InfoPage@Flow']
Expand Down Expand Up @@ -30,11 +32,7 @@ const ViewLogs = createWithRemoteLoader({
type: 'content',
render: data => {
if (!data) return null;
return (
<div className={style['error-box']}>
<pre>{typeof data === 'string' ? data : JSON.stringify(data, null, 2)}</pre>
</div>
);
return <JsonView data={data} collapsedFrom={1} />;
}
}
];
Expand Down
Loading