fix: workspace member's last_active should be last_active_time, but not last_login_time (#4906)

This commit is contained in:
DomKing 2024-06-14 20:49:19 +08:00 committed by GitHub
parent c6b791d070
commit 43c19007e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,7 @@ account_with_role_fields = {
'avatar': fields.String,
'email': fields.String,
'last_login_at': TimestampField,
'last_active_at': TimestampField,
'created_at': TimestampField,
'role': fields.String,
'status': fields.String,

View File

@ -105,7 +105,7 @@ const MembersPage = () => {
<div className='text-xs text-gray-500 leading-[18px]'>{account.email}</div>
</div>
</div>
<div className='shrink-0 flex items-center w-[104px] py-2 text-[13px] text-gray-700'>{dayjs(Number((account.last_login_at || account.created_at)) * 1000).locale(locale === 'zh-Hans' ? 'zh-cn' : 'en').fromNow()}</div>
<div className='shrink-0 flex items-center w-[104px] py-2 text-[13px] text-gray-700'>{dayjs(Number((account.last_active_at || account.created_at)) * 1000).locale(locale === 'zh-Hans' ? 'zh-cn' : 'en').fromNow()}</div>
<div className='shrink-0 w-[96px] flex items-center'>
{
(owner && account.role !== 'owner')

View File

@ -27,6 +27,7 @@ export type UserProfileResponse = {
interface_theme?: string
timezone?: string
last_login_at?: string
last_active_at?: string
last_login_ip?: string
created_at?: string
}
@ -61,7 +62,7 @@ export type TenantInfoResponse = {
trial_end_reason: null | 'trial_exceeded' | 'using_custom'
}
export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'created_at'> & {
export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'last_login_at' | 'created_at'> & {
avatar: string
status: 'pending' | 'active' | 'banned' | 'closed'
role: 'owner' | 'admin' | 'editor' | 'normal'