mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Execution details support loading status
This commit is contained in:
parent
757cff4837
commit
1f7ae78b8a
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue