Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(web): show member creation and last login times

tianma-if41cfb4ca29c6
diff --git a/apps/web/src/components/settings/UserManagementCard.tsx b/apps/web/src/components/settings/UserManagementCard.tsx
index 1918ff11..791749e1 100644
--- a/apps/web/src/components/settings/UserManagementCard.tsx
+++ b/apps/web/src/components/settings/UserManagementCard.tsx
@@ -22,8 +22,18 @@ interface UserManagementCardProps {
demoMode: boolean;
}
+const formatMemberTime = (value: string, locale: string) =>
+ new Intl.DateTimeFormat(locale, {
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+ hour: "2-digit",
+ minute: "2-digit",
+ }).format(new Date(value));
+
export const UserManagementCard = ({ demoMode }: UserManagementCardProps) => {
- const { t } = useTranslation();
+ const { t, i18n } = useTranslation();
+ const locale = i18n.resolvedLanguage ?? i18n.language;
const queryClient = useQueryClient();
const [createOpen, setCreateOpen] = useState(false);
const [resetUser, setResetUser] = useState<InstanceUser | null>(null);
@@ -103,6 +113,12 @@ export const UserManagementCard = ({ demoMode }: UserManagementCardProps) => {
<div className="min-w-0">
<p className={cn("truncate", SETTINGS_ITEM_TITLE_CLASSNAME)}>{user.displayName || user.username}</p>
<p className="truncate text-xs text-slate-500">@{user.username} · {t(`users.roles.${user.role}`)}</p>
+ <p className="mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-slate-500">
+ <span>{t("users.createdAt", { time: formatMemberTime(user.createdAt, locale) })}</span>
+ <span>{user.lastLoginAt
+ ? t("users.lastLoginAt", { time: formatMemberTime(user.lastLoginAt, locale) })
+ : t("users.noLoginRecord")}</span>
+ </p>
</div>
<div className="flex items-center gap-3">
{demoMode && user.role === "owner" ? null : (
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 70638f1b..72963a39 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -2542,6 +2542,9 @@ export const enUS = {
title: "Members",
description: "Create isolated personal note spaces for family or team members. Public registration stays disabled.",
loading: "Loading accounts...",
+ createdAt: "Created {{time}}",
+ lastLoginAt: "Last signed in {{time}}",
+ noLoginRecord: "No sign-in recorded",
create: "Add member",
creating: "Creating...",
createTitle: "Add new member",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 3f4ea2bb..f79c74f9 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -2542,6 +2542,9 @@ export const ja = {
title: "メンバー",
description: "家族やチーム向けに、分離された個人ノート空間を作成します。公開登録はオフのままです。",
loading: "アカウントを読み込み中...",
+ createdAt: "作成日時:{{time}}",
+ lastLoginAt: "最終ログイン:{{time}}",
+ noLoginRecord: "ログイン記録なし",
create: "メンバーを追加",
creating: "作成中...",
createTitle: "新しいメンバーを追加",
diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.ts
index 497d2cf5..504d06d7 100644
--- a/packages/shared/src/i18n/pl.ts
+++ b/packages/shared/src/i18n/pl.ts
@@ -2542,6 +2542,9 @@ export const pl = {
title: "Członkowie",
description: "Twórz odizolowane, osobiste przestrzenie notatek dla członków rodziny lub zespołu. Publiczna rejestracja pozostaje wyłączona.",
loading: "Wczytywanie kont...",
+ createdAt: "Utworzono: {{time}}",
+ lastLoginAt: "Ostatnie logowanie: {{time}}",
+ noLoginRecord: "Brak zapisanego logowania",
create: "Dodaj członka",
creating: "Tworzenie...",
createTitle: "Dodaj nowego członka",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 5ed84ef2..55694d4d 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -2540,6 +2540,9 @@ export const zhCN = {
title: "成员管理",
description: "为家人或团队成员创建独立的个人笔记空间。实例不开放公开注册。",
loading: "正在加载账号...",
+ createdAt: "创建于 {{time}}",
+ lastLoginAt: "上次登录 {{time}}",
+ noLoginRecord: "暂无登录记录",
create: "添加成员",
creating: "正在创建...",
createTitle: "添加新成员",