mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
refactor(usage): 移除 RequestHeadersContent 中未使用的 diff props
移除 clientHeadersWithDiff 和 providerHeadersWithDiff 属性及相关计算逻辑
This commit is contained in:
@@ -554,8 +554,6 @@
|
|||||||
:current-header-data="currentHeaderData"
|
:current-header-data="currentHeaderData"
|
||||||
:current-expand-depth="currentExpandDepth"
|
:current-expand-depth="currentExpandDepth"
|
||||||
:has-provider-headers="hasProviderHeaders"
|
:has-provider-headers="hasProviderHeaders"
|
||||||
:client-headers-with-diff="clientHeadersWithDiff"
|
|
||||||
:provider-headers-with-diff="providerHeadersWithDiff"
|
|
||||||
:header-stats="headerStats"
|
:header-stats="headerStats"
|
||||||
:is-dark="isDark"
|
:is-dark="isDark"
|
||||||
/>
|
/>
|
||||||
@@ -588,8 +586,6 @@
|
|||||||
:current-header-data="currentResponseHeaderData"
|
:current-header-data="currentResponseHeaderData"
|
||||||
:current-expand-depth="currentExpandDepth"
|
:current-expand-depth="currentExpandDepth"
|
||||||
:has-provider-headers="hasProviderResponseHeaders"
|
:has-provider-headers="hasProviderResponseHeaders"
|
||||||
:client-headers-with-diff="[]"
|
|
||||||
:provider-headers-with-diff="[]"
|
|
||||||
:header-stats="responseHeaderStats"
|
:header-stats="responseHeaderStats"
|
||||||
:is-dark="isDark"
|
:is-dark="isDark"
|
||||||
:client-headers="detail.client_response_headers"
|
:client-headers="detail.client_response_headers"
|
||||||
@@ -1506,42 +1502,6 @@ const headerStats = computed(() => {
|
|||||||
return counts
|
return counts
|
||||||
})
|
})
|
||||||
|
|
||||||
const clientHeadersWithDiff = computed(() => {
|
|
||||||
if (!detail.value?.request_headers) return []
|
|
||||||
|
|
||||||
const headers = detail.value.request_headers
|
|
||||||
const result = []
|
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(headers)) {
|
|
||||||
const diffEntry = mergedHeaderEntries.value.find(e => e.key === key)
|
|
||||||
result.push({
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
status: diffEntry?.status || 'unchanged'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
const providerHeadersWithDiff = computed(() => {
|
|
||||||
if (!detail.value?.provider_request_headers) return []
|
|
||||||
|
|
||||||
const headers = detail.value.provider_request_headers
|
|
||||||
const result = []
|
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(headers)) {
|
|
||||||
const diffEntry = mergedHeaderEntries.value.find(e => e.key === key)
|
|
||||||
result.push({
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
status: diffEntry?.status || 'unchanged'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
// 添加 ESC 键监听
|
// 添加 ESC 键监听
|
||||||
useEscapeKey(() => {
|
useEscapeKey(() => {
|
||||||
if (props.isOpen) {
|
if (props.isOpen) {
|
||||||
|
|||||||
@@ -168,8 +168,6 @@ const props = withDefaults(defineProps<{
|
|||||||
currentHeaderData: Record<string, unknown> | null
|
currentHeaderData: Record<string, unknown> | null
|
||||||
currentExpandDepth: number
|
currentExpandDepth: number
|
||||||
hasProviderHeaders: boolean
|
hasProviderHeaders: boolean
|
||||||
clientHeadersWithDiff: Array<{ key: string; value: unknown; status: string }>
|
|
||||||
providerHeadersWithDiff: Array<{ key: string; value: unknown; status: string }>
|
|
||||||
headerStats: { added: number; modified: number; removed: number; unchanged: number }
|
headerStats: { added: number; modified: number; removed: number; unchanged: number }
|
||||||
isDark: boolean
|
isDark: boolean
|
||||||
// 泛化 props:允许传入任意 header 对和标签,用于复用为响应头对比
|
// 泛化 props:允许传入任意 header 对和标签,用于复用为响应头对比
|
||||||
@@ -179,6 +177,8 @@ const props = withDefaults(defineProps<{
|
|||||||
providerLabel?: string
|
providerLabel?: string
|
||||||
emptyMessage?: string
|
emptyMessage?: string
|
||||||
}>(), {
|
}>(), {
|
||||||
|
clientHeaders: undefined,
|
||||||
|
providerHeaders: undefined,
|
||||||
clientLabel: '客户端请求头',
|
clientLabel: '客户端请求头',
|
||||||
providerLabel: '提供商请求头',
|
providerLabel: '提供商请求头',
|
||||||
emptyMessage: '无请求头信息',
|
emptyMessage: '无请求头信息',
|
||||||
|
|||||||
Reference in New Issue
Block a user