feat: big major update

This commit is contained in:
2026-02-02 04:00:37 +03:00
parent bbab6fc46a
commit d557664b25
34 changed files with 1801 additions and 665 deletions

View File

@@ -25,7 +25,7 @@ export const SnapshotCreatePage = observer(() => {
Назад
</button>
</div>
<h1 className="text-2xl font-bold">Создание снапшота</h1>
<h1 className="text-2xl font-bold">Создание экспорта медиа</h1>
<div className="flex flex-col gap-10 w-full items-end">
<TextField
className="w-full"
@@ -53,7 +53,7 @@ export const SnapshotCreatePage = observer(() => {
}
if (snapshotStore.snapshotStatus?.Status === "done") {
toast.success("Снапшот успешно создан");
toast.success("Экспорт медиа успешно создан");
runInAction(() => {
snapshotStore.snapshotStatus = null;
@@ -63,7 +63,7 @@ export const SnapshotCreatePage = observer(() => {
}
} catch (error) {
console.error(error);
toast.error("Ошибка при создании снапшота");
toast.error("Ошибка при создании экспорта медиа");
} finally {
setIsLoading(false);
}

View File

@@ -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>
),
}}