report-fetch-request-ui #7
@@ -28,6 +28,7 @@ import {
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
|
||||
import RefreshIcon from "@mui/icons-material/Refresh";
|
||||
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
||||
import {
|
||||
useFetchRequestsList,
|
||||
useCreateFetchRequest,
|
||||
@@ -256,7 +257,7 @@ export default function FetchRequests() {
|
||||
<Table size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>ID</TableCell>
|
||||
<TableCell>Fingerprint</TableCell>
|
||||
<TableCell>Source</TableCell>
|
||||
<TableCell>Account</TableCell>
|
||||
<TableCell>Status</TableCell>
|
||||
@@ -268,7 +269,19 @@ export default function FetchRequests() {
|
||||
{requests.map((req: FetchRequest) => (
|
||||
<TableRow key={req.id}>
|
||||
<TableCell sx={{ fontFamily: "monospace", fontSize: "0.8rem" }}>
|
||||
{req.id.slice(0, 8)}...
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 0.5 }}>
|
||||
{req.fingerprint}
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(req.fingerprint);
|
||||
setSnackbar({ message: "Copied!", severity: "success" });
|
||||
}}
|
||||
sx={{ opacity: 0.5, '&:hover': { opacity: 1 } }}
|
||||
>
|
||||
<ContentCopyIcon sx={{ fontSize: 14 }} />
|
||||
</IconButton>
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{"path" in req.source ? "File" : "Email"}
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import AddCircleIcon from "@mui/icons-material/AddCircle";
|
||||
import RefreshIcon from "@mui/icons-material/Refresh";
|
||||
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
||||
import {
|
||||
useReportSnapshotsList,
|
||||
useCreateSnapshot,
|
||||
@@ -41,7 +42,6 @@ function formatDate(iso: string) {
|
||||
}
|
||||
|
||||
export default function ReportSnapshots() {
|
||||
const [accounts, setAccounts] = React.useState("");
|
||||
const [ignoreSelf, setIgnoreSelf] = React.useState(false);
|
||||
const [startDate, setStartDate] = React.useState("");
|
||||
const [endDate, setEndDate] = React.useState("");
|
||||
@@ -60,7 +60,6 @@ export default function ReportSnapshots() {
|
||||
const handleCreate = async () => {
|
||||
try {
|
||||
const result = await createMutation.mutateAsync({
|
||||
accounts: accounts.trim() ? accounts.split(",").map((s) => s.trim()).filter(Boolean) : null,
|
||||
ignore_self: ignoreSelf || null,
|
||||
start_date: startDate ? new Date(startDate).toISOString() : null,
|
||||
end_date: endDate ? new Date(endDate).toISOString() : null,
|
||||
@@ -81,7 +80,6 @@ export default function ReportSnapshots() {
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
setAccounts("");
|
||||
setIgnoreSelf(false);
|
||||
setStartDate("");
|
||||
setEndDate("");
|
||||
@@ -112,14 +110,6 @@ export default function ReportSnapshots() {
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>
|
||||
<TextField
|
||||
label="Accounts"
|
||||
value={accounts}
|
||||
onChange={(e) => setAccounts(e.target.value)}
|
||||
size="small"
|
||||
helperText="Comma-separated account IDs (leave empty for all)"
|
||||
/>
|
||||
|
||||
<FormControlLabel
|
||||
control={<Switch checked={ignoreSelf} onChange={(e) => setIgnoreSelf(e.target.checked)} />}
|
||||
label="Ignore self-transfers"
|
||||
@@ -215,7 +205,19 @@ export default function ReportSnapshots() {
|
||||
{snapshots.map((snap: ReportSnapshot) => (
|
||||
<TableRow key={snap.id}>
|
||||
<TableCell sx={{ fontFamily: "monospace", fontSize: "0.8rem" }}>
|
||||
{snap.snapshot_id.slice(0, 12)}...
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 0.5 }}>
|
||||
{snap.snapshot_id}
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(snap.snapshot_id);
|
||||
setSnackbar({ message: "Copied!", severity: "success" });
|
||||
}}
|
||||
sx={{ opacity: 0.5, '&:hover': { opacity: 1 } }}
|
||||
>
|
||||
<ContentCopyIcon sx={{ fontSize: 14 }} />
|
||||
</IconButton>
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>{formatDate(snap.created_at)}</TableCell>
|
||||
<TableCell>
|
||||
|
||||
Reference in New Issue
Block a user