Expose dev subscription headers without HWID
This commit is contained in:
@@ -142,6 +142,7 @@ const MAIN_PROFILE_ID = 'main-profile';
|
||||
const LOCAL_SINGBOX_TARGET_ID = 'local-singbox';
|
||||
const LOG_VISIBLE_MS = 6500;
|
||||
const PANEL_ORDER: PanelId[] = ['proxifyre', 'summary', 'proxy'];
|
||||
const SHOW_DEV_SUBSCRIPTION_IDENTITY = import.meta.env.DEV;
|
||||
const proxyWardenToggleOnImage = new URL('../assets/proxywarden-toggle-on.png', import.meta.url).href;
|
||||
const proxyWardenToggleOffImage = new URL('../assets/proxywarden-toggle-off.png', import.meta.url).href;
|
||||
|
||||
@@ -1381,7 +1382,13 @@ export function App() {
|
||||
inlineActions={(
|
||||
<DetailsPopover
|
||||
className="setup-summary"
|
||||
details={singBoxDetailLines(singbox, singBoxStatus, singBoxSetupStatus, selectedServerTag)}
|
||||
details={singBoxDetailLines(
|
||||
singbox,
|
||||
singBoxStatus,
|
||||
singBoxSetupStatus,
|
||||
selectedServerTag,
|
||||
SHOW_DEV_SUBSCRIPTION_IDENTITY,
|
||||
)}
|
||||
popoverLabel="Состав Local sing-box"
|
||||
aria-label={`Подробности Local sing-box: ${setupSummary}`}
|
||||
>
|
||||
@@ -2552,6 +2559,7 @@ function singBoxDetailLines(
|
||||
status: LocalSingBoxStatusResponse | null,
|
||||
setupStatus: SingBoxSetupStatus | null,
|
||||
selectedServerTag: string | undefined,
|
||||
showDevSubscriptionIdentity = false,
|
||||
) {
|
||||
const setupDetails = setupStatus
|
||||
? setupStatus.items
|
||||
@@ -2559,7 +2567,7 @@ function singBoxDetailLines(
|
||||
.join('; ')
|
||||
: 'состав не проверен';
|
||||
|
||||
return [
|
||||
const details = [
|
||||
`Локально: ${localSingBoxAddress(status)}`,
|
||||
`LAN: ${lanSingBoxAddress(status) ?? 'недоступен'}`,
|
||||
`Сервер: ${selectedServerTag ? displayServerTag(selectedServerTag) : 'не выбран'}`,
|
||||
@@ -2568,6 +2576,30 @@ function singBoxDetailLines(
|
||||
`Подписка: ${status?.config.subscriptionDisplayUrl ?? (status?.config.hasSubscription ? 'сохранена' : 'не загружена')}`,
|
||||
`Состав: ${setupDetails}`,
|
||||
];
|
||||
|
||||
if (showDevSubscriptionIdentity) {
|
||||
details.push(...subscriptionIdentityDetailLines(status));
|
||||
}
|
||||
|
||||
return details;
|
||||
}
|
||||
|
||||
function subscriptionIdentityDetailLines(status: LocalSingBoxStatusResponse | null) {
|
||||
const headers = status?.subscriptionIdentity?.headers
|
||||
?.filter((header) => header.name.trim().toLowerCase() !== 'x-hwid') ?? [];
|
||||
|
||||
if (!headers.length) return ['Dev headers подписки: недоступны'];
|
||||
|
||||
const details = [
|
||||
'Dev headers подписки (без HWID):',
|
||||
...headers.map((header) => `${header.name}: ${header.value || 'пусто'}`),
|
||||
];
|
||||
const sendsLegacyOsVersion = headers.some((header) => header.name.trim().toLowerCase() === 'x-ver-os');
|
||||
if (!sendsLegacyOsVersion) {
|
||||
details.push('X-Ver-OS: не отправится, версия ОС не определена');
|
||||
}
|
||||
|
||||
return details;
|
||||
}
|
||||
|
||||
function componentDetails(component: ComponentStatus | undefined, checking: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user