mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-27 04:40:37 +03:00
fix: correct section display name for json outbound
This commit is contained in:
@@ -61,6 +61,11 @@ export async function getDashboardSections(): Promise<IGetDashboardSectionsRespo
|
|||||||
(proxy) => proxy.code === `${section['.name']}-out`,
|
(proxy) => proxy.code === `${section['.name']}-out`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const parsedOutbound = JSON.parse(section.outbound_json);
|
||||||
|
const parsedTag = parsedOutbound?.tag ? decodeURIComponent(parsedOutbound?.tag) : undefined;
|
||||||
|
const proxyDisplayName = parsedTag || outbound?.value?.name || ''
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
withTagSelect: false,
|
withTagSelect: false,
|
||||||
code: outbound?.code || section['.name'],
|
code: outbound?.code || section['.name'],
|
||||||
@@ -68,10 +73,7 @@ export async function getDashboardSections(): Promise<IGetDashboardSectionsRespo
|
|||||||
outbounds: [
|
outbounds: [
|
||||||
{
|
{
|
||||||
code: outbound?.code || section['.name'],
|
code: outbound?.code || section['.name'],
|
||||||
displayName:
|
displayName: proxyDisplayName,
|
||||||
decodeURIComponent(JSON.parse(section.outbound_json)?.tag) ||
|
|
||||||
outbound?.value?.name ||
|
|
||||||
'',
|
|
||||||
latency: outbound?.value?.history?.[0]?.delay || 0,
|
latency: outbound?.value?.history?.[0]?.delay || 0,
|
||||||
type: outbound?.value?.type || '',
|
type: outbound?.value?.type || '',
|
||||||
selected: true,
|
selected: true,
|
||||||
|
|||||||
@@ -925,6 +925,9 @@ async function getDashboardSections() {
|
|||||||
const outbound = proxies.find(
|
const outbound = proxies.find(
|
||||||
(proxy) => proxy.code === `${section[".name"]}-out`
|
(proxy) => proxy.code === `${section[".name"]}-out`
|
||||||
);
|
);
|
||||||
|
const parsedOutbound = JSON.parse(section.outbound_json);
|
||||||
|
const parsedTag = parsedOutbound?.tag ? decodeURIComponent(parsedOutbound?.tag) : void 0;
|
||||||
|
const proxyDisplayName = parsedTag || outbound?.value?.name || "";
|
||||||
return {
|
return {
|
||||||
withTagSelect: false,
|
withTagSelect: false,
|
||||||
code: outbound?.code || section[".name"],
|
code: outbound?.code || section[".name"],
|
||||||
@@ -932,7 +935,7 @@ async function getDashboardSections() {
|
|||||||
outbounds: [
|
outbounds: [
|
||||||
{
|
{
|
||||||
code: outbound?.code || section[".name"],
|
code: outbound?.code || section[".name"],
|
||||||
displayName: decodeURIComponent(JSON.parse(section.outbound_json)?.tag) || outbound?.value?.name || "",
|
displayName: proxyDisplayName,
|
||||||
latency: outbound?.value?.history?.[0]?.delay || 0,
|
latency: outbound?.value?.history?.[0]?.delay || 0,
|
||||||
type: outbound?.value?.type || "",
|
type: outbound?.value?.type || "",
|
||||||
selected: true
|
selected: true
|
||||||
|
|||||||
Reference in New Issue
Block a user