show profile expire

This commit is contained in:
pompurin404 2024-08-22 13:09:35 +08:00
parent 552fa3757d
commit 0252ad58e2
No known key found for this signature in database
3 changed files with 4 additions and 10 deletions

View File

@ -12,7 +12,6 @@ import {
} from '@nextui-org/react'
import React, { useState } from 'react'
import SettingItem from '../base/base-setting-item'
import dayjs from 'dayjs'
import { useOverrideConfig } from '@renderer/hooks/use-override-config'
import { restartCore } from '@renderer/utils/ipc'
interface Props {
@ -47,13 +46,6 @@ const EditInfoModal: React.FC<Props> = (props) => {
<ModalContent>
<ModalHeader className="flex"></ModalHeader>
<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="名称">
<Input
size="sm"

View File

@ -184,6 +184,7 @@ const ProfileItem: React.FC<Props> = (props) => {
size="sm"
variant="light"
color="default"
title={dayjs(info.updated).fromNow()}
disabled={updating}
onPress={async () => {
setUpdating(true)
@ -227,7 +228,7 @@ const ProfileItem: React.FC<Props> = (props) => {
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
>
<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>
)}
{info.type === 'local' && (

View File

@ -92,6 +92,7 @@ const ProfileCard: React.FC = () => {
<Button
isIconOnly
size="sm"
title={dayjs(info.updated).fromNow()}
disabled={updating}
variant="light"
color="default"
@ -113,7 +114,7 @@ const ProfileCard: React.FC = () => {
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
>
<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>
)}
{info.type === 'local' && (