refactor: change the creation time field for comments and replies (#874)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

修改评论和回复的创建时间字段。适配:https://github.com/halo-dev/halo/pull/3341

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3330

#### Special notes for your reviewer:

None

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/888/head
Ryan Wang 2023-02-24 17:50:28 +08:00 committed by GitHub
parent e4b655e561
commit 0eff78787e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 4 deletions

View File

@ -61,6 +61,12 @@ export interface CommentSpec {
* @memberof CommentSpec * @memberof CommentSpec
*/ */
approvedTime?: string approvedTime?: string
/**
*
* @type {string}
* @memberof CommentSpec
*/
creationTime?: string
/** /**
* *
* @type {number} * @type {number}

View File

@ -58,6 +58,12 @@ export interface ReplySpec {
* @memberof ReplySpec * @memberof ReplySpec
*/ */
approvedTime?: string approvedTime?: string
/**
*
* @type {string}
* @memberof ReplySpec
*/
creationTime?: string
/** /**
* *
* @type {number} * @type {number}

View File

@ -369,10 +369,15 @@ const subjectRefResult = computed(() => {
<VStatusDot v-tooltip="``" state="warning" animate /> <VStatusDot v-tooltip="``" state="warning" animate />
</template> </template>
</VEntityField> </VEntityField>
<VEntityField v-if="comment?.comment?.spec.approvedTime"> <VEntityField>
<template #description> <template #description>
<span class="truncate text-xs tabular-nums text-gray-500"> <span class="truncate text-xs tabular-nums text-gray-500">
{{ formatDatetime(comment?.comment?.spec.approvedTime) }} {{
formatDatetime(
comment?.comment.spec.creationTime ||
comment?.comment.metadata.creationTimestamp
)
}}
</span> </span>
</template> </template>
</VEntityField> </VEntityField>

View File

@ -171,10 +171,15 @@ const isHoveredReply = computed(() => {
<VStatusDot v-tooltip="``" state="warning" animate /> <VStatusDot v-tooltip="``" state="warning" animate />
</template> </template>
</VEntityField> </VEntityField>
<VEntityField v-if="reply?.reply?.spec.approvedTime"> <VEntityField>
<template #description> <template #description>
<span class="truncate text-xs tabular-nums text-gray-500"> <span class="truncate text-xs tabular-nums text-gray-500">
{{ formatDatetime(reply?.reply?.spec.approvedTime) }} {{
formatDatetime(
reply?.reply?.spec.creationTime ||
reply?.reply.metadata.creationTimestamp
)
}}
</span> </span>
</template> </template>
</VEntityField> </VEntityField>