mirror of https://github.com/halo-dev/halo
feat: add cover for deleted post list in console (#7565)
#### What type of PR is this? /area ui /kind improvement /milestone 2.21.x #### What this PR does / why we need it: Add cover field for deleted post list in console. #### Does this PR introduce a user-facing change? ```release-note None ```pull/7564/head^2
parent
7d560186e8
commit
d5a411eb1f
|
@ -2,6 +2,7 @@
|
|||
import PostContributorList from "@/components/user/PostContributorList.vue";
|
||||
import { formatDatetime, relativeTimeTo } from "@/utils/date";
|
||||
import { usePermission } from "@/utils/permission";
|
||||
import { generateThumbnailUrl } from "@/utils/thumbnail";
|
||||
import type { ListedSinglePage, SinglePage } from "@halo-dev/api-client";
|
||||
import { consoleApiClient, coreApiClient } from "@halo-dev/api-client";
|
||||
import {
|
||||
|
@ -306,6 +307,20 @@ watch(
|
|||
/>
|
||||
</template>
|
||||
<template #start>
|
||||
<VEntityField v-if="singlePage.page.spec.cover">
|
||||
<template #description>
|
||||
<div
|
||||
class="aspect-h-2 rounded-md overflow-hidden aspect-w-3 w-20"
|
||||
>
|
||||
<img
|
||||
class="object-cover w-full h-full"
|
||||
:src="
|
||||
generateThumbnailUrl(singlePage.page.spec.cover, 's')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</VEntityField>
|
||||
<VEntityField :title="singlePage.page.spec.title">
|
||||
<template #description>
|
||||
<VSpace>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import PostContributorList from "@/components/user/PostContributorList.vue";
|
||||
import { formatDatetime, relativeTimeTo } from "@/utils/date";
|
||||
import { usePermission } from "@/utils/permission";
|
||||
import { generateThumbnailUrl } from "@/utils/thumbnail";
|
||||
import type { ListedPost, Post } from "@halo-dev/api-client";
|
||||
import { consoleApiClient, coreApiClient } from "@halo-dev/api-client";
|
||||
import {
|
||||
|
@ -317,6 +318,18 @@ watch(
|
|||
/>
|
||||
</template>
|
||||
<template #start>
|
||||
<VEntityField v-if="post.post.spec.cover">
|
||||
<template #description>
|
||||
<div
|
||||
class="aspect-h-2 rounded-md overflow-hidden aspect-w-3 w-20"
|
||||
>
|
||||
<img
|
||||
class="object-cover w-full h-full"
|
||||
:src="generateThumbnailUrl(post.post.spec.cover, 's')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</VEntityField>
|
||||
<VEntityField :title="post.post.spec.title">
|
||||
<template #description>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
|
|
Loading…
Reference in New Issue