mirror of
https://github.com/harness/drone.git
synced 2025-05-19 10:29:55 +08:00
fix: [code-2061]: add last used field (#2167)
* fix: [code-2061]: fix lint * fix: [code-2061]: fix comment * fix: [code-2061]: add last used field
This commit is contained in:
parent
21897dc090
commit
21fe66b47f
@ -1024,6 +1024,7 @@ export interface StringsMap {
|
|||||||
'sshCard.beginsWithContent': string
|
'sshCard.beginsWithContent': string
|
||||||
'sshCard.deleteSshMsg': string
|
'sshCard.deleteSshMsg': string
|
||||||
'sshCard.deleteSshTitle': string
|
'sshCard.deleteSshTitle': string
|
||||||
|
'sshCard.lastUsed': string
|
||||||
'sshCard.mySshKeys': string
|
'sshCard.mySshKeys': string
|
||||||
'sshCard.newSshKey': string
|
'sshCard.newSshKey': string
|
||||||
'sshCard.noSshKeyText': string
|
'sshCard.noSshKeyText': string
|
||||||
|
@ -1252,3 +1252,4 @@ sshCard:
|
|||||||
addedOn: Added On
|
addedOn: Added On
|
||||||
personalAccessToken: Personal Access Token
|
personalAccessToken: Personal Access Token
|
||||||
noTokensText: There are no personal access tokens associated with this account
|
noTokensText: There are no personal access tokens associated with this account
|
||||||
|
lastUsed: Last Used
|
||||||
|
@ -35,7 +35,7 @@ import { useGet, useMutate } from 'restful-react'
|
|||||||
import type { CellProps, Column } from 'react-table'
|
import type { CellProps, Column } from 'react-table'
|
||||||
import ReactTimeago from 'react-timeago'
|
import ReactTimeago from 'react-timeago'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { isEmpty } from 'lodash-es'
|
import { defaultTo, isEmpty } from 'lodash-es'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { TypesToken, TypesUser, useGetUser, useOpLogout, useUpdateUser } from 'services/code'
|
import { TypesToken, TypesUser, useGetUser, useOpLogout, useUpdateUser } from 'services/code'
|
||||||
import { ButtonRoleProps, TypeKeys, getErrorMessage } from 'utils/Utils'
|
import { ButtonRoleProps, TypeKeys, getErrorMessage } from 'utils/Utils'
|
||||||
@ -44,6 +44,7 @@ import { useAppContext } from 'AppContext'
|
|||||||
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
import { currentUserAtom } from 'atoms/currentUser'
|
import { currentUserAtom } from 'atoms/currentUser'
|
||||||
|
import { TimePopoverWithLocal } from 'utils/timePopoverLocal/TimePopoverWithLocal'
|
||||||
import useNewToken from './NewToken/NewToken'
|
import useNewToken from './NewToken/NewToken'
|
||||||
import EditableTextField from './EditableTextField'
|
import EditableTextField from './EditableTextField'
|
||||||
import SshKey from '../../icons/sshKey.svg?url'
|
import SshKey from '../../icons/sshKey.svg?url'
|
||||||
@ -141,10 +142,19 @@ const UserProfile = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: getString('sshCard.addedOn'),
|
Header: getString('sshCard.addedOn'),
|
||||||
width: '30%',
|
width: '15%',
|
||||||
Cell: ({ row }: CellProps<TypeKeys>) => (
|
Cell: ({ row }: CellProps<TypeKeys>) => (
|
||||||
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
|
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
|
||||||
<ReactTimeago date={row.original.created || ''} />
|
<TimePopoverWithLocal time={defaultTo(row.original?.created, 0)} />
|
||||||
|
</Text>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Header: getString('sshCard.lastUsed'),
|
||||||
|
width: '15%',
|
||||||
|
Cell: ({ row }: CellProps<TypeKeys>) => (
|
||||||
|
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
|
||||||
|
<TimePopoverWithLocal time={defaultTo(row.original?.verified, 0)} />
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user