mirror of
https://github.com/langgenius/dify.git
synced 2026-03-05 23:57:06 +08:00
chore: improve download graph log
This commit is contained in:
@ -42,6 +42,13 @@ const Header = () => {
|
||||
else
|
||||
setShowAccountSettingModal({ payload: ACCOUNT_SETTING_TAB.BILLING })
|
||||
}, [isFreePlan, setShowAccountSettingModal, setShowPricingModal])
|
||||
const handleDownloadGraphImportLog = useCallback(() => {
|
||||
void import('@/app/components/workflow/collaboration/core/collaboration-manager')
|
||||
.then(({ collaborationManager }) => {
|
||||
collaborationManager.downloadGraphImportLog()
|
||||
})
|
||||
.catch(() => {})
|
||||
}, [])
|
||||
|
||||
const renderLogo = () => (
|
||||
<h1>
|
||||
@ -106,6 +113,14 @@ const Header = () => {
|
||||
{!isCurrentWorkspaceDatasetOperator && <ToolsNav className={navClassName} />}
|
||||
</div>
|
||||
<div className="flex min-w-0 flex-[1] items-center justify-end pl-2 pr-3 min-[1280px]:pl-3">
|
||||
<button
|
||||
type="button"
|
||||
data-testid="workflow-import-log-download"
|
||||
className="left-full top-1/2 ml-1 h-3 w-3 -translate-y-1/2 opacity-0"
|
||||
aria-hidden="true"
|
||||
tabIndex={-1}
|
||||
onClick={handleDownloadGraphImportLog}
|
||||
/>
|
||||
<EnvNav />
|
||||
<div className="mr-2">
|
||||
<PluginsNav />
|
||||
|
||||
@ -1079,13 +1079,30 @@ export class CollaborationManager {
|
||||
}
|
||||
|
||||
downloadGraphImportLog(): void {
|
||||
if (this.graphImportLogs.length === 0)
|
||||
return
|
||||
|
||||
const reactFlowState = this.reactFlowStore?.getState()
|
||||
const payload = {
|
||||
appId: this.currentAppId,
|
||||
generatedAt: new Date().toISOString(),
|
||||
entries: this.graphImportLogs,
|
||||
summary: {
|
||||
logCount: this.graphImportLogs.length,
|
||||
leaderId: this.leaderId,
|
||||
isLeader: this.isLeader,
|
||||
graphViewActive: this.graphViewActive,
|
||||
pendingInitialSync: this.pendingInitialSync,
|
||||
isConnected: this.isConnected(),
|
||||
hasDoc: Boolean(this.doc),
|
||||
hasReactFlowStore: Boolean(this.reactFlowStore),
|
||||
onlineUsersCount: this.onlineUsers.length,
|
||||
crdtCounts: {
|
||||
nodes: this.getNodes().length,
|
||||
edges: this.getEdges().length,
|
||||
},
|
||||
reactFlowCounts: {
|
||||
nodes: reactFlowState?.getNodes().length ?? 0,
|
||||
edges: reactFlowState?.getEdges().length ?? 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
const stamp = new Date().toISOString().replace(/[:.]/g, '-')
|
||||
const appSuffix = this.currentAppId ?? 'unknown'
|
||||
|
||||
Reference in New Issue
Block a user