mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
minor changes (#922)
* ipv6 for family Protection * warp - ForceIP * fix bug in edit SOCKS and HTTP outbound Co-Authored-By: Saeid <43953720+surbiks@users.noreply.github.com> * lang - export inbound * reset button - publicKey & psk * fix - Ensure logs are not null in show method --------- Co-authored-by: Saeid <43953720+surbiks@users.noreply.github.com>
This commit is contained in:
@@ -860,13 +860,13 @@ Outbound.SocksSettings = class extends CommonClass {
|
||||
}
|
||||
|
||||
static fromJson(json={}) {
|
||||
servers = json.servers;
|
||||
let servers = json.servers;
|
||||
if(ObjectUtil.isArrEmpty(servers)) servers=[{users: [{}]}];
|
||||
return new Outbound.SocksSettings(
|
||||
servers[0].address,
|
||||
servers[0].port,
|
||||
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].user,
|
||||
ObjectUtil.isArrEmpty(servers[0].pass) ? '' : servers[0].users[0].pass,
|
||||
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].pass,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -890,13 +890,13 @@ Outbound.HttpSettings = class extends CommonClass {
|
||||
}
|
||||
|
||||
static fromJson(json={}) {
|
||||
servers = json.servers;
|
||||
let servers = json.servers;
|
||||
if(ObjectUtil.isArrEmpty(servers)) servers=[{users: [{}]}];
|
||||
return new Outbound.HttpSettings(
|
||||
servers[0].address,
|
||||
servers[0].port,
|
||||
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].user,
|
||||
ObjectUtil.isArrEmpty(servers[0].pass) ? '' : servers[0].users[0].pass,
|
||||
ObjectUtil.isArrEmpty(servers[0].users) ? '' : servers[0].users[0].pass,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ Outbound.HttpSettings = class extends CommonClass {
|
||||
};
|
||||
Outbound.WireguardSettings = class extends CommonClass {
|
||||
constructor(
|
||||
mtu=1420, secretKey=Wireguard.generateKeypair().privateKey,
|
||||
mtu=1420, secretKey='',
|
||||
address='', workers=2, domainStrategy='', reserved='',
|
||||
peers=[new Outbound.WireguardSettings.Peer()], kernelMode=false) {
|
||||
super();
|
||||
|
||||
@@ -2098,7 +2098,7 @@ Inbound.WireguardSettings = class extends XrayCommonClass {
|
||||
};
|
||||
|
||||
Inbound.WireguardSettings.Peer = class extends XrayCommonClass {
|
||||
constructor(publicKey='', psk='', allowedIPs=['0.0.0.0/0','::/0'], keepAlive=0) {
|
||||
constructor(publicKey=Wireguard.generateKeypair().publicKey, psk='', allowedIPs=['0.0.0.0/0','::/0'], keepAlive=0) {
|
||||
super();
|
||||
this.publicKey = publicKey;
|
||||
this.psk = psk;
|
||||
|
||||
@@ -32,10 +32,28 @@
|
||||
<a-icon v-if="inbound.settings.peers.length>1" type="delete" @click="() => inbound.settings.delPeer(index)"
|
||||
style="color: rgb(255, 77, 79);cursor: pointer;"/>
|
||||
</a-divider>
|
||||
<a-form-item label='{{ i18n "pages.xray.wireguard.publicKey" }}'>
|
||||
<a-form-item>
|
||||
<template slot="label">
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
<span>{{ i18n "reset" }}</span>
|
||||
</template>
|
||||
{{ i18n "pages.xray.wireguard.publicKey" }}
|
||||
<a-icon @click="peer.publicKey = publicKey=Wireguard.generateKeypair().publicKey"type="sync"> </a-icon>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model.trim="peer.publicKey"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.wireguard.psk" }}'>
|
||||
<a-form-item>
|
||||
<template slot="label">
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
<span>{{ i18n "reset" }}</span>
|
||||
</template>
|
||||
{{ i18n "pages.xray.wireguard.psk" }}
|
||||
<a-icon @click="peer.psk = publicKey=Wireguard.generateKeypair().publicKey"type="sync"> </a-icon>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model.trim="peer.psk"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
</a-menu-item>
|
||||
<a-menu-item key="clipboard">
|
||||
<a-icon type="copy"></a-icon>
|
||||
{{ i18n "pages.inbounds.copyToClipboard" }}
|
||||
{{ i18n "pages.inbounds.exportInbound" }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="clone">
|
||||
<a-icon type="block"></a-icon> {{ i18n "pages.inbounds.clone"}}
|
||||
|
||||
@@ -436,8 +436,8 @@
|
||||
loading: false,
|
||||
show(logs) {
|
||||
this.visible = true;
|
||||
this.logs = logs;
|
||||
this.formattedLogs = logs.length > 0 ? this.formatLogs(logs) : "No Record...";
|
||||
this.logs = logs || [];
|
||||
this.formattedLogs = this.logs.length > 0 ? this.formatLogs(this.logs) : "No Record...";
|
||||
},
|
||||
formatLogs(logs) {
|
||||
let formattedLogs = '';
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
mtu: 1420,
|
||||
secretKey: warpModal.warpData.private_key,
|
||||
address: Object.values(config.interface.addresses),
|
||||
domainStrategy: 'ForceIP',
|
||||
peers: [{
|
||||
publicKey: peer.public_key,
|
||||
endpoint: peer.endpoint.host,
|
||||
|
||||
@@ -553,17 +553,17 @@
|
||||
ir: [
|
||||
"regexp:.*\\.ir$",
|
||||
"regexp:.*\\.xn--mgba3a4f16a$", // .ایران
|
||||
"ext:geosite_IR.dat:ir" // have rules to bypass all .ir domains.
|
||||
"ext:geosite_IR.dat:ir"
|
||||
]
|
||||
},
|
||||
familyProtectDNS: {
|
||||
"servers": [
|
||||
"1.1.1.3",
|
||||
"1.1.1.3", // https://developers.cloudflare.com/1.1.1.1/setup/
|
||||
"1.0.0.3",
|
||||
"94.140.14.15",
|
||||
"94.140.15.16"
|
||||
"2606:4700:4700::1113",
|
||||
"2606:4700:4700::1003"
|
||||
],
|
||||
"queryStrategy": "UseIPv4"
|
||||
"queryStrategy": "UseIP"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
"info" = "Info"
|
||||
"same" = "Same"
|
||||
"inboundData" = "Inbound's Data"
|
||||
"copyToClipboard" = "Copy to Clipboard"
|
||||
"exportInbound" = "Export Inbound"
|
||||
"import" = "Import"
|
||||
"importInbound" = "Import an Inbound"
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
"info" = "اطلاعات"
|
||||
"same" = "همسان"
|
||||
"inboundData" = "دادههای ورودی"
|
||||
"copyToClipboard" = "کپی در حافظه"
|
||||
"exportInbound" = "استخراج ورودی"
|
||||
"import" = "افزودن"
|
||||
"importInbound" = "افزودن یک ورودی"
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
"info" = "Информация"
|
||||
"same" = "Тот же"
|
||||
"inboundData" = "Входящие данные"
|
||||
"copyToClipboard" = "Копировать в буфер обмена"
|
||||
"exportInbound" = "Экспорт входящих"
|
||||
"import" = "Импортировать"
|
||||
"importInbound" = "Импортировать входящее сообщение"
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
"info" = "Thông tin"
|
||||
"same" = "Như nhau"
|
||||
"inboundData" = "Dữ liệu gửi đến"
|
||||
"copyToClipboard" = "Sao chép vào bảng nhớ tạm"
|
||||
"exportInbound" = "Xuất nhập khẩu"
|
||||
"import" = "Nhập"
|
||||
"importInbound" = "Nhập hàng gửi về"
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
"info" = "信息"
|
||||
"same" = "相同"
|
||||
"inboundData" = "入站数据"
|
||||
"copyToClipboard" = "复制到剪贴板"
|
||||
"exportInbound" = "出口 入境"
|
||||
"import"="导入"
|
||||
"importInbound" = "导入入站"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user