feat: big major update
This commit is contained in:
@@ -30,6 +30,14 @@ export const SnapshotListPage = observer(() => {
|
||||
fetchSnapshots();
|
||||
}, [language]);
|
||||
|
||||
const formatCreationTime = (isoString: string | undefined) => {
|
||||
if (!isoString) return "";
|
||||
const [datePart, timePartWithMs] = isoString.split("T");
|
||||
if (!datePart || !timePartWithMs) return isoString;
|
||||
const timePart = timePartWithMs.split(".")[0];
|
||||
return `${datePart} - ${timePart}`;
|
||||
};
|
||||
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "name",
|
||||
@@ -41,7 +49,14 @@ export const SnapshotListPage = observer(() => {
|
||||
headerName: "Родитель",
|
||||
flex: 1,
|
||||
},
|
||||
|
||||
{
|
||||
field: "created_at",
|
||||
headerName: "Дата создания",
|
||||
flex: 1,
|
||||
renderCell: (params: GridRenderCellParams) => {
|
||||
return <div>{params.value ? params.value : "-"}</div>;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "actions",
|
||||
headerName: "Действия",
|
||||
@@ -79,14 +94,15 @@ export const SnapshotListPage = observer(() => {
|
||||
id: snapshot.ID,
|
||||
name: snapshot.Name,
|
||||
parent: snapshots.find((s) => s.ID === snapshot.ParentID)?.Name,
|
||||
created_at: formatCreationTime(snapshot.CreationTime),
|
||||
}));
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ width: "100%" }}>
|
||||
<div className="flex justify-between items-center mb-10">
|
||||
<h1 className="text-2xl ">Снапшоты</h1>
|
||||
<CreateButton label="Создать снапшот" path="/snapshot/create" />
|
||||
<h1 className="text-2xl ">Экспорт Медиа</h1>
|
||||
<CreateButton label="Создать экспорт медиа" path="/snapshot/create" />
|
||||
</div>
|
||||
<DataGrid
|
||||
rows={rows}
|
||||
@@ -99,7 +115,11 @@ export const SnapshotListPage = observer(() => {
|
||||
slots={{
|
||||
noRowsOverlay: () => (
|
||||
<Box sx={{ mt: 5, textAlign: "center", color: "text.secondary" }}>
|
||||
{isLoading ? <CircularProgress size={20} /> : "Нет снапшотов"}
|
||||
{isLoading ? (
|
||||
<CircularProgress size={20} />
|
||||
) : (
|
||||
"Нет экспортов медиа"
|
||||
)}
|
||||
</Box>
|
||||
),
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user