|
|
|
@ -5,6 +5,7 @@ import { computed, inject } from "vue";
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
import type { User } from "@halo-dev/api-client";
|
|
|
|
|
import { rbacAnnotations } from "@/constants/annotations";
|
|
|
|
|
import { formatDatetime } from "@/utils/date";
|
|
|
|
|
|
|
|
|
|
const user = inject<Ref<User>>("user");
|
|
|
|
|
|
|
|
|
@ -17,10 +18,10 @@ const roles = computed(() => {
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="border-t border-gray-200">
|
|
|
|
|
<dl class="divide-y divide-gray-100">
|
|
|
|
|
<div class="border-t border-gray-100">
|
|
|
|
|
<dl class="divide-y divide-gray-50">
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">显示名称</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
@ -28,7 +29,7 @@ const router = useRouter();
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">用户名</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
@ -36,7 +37,7 @@ const router = useRouter();
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">电子邮箱</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
@ -44,7 +45,7 @@ const router = useRouter();
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">角色</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
@ -61,31 +62,25 @@ const router = useRouter();
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">描述</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
|
{{ user?.spec?.bio }}
|
|
|
|
|
{{ user?.spec?.bio || "无" }}
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">两步验证</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
|
{{ user?.spec.twoFactorAuthEnabled ? "开启" : "关闭" }}
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">注册时间</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
|
{{ user?.metadata?.creationTimestamp }}
|
|
|
|
|
{{ formatDatetime(user?.metadata?.creationTimestamp) }}
|
|
|
|
|
</dd>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- TODO: add display last login time support -->
|
|
|
|
|
<div
|
|
|
|
|
class="bg-white py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
v-if="false"
|
|
|
|
|
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
|
|
|
|
>
|
|
|
|
|
<dt class="text-sm font-medium text-gray-900">最近登录时间</dt>
|
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
|
|
|
|