visual fixes

This commit is contained in:
Alireza Ahmadi
2025-01-05 21:53:16 +01:00
parent 5dd0baad34
commit b2195b72b9
10 changed files with 38 additions and 39 deletions
+4 -4
View File
@@ -144,10 +144,10 @@ export const HumanReadable = {
const remain = Math.floor((second/3600) - (day*24))
return day + i18n.global.t('date.d') + (remain > 0 ? ' ' + remain + i18n.global.t('date.h') : '')
},
remainedDays(exp:number): number|null {
if (exp == 0) return -1
remainedDays(exp:number): string {
if (exp == 0) return i18n.global.t('unlimited')
const now = Date.now()/1000
if (exp < now) return null
return Math.floor((exp - now) / (3600*24))
if (exp < now) return i18n.global.t('date.expired')
return Math.floor((exp - now) / (3600*24)) + " " + i18n.global.t('date.d')
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import { oTls } from "./outTls"
import { oTls } from "./tls"
import { oMultiplex } from "./multiplex"
import { Transport } from "./transport"
+3 -3
View File
@@ -27,19 +27,19 @@
<v-card-text>
<v-row>
<v-col>{{ $t('admin.date') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.loginDate }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('admin.time') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.loginTime }}
</v-col>
</v-row>
<v-row>
<v-col>IP</v-col>
<v-col dir="ltr">
<v-col>
{{ item.ip }}
</v-col>
</v-row>
+8 -8
View File
@@ -158,7 +158,7 @@
<v-card-text>
<v-row>
<v-col>{{ $t('pages.inbounds') }}</v-col>
<v-col dir="ltr">
<v-col>
<v-tooltip activator="parent" dir="ltr" location="bottom" v-if="item.inbounds != ''">
<span v-for="i in item.inbounds">{{ inbounds.find(inb => inb.id == i)?.tag }}<br /></span>
</v-tooltip>
@@ -167,19 +167,19 @@
</v-row>
<v-row>
<v-col>{{ $t('stats.volume') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.volume == 0 ? $t('unlimited') : HumanReadable.sizeFormat(item.volume) }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('date.expiry') }}</v-col>
<v-col dir="ltr">
{{ item.expiry == 0 ? $t('unlimited') : HumanReadable.remainedDays(item.expiry)?? $t('date.expired') }}
<v-col>
{{ HumanReadable.remainedDays(item.expiry) }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('stats.usage') }}</v-col>
<v-col dir="ltr">
<v-col>
<v-tooltip activator="parent" location="bottom">
{{ $t('stats.upload') }}:{{ HumanReadable.sizeFormat(item.up) }}<br />
{{ $t('stats.download') }}:{{ HumanReadable.sizeFormat(item.down) }}<br />
@@ -192,7 +192,7 @@
</v-row>
<v-row>
<v-col>{{ $t('online') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="isOnline(item.name).value">
<v-chip density="comfortable" size="small" color="success" variant="flat">{{ $t('online') }}</v-chip>
</template>
@@ -275,7 +275,7 @@
<v-chip
size="small"
label
>{{ item.expiry == 0 ? $t('unlimited') : HumanReadable.remainedDays(item.expiry)?? $t('date.expired') }}</v-chip>
>{{ HumanReadable.remainedDays(item.expiry) }}</v-chip>
</div>
</template>
<template v-slot:item.online="{ item }">
@@ -502,7 +502,7 @@ const doFilter = () => {
filteredClients = filteredClients.filter(c => c.enable == false)
break
case "expired":
filteredClients = filteredClients.filter(c => HumanReadable.remainedDays(c.expiry) == null)
filteredClients = filteredClients.filter(c => c.expiry > 0 && c.expiry < (Date.now()/1000) )
break
case "online":
filteredClients = filteredClients.filter(c => Data().onlines?.user?.includes(c.name))
+4 -4
View File
@@ -31,25 +31,25 @@
<v-card-text>
<v-row>
<v-col>{{ $t('in.addr') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.address?.length>0 ? item.address[0] : '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('in.port') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.listen_port?? '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('types.wg.peers') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.peers.length?? '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('online') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="onlines.includes(item.tag)">
<v-chip density="comfortable" size="small" color="success" variant="flat">{{ $t('online') }}</v-chip>
</template>
+5 -5
View File
@@ -32,25 +32,25 @@
<v-card-text>
<v-row>
<v-col>{{ $t('in.addr') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.listen }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('in.port') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.listen_port }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('objects.tls') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.tls_id > 0 ? $t('enable') : $t('disable') }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('pages.clients') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="inboundWithUsers.includes(item.type)">
<v-tooltip activator="parent" dir="ltr" location="bottom" v-if="findInboundUsers(item).length > 0">
<span v-for="u in findInboundUsers(item)">{{ u }}<br /></span>
@@ -62,7 +62,7 @@
</v-row>
<v-row>
<v-col>{{ $t('online') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="onlines.includes(item.tag)">
<v-chip density="comfortable" size="small" color="success" variant="flat">{{ $t('online') }}</v-chip>
</template>
+4 -4
View File
@@ -31,25 +31,25 @@
<v-card-text>
<v-row>
<v-col>{{ $t('in.addr') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.server?? '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('in.port') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.server_port?? '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('objects.tls') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ Object.hasOwn(item,'tls') ? $t(item.tls?.enabled ? 'enable' : 'disable') : '-' }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('online') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="onlines.includes(item.tag)">
<v-chip density="comfortable" size="small" color="success" variant="flat">{{ $t('online') }}</v-chip>
</template>
+5 -5
View File
@@ -41,13 +41,13 @@
<v-card-text>
<v-row>
<v-col>{{ $t('ruleset.format') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.format }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('actions.update') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.update_interval?? '-' }}
</v-col>
</v-row>
@@ -98,19 +98,19 @@
<v-card-text>
<v-row>
<v-col>{{ $t('objects.outbound') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.outbound }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('pages.rules') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ item.rules ? item.rules.length : Object.keys(item).filter(r => !["rule_set_ipcidr_match_source","invert","outbound"].includes(r)).length }}
</v-col>
</v-row>
<v-row>
<v-col>{{ $t('rule.invert') }}</v-col>
<v-col dir="ltr">
<v-col>
{{ $t( (item.invert?? false)? 'yes' : 'no') }}
</v-col>
</v-row>
+4 -4
View File
@@ -21,7 +21,7 @@
<v-card-text>
<v-row>
<v-col>{{ $t('pages.inbounds') }}</v-col>
<v-col dir="ltr">
<v-col>
<template v-if="tlsInbounds(item.id).length>0">
<v-tooltip activator="parent" dir="ltr" location="bottom">
<span v-for="i in tlsInbounds(item.id)">{{ i }}<br /></span>
@@ -33,19 +33,19 @@
</v-row>
<v-row>
<v-col>ACME</v-col>
<v-col dir="ltr">
<v-col>
{{ $t(item.server?.acme == undefined ? 'no' : 'yes') }}
</v-col>
</v-row>
<v-row>
<v-col>ECH</v-col>
<v-col dir="ltr">
<v-col>
{{ $t(item.server?.ech == undefined ? 'no' : 'yes') }}
</v-col>
</v-row>
<v-row>
<v-col>Reality</v-col>
<v-col dir="ltr">
<v-col>
{{ $t(item.server?.reality == undefined ? 'no' : 'yes') }}
</v-col>
</v-row>