mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-26 07:24:10 +08:00
fix(proxy): wrap subscription info usage percentage with toFinite
This commit is contained in:
parent
5402fdb9cb
commit
ed947f62a2
@ -1,5 +1,6 @@
|
||||
import byteSize from 'byte-size'
|
||||
import dayjs from 'dayjs'
|
||||
import { toFinite } from 'lodash'
|
||||
import type { SubscriptionInfo as ISubscriptionInfo } from '~/types'
|
||||
|
||||
const getSubscriptionsInfo = (subscriptionInfo: ISubscriptionInfo) => {
|
||||
@ -9,10 +10,10 @@ const getSubscriptionsInfo = (subscriptionInfo: ISubscriptionInfo) => {
|
||||
const used = byteSize(Download + Upload, {
|
||||
units: 'iec',
|
||||
})
|
||||
const percentage = (((Download + Upload) / Total) * 100).toFixed(2)
|
||||
const percentage = toFinite((((Download + Upload) / Total) * 100).toFixed(2))
|
||||
|
||||
const expireStr = () => {
|
||||
if (subscriptionInfo.Expire === 0) {
|
||||
if (Expire === 0) {
|
||||
return 'Null'
|
||||
}
|
||||
|
||||
|
@ -422,6 +422,7 @@ export default () => {
|
||||
{(cell) => {
|
||||
return (
|
||||
<td
|
||||
class="py-2"
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault()
|
||||
|
||||
|
@ -204,10 +204,10 @@ export default () => {
|
||||
<tbody>
|
||||
<For each={table.getRowModel().rows}>
|
||||
{(row) => (
|
||||
<tr class="hover">
|
||||
<tr class="hover:!bg-primary hover:text-primary-content">
|
||||
<For each={row.getVisibleCells()}>
|
||||
{(cell) => (
|
||||
<td>
|
||||
<td class="py-2">
|
||||
{flexRender(
|
||||
cell.column.columnDef.cell,
|
||||
cell.getContext(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user