diff --git a/ui/console-src/modules/contents/comments/CommentList.vue b/ui/console-src/modules/contents/comments/CommentList.vue
index dffc1c70e..f964ee86a 100644
--- a/ui/console-src/modules/contents/comments/CommentList.vue
+++ b/ui/console-src/modules/contents/comments/CommentList.vue
@@ -1,7 +1,7 @@
+
+
+
+
+
+
+
+
+ {{ $t("core.common.buttons.refresh") }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/console-src/modules/contents/comments/components/SubjectQueryCommentListModal.vue b/ui/console-src/modules/contents/comments/components/SubjectQueryCommentListModal.vue
new file mode 100644
index 000000000..ce31726ef
--- /dev/null
+++ b/ui/console-src/modules/contents/comments/components/SubjectQueryCommentListModal.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+ {{ $t("core.common.buttons.close") }}
+
+
+
+
diff --git a/ui/console-src/modules/contents/comments/composables/use-comments-fetch.ts b/ui/console-src/modules/contents/comments/composables/use-comments-fetch.ts
new file mode 100644
index 000000000..37de4aeb6
--- /dev/null
+++ b/ui/console-src/modules/contents/comments/composables/use-comments-fetch.ts
@@ -0,0 +1,50 @@
+import { consoleApiClient, type ListedCommentList } from "@halo-dev/api-client";
+import { useQuery } from "@tanstack/vue-query";
+import type { Ref } from "vue";
+
+export default function useCommentsFetch(
+ queryKey: string,
+ page: Ref,
+ size: Ref,
+ approved: Ref,
+ sort: Ref,
+ user: Ref,
+ keyword: Ref,
+ subjectRefKey?: Ref
+) {
+ return useQuery({
+ queryKey: [queryKey, page, size, approved, sort, user, keyword],
+ queryFn: async () => {
+ const fieldSelectorMap: Record = {
+ "spec.approved": approved.value,
+ "spec.subjectRef": subjectRefKey?.value,
+ };
+
+ const fieldSelector = Object.entries(fieldSelectorMap)
+ .map(([key, value]) => {
+ if (value !== undefined) {
+ return `${key}=${value}`;
+ }
+ })
+ .filter(Boolean) as string[];
+
+ const { data } = await consoleApiClient.content.comment.listComments({
+ fieldSelector,
+ page: page.value,
+ size: size.value,
+ sort: [sort.value].filter(Boolean) as string[],
+ keyword: keyword.value,
+ ownerName: user.value,
+ ownerKind: user.value ? "User" : undefined,
+ });
+
+ return data;
+ },
+ refetchInterval(data) {
+ const hasDeletingData = data?.items.some(
+ (comment) => !!comment.comment.metadata.deletionTimestamp
+ );
+ return hasDeletingData ? 1000 : false;
+ },
+ });
+}
diff --git a/ui/console-src/modules/contents/comments/module.ts b/ui/console-src/modules/contents/comments/module.ts
index 040d66bdd..27b046217 100644
--- a/ui/console-src/modules/contents/comments/module.ts
+++ b/ui/console-src/modules/contents/comments/module.ts
@@ -3,8 +3,14 @@ import { IconMessage } from "@halo-dev/components";
import { definePlugin } from "@halo-dev/console-shared";
import { markRaw } from "vue";
import CommentList from "./CommentList.vue";
+import SubjectQueryCommentList from "./components/SubjectQueryCommentList.vue";
+import SubjectQueryCommentListModal from "./components/SubjectQueryCommentListModal.vue";
export default definePlugin({
+ components: {
+ SubjectQueryCommentList,
+ SubjectQueryCommentListModal,
+ },
routes: [
{
path: "/comments",
diff --git a/ui/console-src/modules/contents/pages/components/entity-fields/TitleField.vue b/ui/console-src/modules/contents/pages/components/entity-fields/TitleField.vue
index 534f0107a..bc006e348 100644
--- a/ui/console-src/modules/contents/pages/components/entity-fields/TitleField.vue
+++ b/ui/console-src/modules/contents/pages/components/entity-fields/TitleField.vue
@@ -1,5 +1,6 @@
@@ -66,15 +94,20 @@ const externalUrl = computed(() => {
})
}}
-
- {{
- $t("core.page.list.fields.comments", {
- comments: singlePage.stats.totalComment || 0,
- })
- }}
+
+ {{ commentText }}
+
+
diff --git a/ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue b/ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue
index 90d3a1ac4..1599db6cc 100644
--- a/ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue
+++ b/ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue
@@ -1,5 +1,6 @@
@@ -83,12 +111,11 @@ const externalUrl = computed(() => {
})
}}
-
- {{
- $t("core.post.list.fields.comments", {
- comments: post.stats.totalComment || 0,
- })
- }}
+
+ {{ commentText }}
{{ $t("core.post.list.fields.pinned") }}
@@ -103,6 +130,12 @@ const externalUrl = computed(() => {
>
+
+
diff --git a/ui/console-src/modules/dashboard/widgets/presets/posts/components/PostListItem.vue b/ui/console-src/modules/dashboard/widgets/presets/posts/components/PostListItem.vue
index 94d2bd3f2..9d8bb25ff 100644
--- a/ui/console-src/modules/dashboard/widgets/presets/posts/components/PostListItem.vue
+++ b/ui/console-src/modules/dashboard/widgets/presets/posts/components/PostListItem.vue
@@ -1,6 +1,7 @@
@@ -54,14 +85,18 @@ const datetime = computed(() => {
})
}}
-
- {{
- $t("core.dashboard.widgets.presets.recent_published.comments", {
- comments: post.stats.totalComment || 0,
- })
- }}
+
+ {{ commentText }}
+
diff --git a/ui/src/locales/_missing_translations_es.yaml b/ui/src/locales/_missing_translations_es.yaml
index 28e0231eb..1d5a2d2f6 100644
--- a/ui/src/locales/_missing_translations_es.yaml
+++ b/ui/src/locales/_missing_translations_es.yaml
@@ -33,6 +33,7 @@ core:
recent_published:
empty:
title: No published posts
+ comments-with-pending: " ({count} pending comments)"
notification:
title: Notifications
empty:
@@ -116,6 +117,7 @@ core:
fields:
schedule_publish:
tooltip: Schedule publish
+ comments-with-pending: ({count} pending comments)
settings:
fields:
publish_time:
@@ -175,6 +177,10 @@ core:
fields:
prevent_parent_post_cascade_query: Prevent parent category from including this category and its subcategories in cascade post queries
hide_from_list: This category is hidden, This category and its subcategories, as well as its posts, will not be displayed in the front-end list. You need to actively visit the category archive page
+ page:
+ list:
+ fields:
+ comments-with-pending: " ({count} pending comments)"
page_editor:
actions:
snapshots: Snapshots
@@ -375,10 +381,16 @@ core:
operations:
enable:
title: Enable
- description: Are you sure you want to enable this user?
+ description: Are you sure you want to enable this user? Once enabled, the user will be able to log back into the system.
+ enable_in_batch:
+ title: Enable
+ description: Are you sure you want to enable the selected users? Once enabled, these users will be able to log back into the system.
disable:
title: Disable
- description: Are you sure you want to disable this user? This user will not be able to log in after being disabled
+ description: Are you sure you want to disable this user? Once disabled, the user will no longer be able to log in.
+ disable_in_batch:
+ title: Disable
+ description: Are you sure you want to disable the selected users? Once disabled, these users will no longer be able to log in.
grant_permission_modal:
roles_preview:
all: The currently selected role contains all permissions
diff --git a/ui/src/locales/en.yaml b/ui/src/locales/en.yaml
index 2b770e550..86ab93523 100644
--- a/ui/src/locales/en.yaml
+++ b/ui/src/locales/en.yaml
@@ -73,6 +73,7 @@ core:
comments: "{comments} Comments"
empty:
title: No published posts
+ comments-with-pending: " ({count} pending comments)"
notification:
title: Notifications
empty:
@@ -238,6 +239,7 @@ core:
pinned: Pinned
schedule_publish:
tooltip: Schedule publish
+ comments-with-pending: " ({count} pending comments)"
settings:
title: Settings
groups:
@@ -404,7 +406,10 @@ core:
help: Theme adaptation is required to support
description:
label: Description
- help: "The description will be automatically added to the page's meta description tag for SEO; other display purposes require theme adaptation"
+ help: >-
+ The description will be automatically added to the page's meta
+ description tag for SEO; other display purposes require theme
+ adaptation
prevent_parent_post_cascade_query:
label: Prevent Parent Post Cascade Query
help: >-
@@ -473,6 +478,7 @@ core:
fields:
visits: "{visits} Visits"
comments: "{comments} Comments"
+ comments-with-pending: " ({count} pending comments)"
settings:
title: Settings
groups:
@@ -1143,19 +1149,23 @@ core:
enable:
title: Enable
description: >-
- Are you sure you want to enable this user? Once enabled, the user will be able to log back into the system.
+ Are you sure you want to enable this user? Once enabled, the user will
+ be able to log back into the system.
enable_in_batch:
title: Enable
description: >-
- Are you sure you want to enable the selected users? Once enabled, these users will be able to log back into the system.
+ Are you sure you want to enable the selected users? Once enabled,
+ these users will be able to log back into the system.
disable:
title: Disable
description: >-
- Are you sure you want to disable this user? Once disabled, the user will no longer be able to log in.
+ Are you sure you want to disable this user? Once disabled, the user
+ will no longer be able to log in.
disable_in_batch:
title: Disable
description: >-
- Are you sure you want to disable the selected users? Once disabled, these users will no longer be able to log in.
+ Are you sure you want to disable the selected users? Once disabled,
+ these users will no longer be able to log in.
filters:
role:
label: Role
diff --git a/ui/src/locales/zh-CN.yaml b/ui/src/locales/zh-CN.yaml
index 3e7ace9e7..a73745b89 100644
--- a/ui/src/locales/zh-CN.yaml
+++ b/ui/src/locales/zh-CN.yaml
@@ -67,6 +67,7 @@ core:
comments: 评论 {comments}
empty:
title: 暂无已发布文章
+ comments-with-pending: " ({count} 条待审核)"
notification:
title: 通知
empty:
@@ -224,6 +225,7 @@ core:
pinned: 已置顶
schedule_publish:
tooltip: 定时发布
+ comments-with-pending: ({count} 条待审核)
settings:
title: 文章设置
groups:
@@ -451,6 +453,7 @@ core:
fields:
visits: 访问量 {visits}
comments: 评论 {comments}
+ comments-with-pending: ({count} 条待审核)
settings:
title: 页面设置
groups:
diff --git a/ui/src/locales/zh-TW.yaml b/ui/src/locales/zh-TW.yaml
index 22ba707d0..bbc24dffb 100644
--- a/ui/src/locales/zh-TW.yaml
+++ b/ui/src/locales/zh-TW.yaml
@@ -67,6 +67,7 @@ core:
comments: 留言 {comments}
empty:
title: 沒有已發布文章
+ comments-with-pending: " ({count} 條待審核)"
notification:
title: 通知
empty:
@@ -224,6 +225,7 @@ core:
pinned: 已置頂
schedule_publish:
tooltip: 定時發佈
+ comments-with-pending: ({count} 條待審核)
settings:
title: 文章設置
groups:
@@ -436,6 +438,7 @@ core:
fields:
visits: 訪問量 {visits}
comments: 留言 {comments}
+ comments-with-pending: " ({count} 條待審核)"
settings:
title: 頁面設置
groups: