Skip to content

Commit

Permalink
feat: display time and detail for operation log item
Browse files Browse the repository at this point in the history
  • Loading branch information
Liang0028 committed Oct 1, 2024
1 parent 67d3446 commit 65abcf8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions src/app/layouts/components/LogSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,26 @@ const LogSidebar: React.FC = () => {
<strong>URL:</strong> {selectedLog.url}
</p>
<p>
<strong>Timestamp:</strong> {new Date(selectedLog.timestamp).toLocaleString()}
</p>
<p>
<strong>Result Code:</strong> {selectedLog.result.ret_code}
<strong>Timestamp:</strong>{' '}
{new Date(selectedLog?.result?.created_at || selectedLog.timestamp).toLocaleString()}
</p>

<p>
<strong>Message:</strong> {selectedLog.result.message}
</p>

{selectedLog.result?.cause && (
<p>
<strong>Cause:</strong> {selectedLog.result.cause}
</p>
)}

{selectedLog.result?.details && (
<p>
<strong>Details:</strong> {selectedLog.result.details}
</p>
)}

<Space
style={{
marginTop: 10,
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils/toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface LogItem {
key: string;
url: string;
timestamp: number;
result: APICALLRC;
result: APICALLRC & { created_at?: number };
read: boolean;
}

Expand Down Expand Up @@ -193,7 +193,7 @@ class ApiLogManager {

const logManager = ApiLogManager.getInstance();

const handleAPICallRes = (callRes?: APICALLRCLIST, url: string) => {
const handleAPICallRes = (callRes: APICALLRCLIST, url: string) => {
if (!callRes || !callRes.length) {
return;
}
Expand Down

0 comments on commit 65abcf8

Please sign in to comment.