mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: 修复对话视图合并后的问题
- 移除未使用的变量 index - 修复展开/收缩按钮在非请求体Tab被禁用的问题 - 删除未使用的 copyJsonToClipboard 函数 Co-Authored-By: LewisPen <LewisPen@nyadoo.com>
This commit is contained in:
@@ -393,10 +393,10 @@
|
|||||||
<button
|
<button
|
||||||
:title="currentExpandDepth === 0 ? '展开全部' : '收缩全部'"
|
:title="currentExpandDepth === 0 ? '展开全部' : '收缩全部'"
|
||||||
class="p-1.5 rounded transition-colors"
|
class="p-1.5 rounded transition-colors"
|
||||||
:class="viewMode === 'compare' || contentViewMode === 'conversation'
|
:class="viewMode === 'compare' || (supportsConversationView && contentViewMode === 'conversation')
|
||||||
? 'text-muted-foreground/40 cursor-not-allowed'
|
? 'text-muted-foreground/40 cursor-not-allowed'
|
||||||
: 'text-muted-foreground hover:bg-muted'"
|
: 'text-muted-foreground hover:bg-muted'"
|
||||||
:disabled="viewMode === 'compare' || contentViewMode === 'conversation'"
|
:disabled="viewMode === 'compare' || (supportsConversationView && contentViewMode === 'conversation')"
|
||||||
@click="currentExpandDepth === 0 ? expandAll() : collapseAll()"
|
@click="currentExpandDepth === 0 ? expandAll() : collapseAll()"
|
||||||
>
|
>
|
||||||
<Maximize2
|
<Maximize2
|
||||||
@@ -880,42 +880,6 @@ function getTierRangeText(tier: { up_to?: number | null }, index: number, tiers:
|
|||||||
return `> ${formatNumber(start)} tokens`
|
return `> ${formatNumber(start)} tokens`
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyJsonToClipboard(tabName: string) {
|
|
||||||
if (!detail.value) return
|
|
||||||
// 对比模式下不允许复制
|
|
||||||
if (viewMode.value === 'compare') return
|
|
||||||
|
|
||||||
let data: any = null
|
|
||||||
switch (tabName) {
|
|
||||||
case 'request-headers':
|
|
||||||
// 根据当前数据源选择要复制的数据
|
|
||||||
data = dataSource.value === 'provider'
|
|
||||||
? detail.value.provider_request_headers
|
|
||||||
: detail.value.request_headers
|
|
||||||
break
|
|
||||||
case 'request-body':
|
|
||||||
data = detail.value.request_body
|
|
||||||
break
|
|
||||||
case 'response-headers':
|
|
||||||
data = actualResponseHeaders.value
|
|
||||||
break
|
|
||||||
case 'response-body':
|
|
||||||
data = detail.value.response_body
|
|
||||||
break
|
|
||||||
case 'metadata':
|
|
||||||
data = detail.value.metadata
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
copyToClipboard(JSON.stringify(data, null, 2), false)
|
|
||||||
copiedStates.value[tabName] = true
|
|
||||||
setTimeout(() => {
|
|
||||||
copiedStates.value[tabName] = false
|
|
||||||
}, 2000)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 复制内容(支持 JSON 和对话两种模式)
|
// 复制内容(支持 JSON 和对话两种模式)
|
||||||
function copyContent(tabName: string) {
|
function copyContent(tabName: string) {
|
||||||
if (!detail.value) return
|
if (!detail.value) return
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ function extractClaudeStreamResponse(chunks: any[]): ExtractedConversation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转换为消息
|
// 转换为消息
|
||||||
for (const [index, block] of Array.from(blocks.entries()).sort((a, b) => a[0] - b[0])) {
|
for (const [, block] of Array.from(blocks.entries()).sort((a, b) => a[0] - b[0])) {
|
||||||
result.messages.push({
|
result.messages.push({
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
content: block.parts.join(''),
|
content: block.parts.join(''),
|
||||||
|
|||||||
Reference in New Issue
Block a user