mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-12 14:37:03 +03:00
fix: correct proxy string label displaying on dashboard
This commit is contained in:
@@ -130,11 +130,7 @@ function createConfigSection(section) {
|
||||
}
|
||||
|
||||
try {
|
||||
const activeConfigs = value
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
.filter((line) => !line.startsWith('//'))
|
||||
.filter(Boolean);
|
||||
const activeConfigs = main.splitProxyString(value);
|
||||
|
||||
if (!activeConfigs.length) {
|
||||
return _(
|
||||
|
||||
@@ -771,6 +771,11 @@ function getClashWsUrl() {
|
||||
return `ws://${hostname}:9090`;
|
||||
}
|
||||
|
||||
// src/helpers/splitProxyString.ts
|
||||
function splitProxyString(str) {
|
||||
return str.split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("//")).filter(Boolean);
|
||||
}
|
||||
|
||||
// src/clash/methods/createBaseApiRequest.ts
|
||||
async function createBaseApiRequest(fetchFn) {
|
||||
try {
|
||||
@@ -899,6 +904,8 @@ async function getDashboardSections() {
|
||||
const outbound = proxies.find(
|
||||
(proxy) => proxy.code === `${section[".name"]}-out`
|
||||
);
|
||||
const activeConfigs = splitProxyString(section.proxy_string);
|
||||
const proxyDisplayName = getProxyUrlName(activeConfigs?.[0]) || outbound?.value?.name || "";
|
||||
return {
|
||||
withTagSelect: false,
|
||||
code: outbound?.code || section[".name"],
|
||||
@@ -906,7 +913,7 @@ async function getDashboardSections() {
|
||||
outbounds: [
|
||||
{
|
||||
code: outbound?.code || section[".name"],
|
||||
displayName: getProxyUrlName(section.proxy_string) || outbound?.value?.name || "",
|
||||
displayName: proxyDisplayName,
|
||||
latency: outbound?.value?.history?.[0]?.delay || 0,
|
||||
type: outbound?.value?.type || "",
|
||||
selected: true
|
||||
@@ -1897,6 +1904,7 @@ return baseclass.extend({
|
||||
onMount,
|
||||
parseValueList,
|
||||
renderDashboard,
|
||||
splitProxyString,
|
||||
triggerLatencyGroupTest,
|
||||
triggerLatencyProxyTest,
|
||||
triggerProxySelector,
|
||||
|
||||
Reference in New Issue
Block a user