diff options
| author | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-02-28 22:54:29 +0300 |
|---|---|---|
| committer | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-02-28 22:54:29 +0300 |
| commit | 5317df21f3923bfa771ed6008d5b0f5f8911e498 (patch) | |
| tree | 3109ee9abe5bf8cf24eef806f033c6d0e5dd160f /web/html | |
| parent | 1a4ba4afd64531c466e5e4a0af7b45bcb3247339 (diff) | |
ip limit + export links
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/login.html | 2 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/trojan.html | 35 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/vless.html | 36 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/vmess.html | 33 | ||||
| -rw-r--r-- | web/html/xui/inbound_modal.html | 24 | ||||
| -rw-r--r-- | web/html/xui/inbounds.html | 13 |
6 files changed, 142 insertions, 1 deletions
diff --git a/web/html/login.html b/web/html/login.html index 5138f15e..f2c2116c 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -39,7 +39,7 @@ <a-layout-content> <a-row type="flex" justify="center"> <a-col :xs="22" :sm="20" :md="16" :lg="12" :xl="8"> - <h1>{{ i18n "pages.login.title" }}</h1> + <h1>3x-ui {{ i18n "pages.login.title" }}</h1> </a-col> </a-row> <a-row type="flex" justify="center"> diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 6d43bc34..4bf57d7a 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -22,6 +22,41 @@ </span> <a-input v-model.trim="trojan.email"></a-input> </a-form-item> + <a-form-item> + <span slot="label"> + IP Count Limit + <a-tooltip> + <template slot="title"> + disable inbound if more than entered count (0 for disable limit ip) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </span> + <a-input type="number" v-model.number="trojan.limitIp" min="0" ></a-input> + </a-form-item> + <a-form-item v-if="trojan.email && trojan.limitIp > 0 && isEdit"> + <span slot="label"> + IP log + <a-tooltip> + <template slot="title"> + IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + <a-tooltip> + <template slot="title"> + clear the log + </template> + <span style="color: #FF4D4F"> + <a-icon type="delete" @click="clearDBClientIps(trojan.email,$event)"></a-icon> + </span> + </a-tooltip> + </span> + <a-form layout="block"> + <a-textarea readonly @click="getDBClientIps(trojan.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }"> + </a-textarea> + </a-form> + </a-form-item> </a-form> <a-form-item label="Password"> <a-input v-model.trim="trojan.password"></a-input> diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index fc7ffaa6..6d895f19 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -23,6 +23,42 @@ </span> <a-input v-model.trim="vless.email"></a-input> </a-form-item> + <a-form-item> + <span slot="label"> + IP Count Limit + <a-tooltip> + <template slot="title"> + disable inbound if more than entered count (0 for disable limit ip) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </span> + <a-input type="number" v-model.number="vless.limitIp" min="0" ></a-input> + </a-form-item> + <a-form-item v-if="vless.email && vless.limitIp > 0 && isEdit"> + <span slot="label"> + IP log + <a-tooltip> + <template slot="title"> + IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + <a-tooltip> + <template slot="title"> + clear the log + </template> + <span style="color: #FF4D4F"> + <a-icon type="delete" @click="clearDBClientIps(vless.email,$event)"></a-icon> + </span> + </a-tooltip> + </span> + <a-form layout="block"> + + <a-textarea readonly @click="getDBClientIps(vless.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }"> + </a-textarea> + </a-form> + </a-form-item> </a-form> <a-form-item label="ID"> <a-input v-model.trim="vless.id"></a-input> diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index f7050a5e..bab0cb8b 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -22,6 +22,39 @@ </span> <a-input v-model.trim="vmess.email"></a-input> </a-form-item> + <a-form-item> + <span slot="label"> + IP Count Limit + <a-tooltip> + <template slot="title"> + disable inbound if more than entered count (0 for disable limit ip) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </span> + <a-input type="number" v-model.number="vmess.limitIp" min="0" ></a-input> + </a-form-item> + <a-form-item v-if="vmess.email && vmess.limitIp > 0 && isEdit"> + <span slot="label"> + IP Log + <a-tooltip> + <template slot="title"> + IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log) + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + <a-tooltip> + <template slot="title"> + clear the log + </template> + <span style="color: #FF4D4F"> + <a-icon type="delete" @click="clearDBClientIps(vmess.email,$event)"></a-icon> + </span> + </a-tooltip> + </span> + <a-textarea readonly @click="getDBClientIps(vmess.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }"> + </a-textarea> + </a-form-item> </a-form> <a-form-item label="ID"> <a-input v-model.trim="vmess.id"></a-input> diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 80ea2286..54a64bf9 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -88,6 +88,30 @@ removeClient(index, clients) { clients.splice(index, 1); }, + async getDBClientIps(email,event) { + + const msg = await HttpUtil.post('/xui/inbound/clientIps/'+ email); + if (!msg.success) { + return; + } + try { + ips = JSON.parse(msg.obj) + ips = ips.join(",") + event.target.value = ips + } catch (error) { + // text + event.target.value = msg.obj + + } + + }, + async clearDBClientIps(email,event) { + const msg = await HttpUtil.post('/xui/inbound/clearClientIps/'+ email); + if (!msg.success) { + return; + } + event.target.value = "" + }, async resetClientTraffic(client,event) { const msg = await HttpUtil.post('/xui/inbound/resetClientTraffic/'+ client.email); if (!msg.success) { diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 14a61669..1f324846 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -45,6 +45,7 @@ <a-card hoverable> <div slot="title"> <a-button type="primary" @click="openAddInbound">Add Inbound</a-button> + <a-button type="primary" @click="exportAllLinks" class="copy-btn">Export Links</a-button> </div> <a-input v-model.lazy="searchKey" placeholder="{{ i18n "search" }}" autofocus style="max-width: 300px"></a-input> <a-table :columns="columns" :row-key="dbInbound => dbInbound.id" @@ -371,6 +372,18 @@ }, }); }, + exportAllLinks() { + let copyText = ''; + for (const dbInbound of this.dbInbounds) { + copyText += dbInbound.genInboundLinks + } + const clipboard = new ClipboardJS('.copy-btn', { + text: function () { + return copyText; + } + }); + clipboard.on('success', () => { this.$message.success('Export Links succeed'); }); + }, delInbound(dbInbound) { this.$confirm({ title: '{{ i18n "pages.inbounds.deleteInbound"}}', |
