Skip to content

Commit

Permalink
fix(frontend): 人工确认问题修复 #8288
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia committed Nov 29, 2024
1 parent d47d8c2 commit ea4630a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3681,7 +3681,6 @@
"点击上传": "点击上传",
"请选择本地 SQL 文件": "请选择本地 SQL 文件",
"实际内存分配比率": "实际内存分配比率",
"忽略错误": "忽略错误",
"迁移提交成功": "迁移提交成功",
"集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。": "集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。",
"迁移": "迁移",
Expand All @@ -3702,5 +3701,7 @@
"Master 实例": "Master 实例",
"请先选择主机": "请先选择主机",
"集群或实例状态异常,不可选择": "集群或实例状态异常,不可选择",
"忽略错误": "忽略错误",
"强制失败节点成功": "强制失败节点成功",
"这行勿动!新增翻译请在上一行添加!": ""
}
39 changes: 28 additions & 11 deletions dbm-ui/frontend/src/views/task-history/pages/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@

import {
batchRetryNodes,
forceFailflowNode,
// forceFailflowNode,
getTaskflowDetails,
retryTaskflowNode,
revokePipeline,
Expand Down Expand Up @@ -695,7 +695,7 @@
watch(todoNodesCount, () => {
// isFindFirstLeafTodoNode = false
expandTodoNodeObjects = []
const todoNodeIdList = getTodoNodeIdList(flowState.details)
const todoNodeIdList = getTodoNodeIdList(flowState.details);
todoNodesTreeData.value = todoNodeIdList.length ? generateTodoNodesTree(flowState.details.activities, todoNodeIdList) : [];

setTreeOpen([
Expand Down Expand Up @@ -832,16 +832,17 @@
const handleTreeNodeClick = (node: TaskflowList[number], treeRef: Ref, showLog = true, theme: 'error' | 'warning') => {
// eslint-disable-next-line no-underscore-dangle
const { scale } = flowState.instance.flowInstance._diagramInstance._canvasTransform;
const isErrorTree = theme === 'error';

expandRetractNodes(node, treeRef, showLog)

setTimeout(() => {
const graphNode = flowState.instance.graphData.locations.find((item: GraphNode) => item.data.id === node.id);
if (showLog) {
if (showLog && isErrorTree) {
handleShowLog(graphNode);
}

const children = theme === 'error' ? node.failedChildren : node.todoChildren;
const children = isErrorTree ? node.failedChildren : node.todoChildren;
if (!children) {
const x = ((flowRef.value!.clientWidth / 2) - graphNode.x) * scale;
const y = ((flowRef.value!.clientHeight / 2) - graphNode.y - 128) * scale;
Expand Down Expand Up @@ -1017,13 +1018,29 @@
* 强制失败节点
*/
const handleForceFail = (node: GraphNode) => {
forceFailflowNode({
root_id: rootId.value,
node_id: node.data.id,
}).then(() => {
renderNodes();
fetchTaskflowDetails();
});
const todoItem = flowState.details.todos!.find(todoItem => todoItem.context.node_id === node.id)
if (todoItem) {
ticketBatchProcessTodo({
action: "TERMINATE",
operations: [
{
todo_id: todoItem.id,
params: {}
}
]})
.then(() => {
renderNodes();
fetchTaskflowDetails();
messageSuccess(t('强制失败节点成功'));
})
}
// forceFailflowNode({
// root_id: rootId.value,
// node_id: node.data.id,
// }).then(() => {
// renderNodes();
// fetchTaskflowDetails();
// });
};

const handleTodoAllPipeline = () => {
Expand Down

0 comments on commit ea4630a

Please sign in to comment.