Skip to content

Commit

Permalink
Bug fixes, UI changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Nov 13, 2024
1 parent 843d403 commit 24d6367
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
Binary file added docs/assets/images/My-IP.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/images/Panel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/images/Your-IP.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/configuration_fa.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@
> اپ Hiddify هم باید حداقل ورژنش 2.0.5 باشه.
<br>
<h1 align="center">جدول Your IP</h1>
<h1 align="center">جدول My IP</h1>

<p align="center">
<img src="assets/images/Your-IP.jpg">
<img src="assets/images/My-IP.jpg">
</p>

بعد از وصل شدن به پروکسی میتونید صفحه رو رفرش کنید و به این جدول مراجعه کنید و ببینید IP هاتون چیه. این جدول دو ردیف داره، ردیف اول IP شما رو برای آدرس‌هاس Cloudflare نشون میده، اگر Proxy IP داشته باشید IP شما برای آدرس‌های Cloudflare همین Proxy IP خواهد بود و برای مابقی آدرس‌ها یک IP تصادفی کلادفلر. بنابراین از این طریق میتونید چک کنید Proxy IP که انتخاب کردید اعمال شده یا نه. اگر با کانفیگ‌های Warp وصل بشید هم قاعدتا هر دو ردیف جدول باید یک IP رو نشون بدن.
Expand Down
6 changes: 3 additions & 3 deletions src/cores-configs/clash.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ async function buildClashDNS (proxySettings, isChain, isWarp) {
"use-hosts": true,
"use-system-hosts": false,
"nameserver": isWarp
? warpRemoteDNS.map(dns => isChain ? `${dns}#💦 Warp - Best Ping 🚀` : dns)
: [isChain ? `${remoteDNS}#proxy-1` : remoteDNS],
? warpRemoteDNS.map(dns => isChain ? `${dns}#💦 Warp - Best Ping 🚀` : `${dns}#✅ Selector`)
: [isChain ? `${remoteDNS}#proxy-1` : `${remoteDNS}#✅ Selector`],
"proxy-server-nameserver": [`${localDNS}#DIRECT`]
};

if (isChain && !isWarp) {
const chainOutboundServer = JSON.parse(outProxyParams).server;
if (isDomain(chainOutboundServer)) dns["nameserver-policy"] = {
[chainOutboundServer]: `${remoteDNS}#proxy-1`
[chainOutboundServer]: isChain ? `${remoteDNS}#proxy-1` : `${remoteDNS}#✅ Selector`
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/cores-configs/sing-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function buildSingBoxRoutingRules (proxySettings) {
},
{
clash_mode: "Global",
outbound: "proxy"
outbound: "✅ Selector"
}
];

Expand Down Expand Up @@ -598,7 +598,7 @@ export async function getSingBoxCustomConfig(request, env, isFragment) {
const customCdnAddresses = customCdnAddrs ? customCdnAddrs.split(',') : [];
const totalAddresses = [...Addresses, ...customCdnAddresses];
const config = structuredClone(singboxConfigTemp);
const dnsObject = buildSingBoxDNS(proxySettings, totalAddresses, false, chainProxy ? 'proxy-1' : 'proxy');
const dnsObject = buildSingBoxDNS(proxySettings, totalAddresses, false, chainProxy ? 'proxy-1' : '✅ Selector');
const {rules, rule_set} = buildSingBoxRoutingRules(proxySettings);
config.dns.servers = dnsObject.servers;
config.dns.rules = dnsObject.rules;
Expand Down Expand Up @@ -727,7 +727,7 @@ const singboxConfigTemp = {
outbounds: [
{
type: "selector",
tag: "proxy",
tag: "✅ Selector",
outbounds: []
},
{
Expand Down Expand Up @@ -755,7 +755,7 @@ const singboxConfigTemp = {
rule_set: [],
auto_detect_interface: true,
override_android_vpn: true,
final: "proxy"
final: "✅ Selector"
},
ntp: {
enabled: true,
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export async function handlePanel(request, env) {
return new Response('Success', { status: 200 });
}

const { kvNotFound, proxySettings } = await getDataset(request, env);
if (kvNotFound) return await renderErrorPage(request, env, 'KV Dataset is not properly set!', null, true);
const pwd = await env.bpb.get('pwd');
if (pwd && !auth) return Response.redirect(`${origin}/login`, 302);
const isPassSet = pwd?.length >= 8;
const { kvNotFound, proxySettings } = await getDataset(request, env);
if (kvNotFound) return await renderErrorPage(request, env, 'KV Dataset is not properly set!', null, true);
return await renderHomePage(request, env, proxySettings, isPassSet);
}

Expand Down
4 changes: 2 additions & 2 deletions src/kv/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export async function getDataset(request, env) {

export async function updateDataset (request, env) {
await initializeParams(request, env);
let newSettings = await request.formData();
const isReset = newSettings.get('resetSettings') === 'true';
let newSettings = request.method === 'POST' ? await request.formData() : null;
const isReset = newSettings?.get('resetSettings') === 'true';
let currentSettings;
if (!isReset) {
try {
Expand Down
22 changes: 11 additions & 11 deletions src/pages/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
<div class="form-container">
<form id="configForm">
<details open>
<summary><h2>VLESS / TROJAN ⚙️</h2></summary>
<summary><h2>VLESS - TROJAN ⚙️</h2></summary>
<div class="form-control">
<label for="remoteDNS">🌏 Remote DNS</label>
<input type="url" id="remoteDNS" name="remoteDNS" value="${remoteDNS}" required>
Expand All @@ -412,15 +412,15 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</div>
</div>
<div class="form-control">
<label for="proxyIP">📍 Proxy IP</label>
<label for="proxyIP">📍 Proxy IPs - Domains</label>
<input type="text" id="proxyIP" name="proxyIP" value="${proxyIP.replaceAll(",", " , ")}">
</div>
<div class="form-control">
<label for="outProxy">✈️ Chain Proxy</label>
<input type="text" id="outProxy" name="outProxy" value="${outProxy}">
</div>
<div class="form-control">
<label for="cleanIPs">✨ Clean IPs</label>
<label for="cleanIPs">✨ Clean IPs - Domains</label>
<input type="text" id="cleanIPs" name="cleanIPs" value="${cleanIPs.replaceAll(",", " , ")}">
</div>
<div class="form-control">
Expand Down Expand Up @@ -679,7 +679,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</tr>
<tr>
<td>
${supportedApps(['Nekobox', 'Nekoray (Sing-Box)', 'Karing'])}
${supportedApps(['husi', 'Nekobox', 'Nekoray (sing-Box)', 'Karing'])}
</td>
<td>
${subURL('sub', 'singbox', 'BPB-Normal')}
Expand All @@ -705,7 +705,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</tr>
<tr>
<td>
${supportedApps(['Sing-box'])}
${supportedApps(['sing-box', 'v2rayN (sing-box)'])}
</td>
<td>
${subQR('sub', 'sfa', 'BPB-Full-Normal', 'Full normal Subscription', true)}
Expand All @@ -714,7 +714,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</tr>
<tr>
<td>
${supportedApps(['Clash Meta', 'Clash Verge', 'v2rayN', 'FlClash', 'Stash'])}
${supportedApps(['Clash Meta', 'Clash Verge', 'FlClash', 'Stash', 'v2rayN (mihomo)'])}
</td>
<td>
${subQR('sub', 'clash', 'BPB-Full-Normal', 'Full normal Subscription')}
Expand Down Expand Up @@ -768,7 +768,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</tr>
<tr>
<td>
${supportedApps(['Hiddify', 'Sing-box'])}
${supportedApps(['Hiddify', 'sing-box', 'v2rayN (sing-box)'])}
</td>
<td>
${subQR('sub', 'singbox', 'BPB-Warp', 'Warp Subscription', true)}
Expand All @@ -777,7 +777,7 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</tr>
<tr>
<td>
${supportedApps(['Clash Meta', 'Clash Verge', 'v2rayN', 'FlClash', 'Stash'])}
${supportedApps(['Clash Meta', 'Clash Verge', 'FlClash', 'Stash', 'v2rayN (mihomo)'])}
</td>
<td>
${subQR('warpsub', 'clash', 'BPB-Warp', 'Warp Subscription')}
Expand Down Expand Up @@ -841,12 +841,12 @@ export async function renderHomePage (request, env, proxySettings, isPassSet) {
</div>
</div>
<hr>
<h2>YOUR IP 💡</h2>
<h2>MY IP 💡</h2>
<div class="table-container">
<table id="ips" style="text-align: center; margin-bottom: 15px; text-wrap-mode: nowrap;">
<tr>
<th>Target</th>
<th>Your IP</th>
<th>Target Address</th>
<th>IP</th>
<th>Country</th>
<th>City</th>
<th>ISP</th>
Expand Down

0 comments on commit 24d6367

Please sign in to comment.