|
@@ -145,10 +145,6 @@
|
|
<a-icon type="rest"></a-icon>
|
|
<a-icon type="rest"></a-icon>
|
|
{{ i18n "pages.inbounds.delDepletedClients" }}
|
|
{{ i18n "pages.inbounds.delDepletedClients" }}
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
- <a-menu-item v-if="subSettings.enable && dbInbounds.length > 0" key="addGroupClient">
|
|
|
|
- <a-icon type="usergroup-add"></a-icon>
|
|
|
|
- {{ i18n "pages.client.groupAdd"}}
|
|
|
|
- </a-menu-item>
|
|
|
|
</a-menu>
|
|
</a-menu>
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -289,7 +285,7 @@
|
|
<p v-for="clientEmail in clientCount[dbInbound.id].online">[[ clientEmail ]]</p>
|
|
<p v-for="clientEmail in clientCount[dbInbound.id].online">[[ clientEmail ]]</p>
|
|
</template>
|
|
</template>
|
|
<a-tag style="margin:0; padding: 0 2px;" color="blue" v-if="clientCount[dbInbound.id].online.length">[[ clientCount[dbInbound.id].online.length ]]</a-tag>
|
|
<a-tag style="margin:0; padding: 0 2px;" color="blue" v-if="clientCount[dbInbound.id].online.length">[[ clientCount[dbInbound.id].online.length ]]</a-tag>
|
|
- </a-popover>
|
|
|
|
|
|
+ </a-popover>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
<template slot="traffic" slot-scope="text, dbInbound">
|
|
<template slot="traffic" slot-scope="text, dbInbound">
|
|
@@ -343,7 +339,7 @@
|
|
<a-tag style="margin:0;" color="blue">[[ dbInbound.toInbound().stream.network ]]</a-tag>
|
|
<a-tag style="margin:0;" color="blue">[[ dbInbound.toInbound().stream.network ]]</a-tag>
|
|
<a-tag style="margin:0;" v-if="dbInbound.toInbound().stream.isTls" color="green">tls</a-tag>
|
|
<a-tag style="margin:0;" v-if="dbInbound.toInbound().stream.isTls" color="green">tls</a-tag>
|
|
<a-tag style="margin:0;" v-if="dbInbound.toInbound().stream.isReality" color="green">reality</a-tag>
|
|
<a-tag style="margin:0;" v-if="dbInbound.toInbound().stream.isReality" color="green">reality</a-tag>
|
|
- </template>
|
|
|
|
|
|
+ </template>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<tr>
|
|
<tr>
|
|
@@ -377,7 +373,7 @@
|
|
<p v-for="clientEmail in clientCount[dbInbound.id].online">[[ clientEmail ]]</p>
|
|
<p v-for="clientEmail in clientCount[dbInbound.id].online">[[ clientEmail ]]</p>
|
|
</template>
|
|
</template>
|
|
<a-tag style="margin:0; padding: 0 2px;" color="green" v-if="clientCount[dbInbound.id].online.length">[[ clientCount[dbInbound.id].online.length ]]</a-tag>
|
|
<a-tag style="margin:0; padding: 0 2px;" color="green" v-if="clientCount[dbInbound.id].online.length">[[ clientCount[dbInbound.id].online.length ]]</a-tag>
|
|
- </a-popover>
|
|
|
|
|
|
+ </a-popover>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<tr>
|
|
<tr>
|
|
@@ -744,9 +740,6 @@
|
|
case "delDepletedClients":
|
|
case "delDepletedClients":
|
|
this.delDepletedClients(-1)
|
|
this.delDepletedClients(-1)
|
|
break;
|
|
break;
|
|
- case "addGroupClient":
|
|
|
|
- this.openGroupAddClient()
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
clickAction(action, dbInbound) {
|
|
clickAction(action, dbInbound) {
|
|
@@ -890,20 +883,6 @@
|
|
|
|
|
|
await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal);
|
|
await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal);
|
|
},
|
|
},
|
|
- openGroupAddClient() {
|
|
|
|
- clientModal.show({
|
|
|
|
- title: '{{ i18n "pages.client.groupAdd"}}',
|
|
|
|
- okText: '{{ i18n "pages.client.submitAdd"}}',
|
|
|
|
- dbInbounds: this.dbInbounds,
|
|
|
|
- confirm: async (clients, dbInboundIds) => {
|
|
|
|
- clientModal.loading();
|
|
|
|
- await this.addGroupClient(clients, dbInboundIds);
|
|
|
|
- clientModal.close();
|
|
|
|
- await this.showQrcode(dbInboundIds[0],clients[0], true)
|
|
|
|
- },
|
|
|
|
- isEdit: false
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
openAddClient(dbInboundId) {
|
|
openAddClient(dbInboundId) {
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
clientModal.show({
|
|
clientModal.show({
|
|
@@ -914,7 +893,6 @@
|
|
clientModal.loading();
|
|
clientModal.loading();
|
|
await this.addClient(clients, dbInboundId);
|
|
await this.addClient(clients, dbInboundId);
|
|
clientModal.close();
|
|
clientModal.close();
|
|
- await this.showQrcode(dbInboundId,clients)
|
|
|
|
},
|
|
},
|
|
isEdit: false
|
|
isEdit: false
|
|
});
|
|
});
|
|
@@ -939,7 +917,6 @@
|
|
clientModal.show({
|
|
clientModal.show({
|
|
title: '{{ i18n "pages.client.edit"}}',
|
|
title: '{{ i18n "pages.client.edit"}}',
|
|
okText: '{{ i18n "pages.client.submitEdit"}}',
|
|
okText: '{{ i18n "pages.client.submitEdit"}}',
|
|
- dbInbounds: this.dbInbounds,
|
|
|
|
dbInbound: dbInbound,
|
|
dbInbound: dbInbound,
|
|
index: index,
|
|
index: index,
|
|
confirm: async (client, dbInboundId, clientId) => {
|
|
confirm: async (client, dbInboundId, clientId) => {
|
|
@@ -963,41 +940,14 @@
|
|
id: dbInboundId,
|
|
id: dbInboundId,
|
|
settings: '{"clients": [' + clients.toString() + ']}',
|
|
settings: '{"clients": [' + clients.toString() + ']}',
|
|
};
|
|
};
|
|
-
|
|
|
|
- await this.submit(`/panel/inbound/addClient`, data)
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- async addGroupClient(clients, dbInboundIds) {
|
|
|
|
- const data = []
|
|
|
|
- dbInboundIds.forEach((dbInboundId, index) => {
|
|
|
|
- data.push({
|
|
|
|
- id: dbInboundId,
|
|
|
|
- settings: '{"clients": [' + clients[index].toString() + ']}',
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- await this.submit(`/panel/inbound/addGroupClient`, data, true)
|
|
|
|
|
|
+ await this.submit(`/panel/inbound/addClient`, data);
|
|
},
|
|
},
|
|
async updateClient(client, dbInboundId, clientId) {
|
|
async updateClient(client, dbInboundId, clientId) {
|
|
- if (Array.isArray(client) && Array.isArray(dbInboundId) && Array.isArray(clientId)){
|
|
|
|
- const data = []
|
|
|
|
- client.forEach((client, index) => {
|
|
|
|
- data.push({
|
|
|
|
- clientId: clientId[index],
|
|
|
|
- inbound: {
|
|
|
|
- id: dbInboundId[index],
|
|
|
|
- settings: '{"clients": [' + client.toString() + ']}',
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- await this.submit(`/panel/inbound/updateClients`, data, true);
|
|
|
|
- }else{
|
|
|
|
- const data = {
|
|
|
|
- id: dbInboundId,
|
|
|
|
- settings: '{"clients": [' + client.toString() + ']}',
|
|
|
|
- };
|
|
|
|
- await this.submit(`/panel/inbound/updateClient/${clientId}`, data);
|
|
|
|
- }
|
|
|
|
|
|
+ const data = {
|
|
|
|
+ id: dbInboundId,
|
|
|
|
+ settings: '{"clients": [' + client.toString() + ']}',
|
|
|
|
+ };
|
|
|
|
+ await this.submit(`/panel/inbound/updateClient/${clientId}`, data);
|
|
},
|
|
},
|
|
resetTraffic(dbInboundId) {
|
|
resetTraffic(dbInboundId) {
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
@@ -1051,8 +1001,8 @@
|
|
checkFallback(dbInbound) {
|
|
checkFallback(dbInbound) {
|
|
newDbInbound = new DBInbound(dbInbound);
|
|
newDbInbound = new DBInbound(dbInbound);
|
|
if (dbInbound.listen.startsWith("@")){
|
|
if (dbInbound.listen.startsWith("@")){
|
|
- rootInbound = this.inbounds.find((i) =>
|
|
|
|
- i.isTcp &&
|
|
|
|
|
|
+ rootInbound = this.inbounds.find((i) =>
|
|
|
|
+ i.isTcp &&
|
|
['trojan','vless'].includes(i.protocol) &&
|
|
['trojan','vless'].includes(i.protocol) &&
|
|
i.settings.fallbacks.find(f => f.dest === dbInbound.listen)
|
|
i.settings.fallbacks.find(f => f.dest === dbInbound.listen)
|
|
);
|
|
);
|
|
@@ -1068,10 +1018,10 @@
|
|
}
|
|
}
|
|
return newDbInbound;
|
|
return newDbInbound;
|
|
},
|
|
},
|
|
- showQrcode(dbInboundId, client, isJustSub = false) {
|
|
|
|
|
|
+ showQrcode(dbInboundId, client) {
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
newDbInbound = this.checkFallback(dbInbound);
|
|
newDbInbound = this.checkFallback(dbInbound);
|
|
- qrModal.show('{{ i18n "qrCode"}}', newDbInbound, client, isJustSub);
|
|
|
|
|
|
+ qrModal.show('{{ i18n "qrCode"}}', newDbInbound, client);
|
|
},
|
|
},
|
|
showInfo(dbInboundId, client) {
|
|
showInfo(dbInboundId, client) {
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
|
|
@@ -1100,8 +1050,8 @@
|
|
await this.updateClient(clients[index], dbInboundId, clientId);
|
|
await this.updateClient(clients[index], dbInboundId, clientId);
|
|
this.loading(false);
|
|
this.loading(false);
|
|
},
|
|
},
|
|
- async submit(url, data, isJson = false) {
|
|
|
|
- const msg = isJson ? await HttpUtil.postWithModalJson(url, data) : await HttpUtil.postWithModal(url, data);
|
|
|
|
|
|
+ async submit(url, data) {
|
|
|
|
+ const msg = await HttpUtil.postWithModal(url, data);
|
|
if (msg.success) {
|
|
if (msg.success) {
|
|
await this.getDBInbounds();
|
|
await this.getDBInbounds();
|
|
}
|
|
}
|
|
@@ -1243,7 +1193,7 @@
|
|
value: '',
|
|
value: '',
|
|
okText: '{{ i18n "pages.inbounds.import" }}',
|
|
okText: '{{ i18n "pages.inbounds.import" }}',
|
|
confirm: async (dbInboundText) => {
|
|
confirm: async (dbInboundText) => {
|
|
- await this.submit('/panel/inbound/import', {data: dbInboundText});
|
|
|
|
|
|
+ await this.submit('/panel/inbound/import', {data: dbInboundText}, promptModal);
|
|
promptModal.close();
|
|
promptModal.close();
|
|
},
|
|
},
|
|
});
|
|
});
|