|
@@ -39,6 +39,7 @@ import type { ScanTask, AWSCredential, ErrorLog } from '../types';
|
|
|
import { taskService } from '../services/tasks';
|
|
import { taskService } from '../services/tasks';
|
|
|
import { credentialService } from '../services/credentials';
|
|
import { credentialService } from '../services/credentials';
|
|
|
import { usePagination } from '../hooks/usePagination';
|
|
import { usePagination } from '../hooks/usePagination';
|
|
|
|
|
+import { formatDateTime } from '../utils';
|
|
|
|
|
|
|
|
const { Title, Text } = Typography;
|
|
const { Title, Text } = Typography;
|
|
|
const { Option } = Select;
|
|
const { Option } = Select;
|
|
@@ -298,12 +299,6 @@ export default function Tasks() {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // Format date
|
|
|
|
|
- const formatDate = (dateString?: string): string => {
|
|
|
|
|
- if (!dateString) return '-';
|
|
|
|
|
- return new Date(dateString).toLocaleString();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
// Table columns
|
|
// Table columns
|
|
|
const columns: ColumnsType<ScanTask> = [
|
|
const columns: ColumnsType<ScanTask> = [
|
|
|
{
|
|
{
|
|
@@ -347,7 +342,7 @@ export default function Tasks() {
|
|
|
dataIndex: 'created_at',
|
|
dataIndex: 'created_at',
|
|
|
key: 'created_at',
|
|
key: 'created_at',
|
|
|
width: 180,
|
|
width: 180,
|
|
|
- render: (date: string) => formatDate(date),
|
|
|
|
|
|
|
+ render: (date: string) => formatDateTime(date),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: 'Actions',
|
|
title: 'Actions',
|
|
@@ -647,8 +642,8 @@ export default function Tasks() {
|
|
|
status={selectedTask.status === 'failed' ? 'exception' : selectedTask.status === 'completed' ? 'success' : 'active'}
|
|
status={selectedTask.status === 'failed' ? 'exception' : selectedTask.status === 'completed' ? 'success' : 'active'}
|
|
|
/>
|
|
/>
|
|
|
</Descriptions.Item>
|
|
</Descriptions.Item>
|
|
|
- <Descriptions.Item label="Created At">{formatDate(selectedTask.created_at)}</Descriptions.Item>
|
|
|
|
|
- <Descriptions.Item label="Completed At">{formatDate(selectedTask.completed_at)}</Descriptions.Item>
|
|
|
|
|
|
|
+ <Descriptions.Item label="Created At">{formatDateTime(selectedTask.created_at)}</Descriptions.Item>
|
|
|
|
|
+ <Descriptions.Item label="Completed At">{formatDateTime(selectedTask.completed_at)}</Descriptions.Item>
|
|
|
<Descriptions.Item label="Regions" span={2}>
|
|
<Descriptions.Item label="Regions" span={2}>
|
|
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>
|
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>
|
|
|
{selectedTask.regions?.map((r: string) => <Tag key={r}>{r}</Tag>) || '-'}
|
|
{selectedTask.regions?.map((r: string) => <Tag key={r}>{r}</Tag>) || '-'}
|
|
@@ -719,7 +714,7 @@ export default function Tasks() {
|
|
|
description={
|
|
description={
|
|
|
<Space direction="vertical" size={0}>
|
|
<Space direction="vertical" size={0}>
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}>
|
|
<Text type="secondary" style={{ fontSize: 12 }}>
|
|
|
- {formatDate(log.created_at)}
|
|
|
|
|
|
|
+ {formatDateTime(log.created_at)}
|
|
|
</Text>
|
|
</Text>
|
|
|
{log.details && (
|
|
{log.details && (
|
|
|
<Text type="secondary" style={{ fontSize: 12 }}>
|
|
<Text type="secondary" style={{ fontSize: 12 }}>
|