code format compare

This commit is contained in:
ali rahimi 2025-01-13 18:09:04 +01:00
parent 95d03a7ffd
commit 2b80b9174c
3 changed files with 46 additions and 55 deletions

View file

@ -45,13 +45,15 @@
qrcodes: [], qrcodes: [],
clipboard: null, clipboard: null,
visible: false, visible: false,
isJustSub: false,subId: '', isJustSub: false,
subId: '',
show: function(title = '', dbInbound, client, isJustSub = false) { show: function(title = '', dbInbound, client, isJustSub = false) {
this.title = title; this.title = title;
this.dbInbound = dbInbound; this.dbInbound = dbInbound;
this.inbound = dbInbound.toInbound(); this.inbound = dbInbound.toInbound();
this.client = client; this.client = client;
this.isJustSub = isJustSub;this.subId = ''; this.isJustSub = isJustSub;
this.subId = '';
this.qrcodes = []; this.qrcodes = [];
if (this.inbound.protocol == Protocols.WIREGUARD) { if (this.inbound.protocol == Protocols.WIREGUARD) {
this.inbound.genInboundLinks(dbInbound.remark).split('\r\n').forEach((l, index) => { this.inbound.genInboundLinks(dbInbound.remark).split('\r\n').forEach((l, index) => {

View file

@ -4,10 +4,7 @@
:class="themeSwitcher.currentTheme" :class="themeSwitcher.currentTheme"
:ok-text="clientModal.okText" cancel-text='{{ i18n "close" }}'> :ok-text="clientModal.okText" cancel-text='{{ i18n "close" }}'>
<template v-if="isEdit"> <template v-if="isEdit">
<a-tag v-if="isExpiry || isTrafficExhausted" color="red" <a-tag v-if="isExpiry || isTrafficExhausted" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag>
style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And
Disabled
</a-tag>
</template> </template>
{{template "form/client"}} {{template "form/client"}}
</a-modal> </a-modal>
@ -154,26 +151,18 @@
}, },
getClientId(protocol, client) { getClientId(protocol, client) {
switch (protocol) { switch (protocol) {
case Protocols.TROJAN: case Protocols.TROJAN: return client.password;
return client.password; case Protocols.SHADOWSOCKS: return client.email;
case Protocols.SHADOWSOCKS: default: return client.id;
return client.email;
default:
return client.id;
} }
}, },
addClient(protocol, clients) { addClient(protocol, clients) {
switch (protocol) { switch (protocol) {
case Protocols.VMESS: case Protocols.VMESS: return clients.push(new Inbound.VmessSettings.VMESS());
return clients.push(new Inbound.VmessSettings.VMESS()); case Protocols.VLESS: return clients.push(new Inbound.VLESSSettings.VLESS());
case Protocols.VLESS: case Protocols.TROJAN: return clients.push(new Inbound.TrojanSettings.Trojan());
return clients.push(new Inbound.VLESSSettings.VLESS()); case Protocols.SHADOWSOCKS: return clients.push(new Inbound.ShadowsocksSettings.Shadowsocks(clients[0].method));
case Protocols.TROJAN: default: return null;
return clients.push(new Inbound.TrojanSettings.Trojan());
case Protocols.SHADOWSOCKS:
return clients.push(new Inbound.ShadowsocksSettings.Shadowsocks(clients[0].method));
default:
return null;
} }
}, },
close() { close() {