Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-06-21 13:51:34 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-06-21 14:01:09 +0300
commit85fb2fda5eb2b3485ed08944273e84d9da0ce10f (patch)
treecc4b609edbc8f4bf37bc95702da965a07d41ca4c /web
parentf57e6930234bf00c7df0eb5c167f6a4e8a58c7ed (diff)
simplify with show remaining flow
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web')
-rw-r--r--web/html/xui/inbound_client_table.html24
-rw-r--r--web/html/xui/inbound_info_modal.html150
-rw-r--r--web/html/xui/inbounds.html41
-rw-r--r--web/translation/translate.en_US.toml1
-rw-r--r--web/translation/translate.fa_IR.toml1
-rw-r--r--web/translation/translate.ru_RU.toml1
-rw-r--r--web/translation/translate.zh_Hans.toml1
7 files changed, 134 insertions, 85 deletions
diff --git a/web/html/xui/inbound_client_table.html b/web/html/xui/inbound_client_table.html
index bb825437..140d7626 100644
--- a/web/html/xui/inbound_client_table.html
+++ b/web/html/xui/inbound_client_table.html
@@ -29,11 +29,25 @@
<a-tag v-if="!isClientEnabled(record, client.email)" color="red">{{ i18n "depleted" }}</a-tag>
</template>
<template slot="traffic" slot-scope="text, client">
- <a-tag :color="statsColor(record, client.email)">[[ sizeFormat(getUpStats(record, client.email)) ]] / [[ sizeFormat(getDownStats(record, client.email)) ]]</a-tag>
- <template v-if="client._totalGB > 0">
- <a-tag :color="statsColor(record, client.email)">[[client._totalGB]]GB</a-tag>
- </template>
- <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
+ <a-popover :overlay-class-name="themeSwitcher.darkClass">
+ <template slot="content" v-if="client.email">
+ <table cellpadding="2" width="100%">
+ <tr>
+ <td>↑[[ sizeFormat(getUpStats(record, client.email)) ]]</td>
+ <td>↓[[ sizeFormat(getDownStats(record, client.email)) ]]</td>
+ </tr>
+ <tr v-if="client.totalGB > 0">
+ <td>{{ i18n "remained" }}</td>
+ <td>[[ sizeFormat(client.totalGB - getUpStats(record, client.email) - getDownStats(record, client.email)) ]]</td>
+ </tr>
+ </table>
+ </template>
+ <a-tag :color="statsColor(record, client.email)">
+ [[ sizeFormat(getUpStats(record, client.email) + getDownStats(record, client.email)) ]] /
+ <template v-if="client.totalGB > 0">[[client._totalGB]]GB</template>
+ <template v-else>♾</template>
+ </a-tag>
+ </a-popover>
</template>
<template slot="expiryTime" slot-scope="text, client, index">
<template v-if="client.expiryTime > 0">
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html
index d44634a0..00cb5ce6 100644
--- a/web/html/xui/inbound_info_modal.html
+++ b/web/html/xui/inbound_info_modal.html
@@ -8,8 +8,7 @@
width="600px"
>
<table style="margin-bottom: 10px; width: 100%;">
- <tr>
- <td>
+ <tr><td>
<table>
<tr><td>{{ i18n "protocol" }}</td><td><a-tag color="green">[[ dbInbound.protocol ]]</a-tag></td></tr>
<tr><td>{{ i18n "pages.inbounds.address" }}</td><td><a-tag color="blue">[[ dbInbound.address ]]</a-tag></td></tr>
@@ -21,7 +20,6 @@
<tr>
<td>{{ i18n "transmission" }}</td><td><a-tag color="green">[[ inbound.network ]]</a-tag></td>
</tr>
-
<template v-if="inbound.isTcp || inbound.isWs || inbound.isH2">
<tr v-if="inbound.host"><td>{{ i18n "host" }}</td><td><a-tag color="green">[[ inbound.host ]]</a-tag></td></tr>
<tr v-else><td>{{ i18n "host" }}</td><td><a-tag color="orange">{{ i18n "none" }}</a-tag></td></tr>
@@ -46,8 +44,7 @@
<tr><td>grpc multiMode</td><td><a-tag color="green">[[ inbound.stream.grpc.multiMode ]]</a-tag></td></tr>
</template>
</table>
- </td>
- </tr>
+ </td></tr>
<tr colspan="2" v-if="dbInbound.hasLink()">
<td v-if="inbound.tls">
tls: <a-tag color="green">{{ i18n "enabled" }}</a-tag><br />
@@ -66,48 +63,56 @@
</tr>
</table>
<template v-if="infoModal.clientSettings">
- <a-divider>{{ i18n "pages.inbounds.client" }}</a-divider>
- <table style="margin-bottom: 10px;">
- <tr>
- <td>{{ i18n "pages.inbounds.email" }}</td>
- <td><a-tag color="green">[[ infoModal.clientSettings.email ]]</a-tag></td>
- </tr>
- <tr v-if="infoModal.clientSettings.id">
- <td>ID</td>
- <td><a-tag color="green">[[ infoModal.clientSettings.id ]]</a-tag></td>
- </tr>
- <tr v-if="infoModal.inbound.canEnableTlsFlow()">
- <td>Flow</td>
- <td><a-tag color="green">[[ infoModal.clientSettings.flow ]]</a-tag></td>
- </tr>
- <tr v-if="infoModal.clientSettings.password">
- <td>Password</td>
- <td><a-tag color="green">[[ infoModal.clientSettings.password ]]</a-tag></td>
- </tr>
- <tr>
- <td>{{ i18n "status" }}</td>
- <td>
- <a-tag v-if="isEnable" color="blue">{{ i18n "enabled" }}</a-tag>
- <a-tag v-else color="red">{{ i18n "disabled" }}</a-tag>
- <a-tag v-if="!isActive" color="red">{{ i18n "depleted" }}</a-tag>
- </td>
- </tr>
- </table>
- <table style="margin-bottom: 10px; width: 100%;">
+ <a-divider>{{ i18n "pages.inbounds.client" }}</a-divider>
+ <table style="margin-bottom: 10px;">
+ <tr>
+ <td>{{ i18n "pages.inbounds.email" }}</td>
+ <td><a-tag color="green">[[ infoModal.clientSettings.email ]]</a-tag></td>
+ </tr>
+ <tr v-if="infoModal.clientSettings.id">
+ <td>ID</td>
+ <td><a-tag color="green">[[ infoModal.clientSettings.id ]]</a-tag></td>
+ </tr>
+ <tr v-if="infoModal.inbound.canEnableTlsFlow()">
+ <td>Flow</td>
+ <td><a-tag color="green">[[ infoModal.clientSettings.flow ]]</a-tag></td>
+ </tr>
+ <tr v-if="infoModal.clientSettings.password">
+ <td>Password</td>
+ <td><a-tag color="green">[[ infoModal.clientSettings.password ]]</a-tag></td>
+ </tr>
+ <tr>
+ <td>{{ i18n "status" }}</td>
+ <td>
+ <a-tag v-if="isEnable" color="blue">{{ i18n "enabled" }}</a-tag>
+ <a-tag v-else color="red">{{ i18n "disabled" }}</a-tag>
+ <a-tag v-if="!isActive" color="red">{{ i18n "depleted" }}</a-tag>
+ </td>
+ </tr>
+ <tr v-if="infoModal.clientStats">
+ <td>{{ i18n "usage" }}</td>
+ <td>
+ <a-tag color="green">[[ sizeFormat(infoModal.clientStats.up + infoModal.clientStats.down) ]]</a-tag>
+ <a-tag color="blue">↑ [[ sizeFormat(infoModal.clientStats.up) ]] / [[ sizeFormat(infoModal.clientStats.down) ]] ↓</a-tag>
+ </td>
+ </tr>
+ </table>
+ <table style="margin-bottom: 10px; width: 100%;">
<tr>
- <th>{{ i18n "usage" }}</th>
+ <th>{{ i18n "remained" }}</th>
<th>{{ i18n "pages.inbounds.totalFlow" }}</th>
<th>{{ i18n "pages.inbounds.expireDate" }}</th>
+ </tr>
<tr>
<td>
- <a-tag v-if="infoModal.clientStats" color="green">
- [[ sizeFormat(infoModal.clientStats['up']) ]] /
- [[ sizeFormat(infoModal.clientStats['down']) ]]
- ([[ sizeFormat(infoModal.clientStats['up'] + infoModal.clientStats['down']) ]])
+ <a-tag v-if="infoModal.clientStats && infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)">
+ [[ sizeFormat(infoModal.clientSettings.totalGB - infoModal.clientStats.up - infoModal.clientStats.down) ]]
</a-tag>
</td>
<td>
- <a-tag v-if="infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)">[[ sizeFormat(infoModal.clientSettings.totalGB) ]]</a-tag>
+ <a-tag v-if="infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)">
+ [[ sizeFormat(infoModal.clientSettings.totalGB) ]]
+ </a-tag>
<a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag>
</td>
<td>
@@ -123,15 +128,44 @@
</table>
<template v-if="app.subSettings.enable && infoModal.clientSettings.subId">
<a-divider>Subscription link</a-divider>
- <a :href="[[ infoModal.subLink ]]" target="_blank">[[ infoModal.subLink ]]</a>
- <a-icon id="copy-sub-link" type="snippets" @click="copyToClipboard('copy-sub-link', infoModal.subLink)"></a-icon>
+ <a-row>
+ <a-col :span="22"><a :href="[[ infoModal.subLink ]]" target="_blank">[[ infoModal.subLink ]]</a></a-col>
+ <a-col :span="2">
+ <a-tooltip title='{{ i18n "copy" }}'>
+ <button class="ant-btn ant-btn-primary" id="copy-sub-link" @click="copyToClipboard('copy-sub-link', infoModal.subLink)">
+ <a-icon type="snippets"></a-icon>
+ </button>
+ </a-tooltip>
+ </a-col>
+ </a-row>
</template>
<template v-if="app.tgBotEnable && infoModal.clientSettings.tgId">
<a-divider>Telegram Username</a-divider>
- <a :href="[[ infoModal.tgLink ]]" target="_blank">@[[ infoModal.clientSettings.tgId ]]</a>
- <a-icon id="copy-tg-link" type="snippets" @click="copyToClipboard('copy-tg-link', '@' + infoModal.clientSettings.tgId)"></a-icon>
+ <a-row>
+ <a-col :span="22"><a :href="[[ infoModal.tgLink ]]" target="_blank">@[[ infoModal.clientSettings.tgId ]]</a></a-col>
+ <a-col :span="2">
+ <a-tooltip title='{{ i18n "copy" }}'>
+ <button class="ant-btn ant-btn-primary" id="copy-tg-link" @click="copyToClipboard('copy-tg-link', '@' + infoModal.clientSettings.tgId)">
+ <a-icon type="snippets"></a-icon>
+ </button>
+ </a-tooltip>
+ </a-col>
+ </a-row>
</template>
+ <template v-if="dbInbound.hasLink()">
+ <a-divider>URL</a-divider>
+ <a-row v-for="(link,index) in infoModal.links">
+ <a-col :span="22"><a-tag color="cyan">[[ link.remark ]]</a-tag><br />[[ link.link ]]</a-col>
+ <a-col :span="2" style="text-align: right;">
+ <a-tooltip title='{{ i18n "copy" }}'>
+ <button class="ant-btn ant-btn-primary" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)">
+ <a-icon type="snippets"></a-icon>
+ </button>
+ </a-tooltip>
+ </a-col>
+ </a-row>
</template>
+</template>
<template v-else>
<a-divider></a-divider>
<table v-if="inbound.protocol == Protocols.SHADOWSOCKS" style="margin-bottom: 10px; width: 100%;">
@@ -139,8 +173,7 @@
<th>{{ i18n "encryption" }}</th>
<th>{{ i18n "password" }}</th>
<th>{{ i18n "pages.inbounds.network" }}</th>
- </tr>
- <tr>
+ </tr><tr>
<td><a-tag color="green">[[ inbound.settings.method ]]</a-tag></td>
<td><a-tag color="blue">[[ inbound.settings.password ]]</a-tag></td>
<td><a-tag color="green">[[ inbound.settings.network ]]</a-tag></td>
@@ -152,8 +185,7 @@
<th>{{ i18n "pages.inbounds.destinationPort" }}</th>
<th>{{ i18n "pages.inbounds.network" }}</th>
<th>FollowRedirect</th>
- </tr>
- <tr>
+ </tr><tr>
<td><a-tag color="green">[[ inbound.settings.address ]]</a-tag></td>
<td><a-tag color="blue">[[ inbound.settings.port ]]</a-tag></td>
<td><a-tag color="green">[[ inbound.settings.network ]]</a-tag></td>
@@ -166,18 +198,15 @@
<th>{{ i18n "password" }} Auth</th>
<th>{{ i18n "pages.inbounds.enable" }} udp</th>
<th>IP</th>
- </tr>
- <tr>
+ </tr><tr>
<td><a-tag color="green">[[ inbound.settings.auth ]]</a-tag></td>
<td><a-tag color="blue">[[ inbound.settings.udp]]</a-tag></td>
<td><a-tag color="green">[[ inbound.settings.ip ]]</a-tag></td>
- </tr>
- <tr v-if="inbound.settings.auth == 'password'">
+ </tr><tr v-if="inbound.settings.auth == 'password'">
<td> </td>
<td>{{ i18n "username" }}</td>
<td>{{ i18n "password" }}</td>
- </tr>
- <tr v-for="account,index in inbound.settings.accounts">
+ </tr><tr v-for="account,index in inbound.settings.accounts">
<td><a-tag color="green">[[ index ]]</a-tag></td>
<td><a-tag color="blue">[[ account.user ]]</a-tag></td>
<td><a-tag color="green">[[ account.pass ]]</a-tag></td>
@@ -189,8 +218,7 @@
<th> </th>
<th>{{ i18n "username" }}</th>
<th>{{ i18n "password" }}</th>
- </tr>
- <tr v-for="account,index in inbound.settings.accounts">
+ </tr><tr v-for="account,index in inbound.settings.accounts">
<td><a-tag color="green">[[ index ]]</a-tag></td>
<td><a-tag color="blue">[[ account.user ]]</a-tag></td>
<td><a-tag color="green">[[ account.pass ]]</a-tag></td>
@@ -198,20 +226,8 @@
</table>
</table>
</template>
- <div v-if="dbInbound.hasLink()">
- <a-divider>URL</a-divider>
- <a-row v-for="(link,index) in infoModal.links">
- <a-col :span="21"><a-tag color="cyan">[[ link.remark ]]</a-tag><br />[[ link.link ]]</a-col>
- <a-col :span="3" style="text-align: right;">
- <button class="ant-btn ant-btn-primary" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)">
- <a-icon type="snippets"></a-icon>{{ i18n "copy" }}
- </button>
- </a-col>
- </a-row>
- </div>
</a-modal>
<script>
-
const infoModal = {
visible: false,
inbound: new Inbound(),
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 329f0f46..3640c9bb 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -206,12 +206,27 @@
</template>
</template>
<template slot="traffic" slot-scope="text, dbInbound">
- <a-tag color="blue">[[ sizeFormat(dbInbound.up) ]] / [[ sizeFormat(dbInbound.down) ]]</a-tag>
- <template v-if="dbInbound.total > 0">
- <a-tag v-if="dbInbound.up + dbInbound.down < dbInbound.total" color="cyan">[[ sizeFormat(dbInbound.total) ]]</a-tag>
- <a-tag v-else color="red">[[ sizeFormat(dbInbound.total) ]]</a-tag>
- </template>
- <a-tag v-else color="green">{{ i18n "unlimited" }}</a-tag>
+ <a-popover :overlay-class-name="themeSwitcher.darkClass">
+ <template slot="content">
+ <table cellpadding="2" width="100%">
+ <tr>
+ <td>↑[[ sizeFormat(dbInbound.up) ]]</td>
+ <td>↓[[ sizeFormat(dbInbound.down) ]]</td>
+ </tr>
+ <tr v-if="dbInbound.total > 0 && dbInbound.up + dbInbound.down < dbInbound.total">
+ <td>{{ i18n "remained" }}</td>
+ <td>[[ sizeFormat(dbInbound.total - dbInbound.up - dbInbound.down) ]]</td>
+ </tr>
+ </table>
+ </template>
+ <a-tag :color="dbInbound.total == 0 ? 'green' : dbInbound.up + dbInbound.down < dbInbound.total ? 'cyan' : 'red'">
+ [[ sizeFormat(dbInbound.up + dbInbound.down) ]] /
+ <template v-if="dbInbound.total > 0">
+ [[ sizeFormat(dbInbound.total) ]]
+ </template>
+ <template v-else>♾</template>
+ </a-tag>
+ </a-popover>
</template>
<template slot="enable" slot-scope="text, dbInbound">
<a-switch v-model="dbInbound.enable" @change="switchEnable(dbInbound.id)"></a-switch>
@@ -291,12 +306,12 @@
}, {
title: '{{ i18n "clients" }}',
align: 'left',
- width: 50,
+ width: 40,
scopedSlots: { customRender: 'clients' },
}, {
- title: '{{ i18n "pages.inbounds.traffic" }}↑|↓',
+ title: '{{ i18n "pages.inbounds.traffic" }}',
align: 'center',
- width: 120,
+ width: 60,
scopedSlots: { customRender: 'traffic' },
}, {
title: '{{ i18n "pages.inbounds.expireDate" }}',
@@ -309,8 +324,8 @@
{ title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } },
{ title: '{{ i18n "pages.inbounds.enable" }}', width: 40, scopedSlots: { customRender: 'enable' } },
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
- { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
- { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
+ { title: '{{ i18n "pages.inbounds.traffic" }}', width: 50, scopedSlots: { customRender: 'traffic' } },
+ { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 50, scopedSlots: { customRender: 'expiryTime' } },
{ title: 'UUID', width: 120, dataIndex: "id" },
];
@@ -318,8 +333,8 @@
{ title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } },
{ title: '{{ i18n "pages.inbounds.enable" }}', width: 40, scopedSlots: { customRender: 'enable' } },
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
- { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
- { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
+ { title: '{{ i18n "pages.inbounds.traffic" }}', width: 50, scopedSlots: { customRender: 'traffic' } },
+ { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 50, scopedSlots: { customRender: 'expiryTime' } },
{ title: 'Password', width: 170, dataIndex: "password" },
];
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index 11853096..f760ee0b 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -48,6 +48,7 @@
"clients" = "Clients"
"usage" = "Usage"
"secretToken" = "Secret Token"
+"remained" = "Remained"
[menu]
"dashboard" = "System Status"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml
index 815faadd..8557644f 100644
--- a/web/translation/translate.fa_IR.toml
+++ b/web/translation/translate.fa_IR.toml
@@ -48,6 +48,7 @@
"clients" = "کاربران"
"usage" = "استفاده"
"secretToken" = "توکن امنیتی"
+"remained" = "باقیمانده"
[menu]
"dashboard" = "وضعیت سیستم"
diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml
index 10eb539c..9d219129 100644
--- a/web/translation/translate.ru_RU.toml
+++ b/web/translation/translate.ru_RU.toml
@@ -48,6 +48,7 @@
"clients" = "Клиенты"
"usage" = "Использование"
"secretToken" = "Секретный токен"
+"remained" = "остались"
[menu]
"dashboard" = "Статус системы"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml
index d2303926..b39e3ca8 100644
--- a/web/translation/translate.zh_Hans.toml
+++ b/web/translation/translate.zh_Hans.toml
@@ -48,6 +48,7 @@
"clients" = "客户端"
"usage" = "用法"
"secretToken" = "秘密令牌"
+"remained" = "仍然存在"
[menu]
"dashboard" = "系统状态"