diff --git a/app-dm/src/pages/ListPages/Training/Operation2.jsx b/app-dm/src/pages/ListPages/Training/Operation2.jsx index 34de325..976272b 100644 --- a/app-dm/src/pages/ListPages/Training/Operation2.jsx +++ b/app-dm/src/pages/ListPages/Training/Operation2.jsx @@ -113,10 +113,10 @@ function Operation2() { operateID }) const result=detectionSrc.data['result'] - if(result==='OK'){ - alert('连接成功') - }else{ + if(result==='NO'){ alert('连接失败') + }else{ + alert('连接成功') } }catch{ alert('detection出错') diff --git a/python/del.py b/python/del.py index b21fa5e..2dd7ca8 100644 --- a/python/del.py +++ b/python/del.py @@ -1,5 +1,5 @@ import k8s_func -studentList=['n20240101-53','s20240101-50','s20240102-50'] +studentList=['n20240101-55'] for i in studentList: k8s_func.delete_pod(i) diff --git a/python/k8s_func.py b/python/k8s_func.py index 06571b6..0c7a30b 100644 --- a/python/k8s_func.py +++ b/python/k8s_func.py @@ -76,7 +76,8 @@ def delete_pod(name): def check_dm(name): try: service = v1.read_namespaced_service(name=name + "-service", namespace=namespace) - db = dmPython.connect(user='SYSDBA', password='SYSDBA', host=service.spec.cluster_ip, port="5236") + print(service.spec.cluster_ip) + db = dmPython.connect(user='SYSDBA', password='SYSDBA', host=service.spec.cluster_ip) cursor = db.cursor() records = cursor.execute("SELECT * FROM V$VERSION").fetchall() for record in records: diff --git a/python/teacher_func.py b/python/teacher_func.py index a80968f..908569a 100644 --- a/python/teacher_func.py +++ b/python/teacher_func.py @@ -291,8 +291,8 @@ def SendLink(): Link = 'http://36.138.114.105:' + str(j['ports'][0]['node_port']) Link2 = 'http://36.138.114.105:' + str(j['ports'][1]['node_port']) Link3 = 'http://36.138.114.105:' + str(j['ports'][2]['node_port']) - cursor.execute(f"INSERT INTO TRAINSCORE VALUES (?,?,?,?,?,?,?,?,?)",( - i,i[0:6],testID,'false','NULL','NULL',Link,Link2,Link3 + cursor.execute(f"INSERT INTO TRAINSCORE VALUES (?,?,?,?,?,?,?,?,?,?)",( + i,i[0:6],testID,'false','NULL','NULL',Link,Link2,Link3,'NULL' )) else: pass @@ -304,8 +304,8 @@ def SendLink(): for j in item['list']: if j['name'] == name + '-service': Link = j['ip'] - cursor.execute(f"INSERT INTO TRAINSCORE VALUES (?,?,?,?,?,?,?,?,?)", ( - i, i[0:6], testID, 'false', 'NULL', 'NULL', Link, 'NULL', 'NULL' + cursor.execute(f"INSERT INTO TRAINSCORE VALUES (?,?,?,?,?,?,?,?,?,?)", ( + i, i[0:6], testID, 'false', 'NULL', 'NULL', Link, 'NULL', 'NULL','NULL' )) print('加入链接成功')