feat: Execution details support loading status
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2025-11-25 11:09:55 +08:00
parent 757cff4837
commit 1f7ae78b8a
3 changed files with 27 additions and 5 deletions

View File

@ -54,7 +54,23 @@ class KnowledgeWorkflowManage(WorkflowManage):
pass
self.work_flow_post_handler.handler(self)
@staticmethod
def get_node_details(current_node, node, index):
if current_node == node:
return {
'name': node.node.properties.get('stepName'),
"index": index,
'run_time': 0,
'type': node.type,
'status': 202,
'err_message': ""
}
return node.get_details(index)
def run_chain(self, current_node, node_result_future=None):
QuerySet(KnowledgeAction).filter(id=self.params.get('knowledge_action_id')).update(
details=self.get_runtime_details(lambda node, index: self.get_node_details(current_node, node, index)))
if node_result_future is None:
node_result_future = self.run_node_future(current_node)
try:

View File

@ -544,7 +544,7 @@ class WorkflowManage:
return self._has_next_node(self.get_start_node() if self.current_node is None else self.current_node,
node_result)
def get_runtime_details(self):
def get_runtime_details(self, get_details=lambda n, index: n.get_details(index)):
details_result = {}
for index in range(len(self.node_context)):
node = self.node_context[index]
@ -553,7 +553,7 @@ class WorkflowManage:
if details is not None and self.start_node.runtime_node_id != node.runtime_node_id:
details_result[node.runtime_node_id] = details
continue
details = node.get_details(index)
details = get_details(node, index)
details['node_id'] = node.id
details['up_node_id_list'] = node.up_node_id_list
details['runtime_node_id'] = node.runtime_node_id

View File

@ -27,10 +27,15 @@
"
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
>
<span class="mr-16 color-secondary">{{ data?.run_time?.toFixed(2) || 0.0 }} s</span>
<span class="mr-16 color-secondary" v-if="data.status != 202"
>{{ data?.run_time?.toFixed(2) || 0.0 }} s</span
>
<el-icon class="color-success" :size="16" v-if="data.status === 200">
<CircleCheck />
</el-icon>
<el-icon class="is-loading" :size="16" v-else-if="data.status === 202">
<Loading />
</el-icon>
<el-icon class="color-danger" :size="16" v-else>
<CircleClose />
</el-icon>
@ -896,11 +901,12 @@
:key="groupI"
>
<h5 class="p-8-12">
{{ group.label+ ' '+ $t('common.param.inputParam') }}
{{ group.label + ' ' + $t('common.param.inputParam') }}
</h5>
<div class="p-8-12 border-t-dashed lighter">
<div v-for="(f, i) in group.variable_list" :key="i" class="mb-8">
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span> {{ f.value }}
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span>
{{ f.value }}
</div>
</div>
</div>