diff --git a/public/locales/zh/dashboard.json b/public/locales/zh/dashboard.json index 437735fb..fcfa4357 100644 --- a/public/locales/zh/dashboard.json +++ b/public/locales/zh/dashboard.json @@ -8,11 +8,11 @@ "Events": "活动", "New Events": "新活动", "Site Stats": "站点统计", - "Total Posts": "文章总数", - "Total Comments": "评论总数", - "Total Followers": "关注者总数", - "Total Views": "浏览总数", - "Total Tip": "打赏总额", + "Published posts": "发布的文章", + "Received comments": "收到的评论", + "Followers": "关注者", + "Viewed": "浏览量", + "Received tips": "收到的打赏", "Site Duration": "站点运行时间", "days": "天", "Deleted!": "已删除!", diff --git a/src/models/site.model.ts b/src/models/site.model.ts index bba9a17e..f45f9bd6 100644 --- a/src/models/site.model.ts +++ b/src/models/site.model.ts @@ -539,6 +539,7 @@ export async function getStat({ characterId }: { characterId: string }) { return { viewsCount: stat.viewNoteCount, createdAt: site?.createdAt, + createTx: site?.transactionHash, subscriptionCount: subscriptions?.count, commentsCount: comments?.count, notesCount: notes?.count, diff --git a/src/pages/dashboard/[subdomain]/index.tsx b/src/pages/dashboard/[subdomain]/index.tsx index 6644f12e..97ca3acc 100644 --- a/src/pages/dashboard/[subdomain]/index.tsx +++ b/src/pages/dashboard/[subdomain]/index.tsx @@ -10,7 +10,7 @@ import { DashboardMain } from "~/components/dashboard/DashboardMain" import { Image } from "~/components/ui/Image" import { UniLink } from "~/components/ui/UniLink" import { useDate } from "~/hooks/useDate" -import { DISCORD_LINK, GITHUB_LINK, TWITTER_LINK } from "~/lib/env" +import { CSB_SCAN, DISCORD_LINK, GITHUB_LINK, TWITTER_LINK } from "~/lib/env" import { getSiteLink } from "~/lib/helpers" import { serverSidePropsHandler } from "~/lib/server-side-props" import { cn } from "~/lib/utils" @@ -52,23 +52,41 @@ export default function SubdomainIndex() { const statMap = [ { icon: "i-mingcute:news-line", - name: "Total Posts", + name: "Published posts", value: stat.data?.notesCount, + url: `/dashboard/${subdomain}/posts`, }, { icon: "i-mingcute:comment-line", - name: "Total Comments", + name: "Received comments", value: stat.data?.commentsCount, + url: `/dashboard/${subdomain}/comments`, + }, + { + icon: "i-mingcute:heart-line", + name: "Received tips", + value: `${ + tips.data?.pages?.[0]?.list + ?.map((i) => +i.amount) + .reduce((acr, cur) => acr + cur) || 0 + } MIRA`, + url: `/dashboard/${subdomain}/tokens`, }, { icon: "i-mingcute:user-follow-line", - name: "Total Followers", + name: "Followers", value: stat.data?.subscriptionCount, + url: getSiteLink({ + subdomain, + }), }, { icon: "i-mingcute:eye-line", - name: "Total Views", + name: "Viewed", value: stat.data?.viewsCount, + url: getSiteLink({ + subdomain, + }), }, { icon: "i-mingcute:history-line", @@ -77,14 +95,7 @@ export default function SubdomainIndex() { date.dayjs().diff(date.dayjs(stat.data?.createdAt), "day") + " " + t("days"), - }, - { - icon: "i-mingcute:heart-line", - name: "Total Tip", - value: - tips.data?.pages?.[0]?.list - ?.map((i) => +i.amount) - .reduce((acr, cur) => acr + cur) || 0, + url: `${CSB_SCAN}/tx/${stat.data?.createTx}`, }, ] @@ -102,7 +113,8 @@ export default function SubdomainIndex() {