feat: добавить workflow управления asset в admin
- добавлены сценарии создания source version и generation jobs\n- добавлены modal формы source version и variants generation\n- обновлена detail panel variants actions и ссылки на public URL
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Anchor, Badge, Code, Group, Paper, ScrollArea, Skeleton, Stack, Table, Text, Title } from "@mantine/core"
|
||||
import { Anchor, Badge, Button, Code, Group, Paper, ScrollArea, Skeleton, Stack, Table, Text, Title } from "@mantine/core"
|
||||
|
||||
import { ASSET_STATUS_COLORS, VARIANT_STATUS_COLORS } from "../../config/dashboard.config"
|
||||
import { formatDateTime } from "../../lib/format-date"
|
||||
@@ -12,7 +12,7 @@ import type { AssetDetailPanelProps } from "./types/asset-detail-panel-props.typ
|
||||
* - отображения статусов generated variants
|
||||
*/
|
||||
export const AssetDetailPanel = (props: AssetDetailPanelProps) => {
|
||||
const { overview, publicId } = props
|
||||
const { onCreateVersion, onGenerateVariants, overview, publicId } = props
|
||||
const { asset, variants } = overview
|
||||
|
||||
if (!publicId) {
|
||||
@@ -41,9 +41,17 @@ export const AssetDetailPanel = (props: AssetDetailPanelProps) => {
|
||||
</div>
|
||||
|
||||
{asset ? (
|
||||
<Badge color={ASSET_STATUS_COLORS[asset.status] ?? "gray"} radius="xl" variant="light">
|
||||
{asset.status}
|
||||
</Badge>
|
||||
<Group gap="xs">
|
||||
<Button onClick={onCreateVersion} radius="xl" size="xs" variant="light">
|
||||
New source version
|
||||
</Button>
|
||||
<Button onClick={onGenerateVariants} radius="xl" size="xs">
|
||||
Generate variants
|
||||
</Button>
|
||||
<Badge color={ASSET_STATUS_COLORS[asset.status] ?? "gray"} radius="xl" variant="light">
|
||||
{asset.status}
|
||||
</Badge>
|
||||
</Group>
|
||||
) : null}
|
||||
</Group>
|
||||
|
||||
@@ -90,7 +98,8 @@ export const AssetDetailPanel = (props: AssetDetailPanelProps) => {
|
||||
<Table.Th>Preset</Table.Th>
|
||||
<Table.Th>Format</Table.Th>
|
||||
<Table.Th>Size</Table.Th>
|
||||
<Table.Th>Status</Table.Th>
|
||||
<Table.Th>Status</Table.Th>
|
||||
<Table.Th>URL</Table.Th>
|
||||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
@@ -108,6 +117,11 @@ export const AssetDetailPanel = (props: AssetDetailPanelProps) => {
|
||||
{variant.status}
|
||||
</Badge>
|
||||
</Table.Td>
|
||||
<Table.Td>
|
||||
<Anchor href={variant.url} target="_blank">
|
||||
open
|
||||
</Anchor>
|
||||
</Table.Td>
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
|
||||
Reference in New Issue
Block a user