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'
|
||||
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"
|
||||
|
||||
@ -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' && (
|
||||
|
||||
@ -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' && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user