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:
Ho3ein
2024-02-13 21:06:25 +03:30
committed by GitHub
parent 288c0b982a
commit b829ebca2b
12 changed files with 40 additions and 21 deletions

View File

@@ -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();

View File

@@ -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;

View File

@@ -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>

View File

@@ -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"}}

View File

@@ -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 = '';

View File

@@ -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,

View File

@@ -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"
},
}
},

View File

@@ -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"

View File

@@ -170,7 +170,7 @@
"info" = "اطلاعات"
"same" = "همسان"
"inboundData" = "داده‌های ورودی"
"copyToClipboard" = "کپی در حافظه"
"exportInbound" = "استخراج ورودی"
"import" = "افزودن"
"importInbound" = "افزودن یک ورودی"

View File

@@ -171,7 +171,7 @@
"info" = "Информация"
"same" = "Тот же"
"inboundData" = "Входящие данные"
"copyToClipboard" = "Копировать в буфер обмена"
"exportInbound" = "Экспорт входящих"
"import" = "Импортировать"
"importInbound" = "Импортировать входящее сообщение"

View File

@@ -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ề"

View File

@@ -171,7 +171,7 @@
"info" = "信息"
"same" = "相同"
"inboundData" = "入站数据"
"copyToClipboard" = "复制到剪贴板"
"exportInbound" = "出口 入境"
"import"="导入"
"importInbound" = "导入入站"