mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
show profile expire
This commit is contained in:
parent
552fa3757d
commit
0252ad58e2
@ -12,7 +12,6 @@ import {
|
|||||||
} from '@nextui-org/react'
|
} from '@nextui-org/react'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import SettingItem from '../base/base-setting-item'
|
import SettingItem from '../base/base-setting-item'
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import { useOverrideConfig } from '@renderer/hooks/use-override-config'
|
import { useOverrideConfig } from '@renderer/hooks/use-override-config'
|
||||||
import { restartCore } from '@renderer/utils/ipc'
|
import { restartCore } from '@renderer/utils/ipc'
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -47,13 +46,6 @@ const EditInfoModal: React.FC<Props> = (props) => {
|
|||||||
<ModalContent>
|
<ModalContent>
|
||||||
<ModalHeader className="flex">编辑信息</ModalHeader>
|
<ModalHeader className="flex">编辑信息</ModalHeader>
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
{values.type === 'remote' && item.extra?.expire && (
|
|
||||||
<SettingItem title="订阅到期时间">
|
|
||||||
<div className="h-[32px] leading-[32px]">
|
|
||||||
{dayjs.unix(item.extra.expire).format('YYYY-MM-DD')}
|
|
||||||
</div>
|
|
||||||
</SettingItem>
|
|
||||||
)}
|
|
||||||
<SettingItem title="名称">
|
<SettingItem title="名称">
|
||||||
<Input
|
<Input
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
@ -184,6 +184,7 @@ const ProfileItem: React.FC<Props> = (props) => {
|
|||||||
size="sm"
|
size="sm"
|
||||||
variant="light"
|
variant="light"
|
||||||
color="default"
|
color="default"
|
||||||
|
title={dayjs(info.updated).fromNow()}
|
||||||
disabled={updating}
|
disabled={updating}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
setUpdating(true)
|
setUpdating(true)
|
||||||
@ -227,7 +228,7 @@ const ProfileItem: React.FC<Props> = (props) => {
|
|||||||
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
|
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
|
||||||
>
|
>
|
||||||
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
||||||
<small>{dayjs(info.updated).fromNow()}</small>
|
<small>{extra ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}</small>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{info.type === 'local' && (
|
{info.type === 'local' && (
|
||||||
|
|||||||
@ -92,6 +92,7 @@ const ProfileCard: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
isIconOnly
|
isIconOnly
|
||||||
size="sm"
|
size="sm"
|
||||||
|
title={dayjs(info.updated).fromNow()}
|
||||||
disabled={updating}
|
disabled={updating}
|
||||||
variant="light"
|
variant="light"
|
||||||
color="default"
|
color="default"
|
||||||
@ -113,7 +114,7 @@ const ProfileCard: React.FC = () => {
|
|||||||
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
|
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
|
||||||
>
|
>
|
||||||
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
||||||
<small>{dayjs(info.updated).fromNow()}</small>
|
<small>{extra ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}</small>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{info.type === 'local' && (
|
{info.type === 'local' && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user