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
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-07-18 02:49:01 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-07-18 02:49:01 +0300
commitc2e9ee36658a8549251df7fb37467baa55341a5f (patch)
tree25baf2f09f566d9aba8cae93274612af0cd5d750 /web/html/xui
parent1f78842b707a1190b6a84aded269d664254a7f1d (diff)
update - shadowsocks
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/html/xui')
-rw-r--r--web/html/xui/form/protocol/shadowsocks.html4
-rw-r--r--web/html/xui/inbound_info_modal.html15
-rw-r--r--web/html/xui/inbound_modal.html23
-rw-r--r--web/html/xui/inbounds.html15
4 files changed, 39 insertions, 18 deletions
diff --git a/web/html/xui/form/protocol/shadowsocks.html b/web/html/xui/form/protocol/shadowsocks.html
index 7af96373..8e16b143 100644
--- a/web/html/xui/form/protocol/shadowsocks.html
+++ b/web/html/xui/form/protocol/shadowsocks.html
@@ -1,5 +1,6 @@
{{define "form/shadowsocks"}}
<a-form layout="inline" style="padding: 10px 0px;">
+ <template v-if="inbound.isSSMultiUser">
<a-collapse activeKey="0" v-for="(client, index) in inbound.settings.shadowsockses.slice(0,1)" v-if="!isEdit">
<a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'>
<a-form-item>
@@ -106,10 +107,11 @@
</table>
</a-collapse-panel>
</a-collapse>
+</template>
</a-form>
<a-form layout="inline">
<a-form-item label='{{ i18n "encryption" }}'>
- <a-select v-model="inbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.darkCardClass">
+ <a-select v-model="inbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.darkCardClass" @change="SSMethodChange">
<a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>
</a-select>
</a-form-item>
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html
index 00cb5ce6..fae058ad 100644
--- a/web/html/xui/inbound_info_modal.html
+++ b/web/html/xui/inbound_info_modal.html
@@ -179,6 +179,19 @@
<td><a-tag color="green">[[ inbound.settings.network ]]</a-tag></td>
</tr>
</table>
+ <template v-if="inbound.protocol == Protocols.SHADOWSOCKS && !inbound.isSSMultiUser">
+ <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>
<table v-if="inbound.protocol == Protocols.DOKODEMO" style="margin-bottom: 10px; width: 100%;">
<tr>
<th>{{ i18n "pages.inbounds.targetAddress" }}</th>
@@ -251,7 +264,7 @@
this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null;
this.isExpired = this.inbound.isExpiry(index);
this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : [];
- remark = this.dbInbound.remark + "-" + this.clientSettings.email;
+ remark = this.dbInbound.remark + ( this.clientSettings ? "-" + this.clientSettings.email : '');
address = this.dbInbound.address;
this.links = [];
if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) {
diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html
index 60244be4..65988b14 100644
--- a/web/html/xui/inbound_modal.html
+++ b/web/html/xui/inbound_modal.html
@@ -54,23 +54,11 @@
},
};
- const protocols = {
- VMESS: Protocols.VMESS,
- VLESS: Protocols.VLESS,
- TROJAN: Protocols.TROJAN,
- SHADOWSOCKS: Protocols.SHADOWSOCKS,
- DOKODEMO: Protocols.DOKODEMO,
- SOCKS: Protocols.SOCKS,
- HTTP: Protocols.HTTP,
- };
-
new Vue({
delimiters: ['[[', ']]'],
el: '#inbound-modal',
data: {
inModal: inModal,
- Protocols: protocols,
- SSMethods: SSMethods,
delayedStart: false,
get inbound() {
return inModal.inbound;
@@ -117,6 +105,17 @@
});
}
},
+ SSMethodChange() {
+ if (this.inModal.inbound.isSSMultiUser) {
+ if (this.inModal.inbound.settings.shadowsockses.length ==0){
+ this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()];
+ }
+ } else {
+ if (this.inModal.inbound.settings.shadowsockses.length > 0){
+ this.inModal.inbound.settings.shadowsockses = [];
+ }
+ }
+ },
setDefaultCertData(index) {
inModal.inbound.stream.tls.certs[index].certFile = app.defaultCert;
inModal.inbound.stream.tls.certs[index].keyFile = app.defaultKey;
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 193c080b..39c64aff 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -131,7 +131,11 @@
<a-icon type="edit"></a-icon>
{{ i18n "edit" }}
</a-menu-item>
- <template v-if="dbInbound.isTrojan || dbInbound.isVLess || dbInbound.isVMess || dbInbound.isSS">
+ <a-menu-item key="qrcode" v-if="dbInbound.isSS && !dbInbound.toInbound().isSSMultiUser">
+ <a-icon type="qrcode"></a-icon>
+ {{ i18n "qrCode" }}
+ </a-menu-item>
+ <template v-if="dbInbound.isTrojan || dbInbound.isVLess || dbInbound.isVMess || dbInbound.toInbound().isSSMultiUser">
<a-menu-item key="addClient">
<a-icon type="user-add"></a-icon>
{{ i18n "pages.client.add"}}
@@ -255,7 +259,7 @@
{{template "client_table"}}
</a-table>
<a-table
- v-else-if="record.protocol === Protocols.TROJAN || record.protocol === Protocols.SHADOWSOCKS"
+ v-else-if="record.protocol === Protocols.TROJAN || record.toInbound().isSSMultiUser"
:row-key="client => client.id"
:columns="innerTrojanColumns"
:data-source="getInboundClients(record)"
@@ -274,7 +278,6 @@
{{template "js" .}}
{{template "component/themeSwitcher" .}}
<script>
-
const columns = [{
title: '{{ i18n "pages.inbounds.operate" }}',
align: 'center',
@@ -357,7 +360,7 @@
trafficDiff: 0,
defaultCert: '',
defaultKey: '',
- clientCount: {},
+ clientCount: [],
isRefreshEnabled: localStorage.getItem("isRefreshEnabled") === "true" ? true : false,
refreshing: false,
refreshInterval: Number(localStorage.getItem("refreshInterval")) || 5000,
@@ -409,12 +412,16 @@
setInbounds(dbInbounds) {
this.inbounds.splice(0);
this.dbInbounds.splice(0);
+ this.clientCount.splice(0);
for (const inbound of dbInbounds) {
const dbInbound = new DBInbound(inbound);
to_inbound = dbInbound.toInbound()
this.inbounds.push(to_inbound);
this.dbInbounds.push(dbInbound);
if ([Protocols.VMESS, Protocols.VLESS, Protocols.TROJAN, Protocols.SHADOWSOCKS].includes(inbound.protocol)) {
+ if (inbound.protocol === Protocols.SHADOWSOCKS && (!to_inbound.isSSMultiUser)) {
+ continue;
+ }
this.clientCount[inbound.id] = this.getClientCounts(inbound, to_inbound);
}
}