From 04f132080e5f32ea3bdbce54152d373f1f0a6bbc Mon Sep 17 00:00:00 2001 From: wang <842355358@qq.com> Date: Sat, 13 Jul 2024 13:32:46 +0800 Subject: [PATCH 1/2] 1 --- app-dm/src/pages/ListPages/Training/Operation2.jsx | 2 +- python/k8s_func.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app-dm/src/pages/ListPages/Training/Operation2.jsx b/app-dm/src/pages/ListPages/Training/Operation2.jsx index ab4ca15..2bbb197 100644 --- a/app-dm/src/pages/ListPages/Training/Operation2.jsx +++ b/app-dm/src/pages/ListPages/Training/Operation2.jsx @@ -133,7 +133,7 @@ function Operation2() { operateID }) const result=detectionSrc.data['result'] - if(result==='NO'){ + if(result.includes('NO')){ alert('连接失败') setTrainScore(0) }else{ diff --git a/python/k8s_func.py b/python/k8s_func.py index c9f76e7..a3b474d 100644 --- a/python/k8s_func.py +++ b/python/k8s_func.py @@ -1,6 +1,7 @@ import json import traceback +import dmPython.dmPython import yaml from kubernetes import client, config from flask import jsonify From 1fb0a0a4dd32e051b5e4264d6471a4be52c4186a Mon Sep 17 00:00:00 2001 From: wang <842355358@qq.com> Date: Sat, 13 Jul 2024 15:33:35 +0800 Subject: [PATCH 2/2] 1qq1 --- app-dm/src/pages/ListPages/Training/Operation2.jsx | 7 ++++--- app-dm/src/setupTests.js | 2 +- python/k8s_func.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app-dm/src/pages/ListPages/Training/Operation2.jsx b/app-dm/src/pages/ListPages/Training/Operation2.jsx index 2bbb197..6433a98 100644 --- a/app-dm/src/pages/ListPages/Training/Operation2.jsx +++ b/app-dm/src/pages/ListPages/Training/Operation2.jsx @@ -132,7 +132,7 @@ function Operation2() { student_ID, operateID }) - const result=detectionSrc.data['result'] + const result=detectionSrc.data if(result.includes('NO')){ alert('连接失败') setTrainScore(0) @@ -140,8 +140,9 @@ function Operation2() { alert('连接成功') setTrainScore(50) } - }catch{ - alert('detection出错') + }catch(err){ + console.log(err) + alert('detection出错 ') } } diff --git a/app-dm/src/setupTests.js b/app-dm/src/setupTests.js index 141e479..f51a415 100644 --- a/app-dm/src/setupTests.js +++ b/app-dm/src/setupTests.js @@ -1,5 +1,5 @@ // jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom +// learn more: https://github.com/testing-library/jest-do m import '@testing-library/jest-dom'; diff --git a/python/k8s_func.py b/python/k8s_func.py index a3b474d..cc15004 100644 --- a/python/k8s_func.py +++ b/python/k8s_func.py @@ -1,7 +1,7 @@ import json import traceback -import dmPython.dmPython + import yaml from kubernetes import client, config from flask import jsonify