From 346c8e38ee62b0f0e8f81ba917b19449f53ee751 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 10 九月 2024 16:35:36 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/operationRecord/OperationDetail.jsx     |   84 ++++++++++++++++++++++++++++++++++++++---
 zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx |    4 +-
 2 files changed, 79 insertions(+), 9 deletions(-)

diff --git a/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx b/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx
index c0b92b1..1515960 100644
--- a/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx
+++ b/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx
@@ -1,14 +1,14 @@
 import * as React from 'react';
 import {
-    EditBase,
     useTranslate,
     TextInput,
     SimpleForm,
     DateField,
     Labeled,
 } from 'react-admin';
-import { Box, Grid, Stack, IconButton, Typography, Card, CardContent, TextField } from '@mui/material';
+import { Box, Grid, Stack, IconButton, Typography, Card, CardContent, TextField, Button } from '@mui/material';
 import CloseIcon from '@mui/icons-material/Close';
+import { format } from 'date-fns';
 
 const OperationDetail = (props) => {
     const { operation, setDrawerVal, ...rest } = props;
@@ -16,11 +16,81 @@
 
     return (
         <>
-            <Card>
-                <CardContent>
-                    <TextField value={JSON.stringify(operation)} maxRows={15} multiline />
-                </CardContent>
-            </Card>
+            <Box width={{ xs: '100vW', sm: 400 }} mt={{ xs: 2, sm: 1 }}>
+                <Card>
+                    <CardContent>
+                        <Grid container rowSpacing={1} mb={1}>
+                            <Grid item xs={6}>
+                                <Labeled label="table.field.operationRecord.namespace">
+                                    <Typography
+                                        variant="body2"
+                                        flexWrap="nowrap"
+                                    >
+                                        {operation.namespace}
+                                    </Typography>
+                                </Labeled>
+                            </Grid>
+                            <Grid item xs={6}>
+                                <Labeled label="table.field.operationRecord.url">
+                                    <Typography
+                                        variant="body2"
+                                        flexWrap="nowrap"
+                                    >
+                                        {operation.url}
+                                    </Typography>
+                                </Labeled>
+                            </Grid>
+                            <Grid item xs={6}>
+                                <Labeled label="table.field.operationRecord.timestamp">
+                                    <Typography
+                                        variant="body2"
+                                        flexWrap="nowrap"
+                                    >
+                                        {format(new Date(Number(operation.timestamp)), 'yyyy-MM-dd HH:mm:ss')}
+                                    </Typography>
+                                </Labeled>
+                            </Grid>
+                            <Grid item xs={6}>
+                                <Labeled label="table.field.operationRecord.userId">
+                                    <Typography
+                                        variant="body2"
+                                        flexWrap="nowrap"
+                                    >
+                                        {operation.userId$}
+                                    </Typography>
+                                </Labeled>
+                            </Grid>
+                            <Grid item sm={12}>
+                                <TextField
+                                    label="Request"
+                                    value={operation.request}
+                                    maxRows={15}
+                                    multiline
+                                />
+                            </Grid>
+                            <Box mt={1} />
+                            <Grid item sm={12}>
+                                <TextField
+                                    label="Response"
+                                    value={operation.response}
+                                    maxRows={15}
+                                    multiline
+                                />
+                            </Grid>
+                            <Grid item xs={6}>
+                                <Labeled label="table.field.operationRecord.clientIp">
+                                    <Typography
+                                        variant="body2"
+                                        flexWrap="nowrap"
+                                    >
+                                        {operation.clientIp}
+                                    </Typography>
+                                </Labeled>
+                            </Grid>
+                        </Grid>
+                    </CardContent>
+                </Card>
+            </Box>
         </>
     )
 }
diff --git a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
index 022adaf..088c916 100644
--- a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
+++ b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
@@ -150,8 +150,8 @@
                     <TextField source="appkey" label="table.field.operationRecord.appkey" />
                     <FormattedTimestampField source="timestamp" label="table.field.operationRecord.timestamp" />
                     <NumberField source="spendTime" label="table.field.operationRecord.spendTime" sx={{ fontWeight: 'bold' }} />
-                    <TextField source="request" label="table.field.operationRecord.request" sortable={false} />
-                    <TextField source="response" label="table.field.operationRecord.response" sortable={false} />
+                    <TextField source="request" label="table.field.operationRecord.request" sortable={false} hidden={!!drawerVal} />
+                    <TextField source="response" label="table.field.operationRecord.response" sortable={false} hidden={!!drawerVal} />
                     <ResultField source="result" label="table.field.operationRecord.result" />
                     <TextField source="err" label="table.field.operationRecord.err" />
                     <TextField source="clientIp" label="table.field.operationRecord.clientIp" />

--
Gitblit v1.9.1