From de3fff164ed8853ca580135db6854051dcf06077 Mon Sep 17 00:00:00 2001 From: 30404 <3040471803@qq.com> Date: Mon, 24 Jun 2024 20:04:31 +0800 Subject: [PATCH 1/5] 1 --- app-dm/src/setupProxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-dm/src/setupProxy.js b/app-dm/src/setupProxy.js index d5f0756..0c8ba35 100644 --- a/app-dm/src/setupProxy.js +++ b/app-dm/src/setupProxy.js @@ -7,5 +7,5 @@ module.exports = function(app) { target: 'http://localhost:5000', // 目标后端服务地址 changeOrigin: true, }) - ); + ); }; \ No newline at end of file From 9d08bddb4529a1e92aa85298fc5cf6675368e79d Mon Sep 17 00:00:00 2001 From: 30404 <3040471803@qq.com> Date: Tue, 25 Jun 2024 12:51:35 +0800 Subject: [PATCH 2/5] 6.25 --- .../src/TeacherPages/MarkingPages/Marking.jsx | 7 +- app-dm/src/TeacherPages/SendTest/SendTest.jsx | 4 + .../src/TeacherPages/SendTest/trainmanage.jsx | 5 + .../src/TeacherPages/SendTrain/SendTrain.jsx | 4 + app-dm/src/TeacherPages/TeacherPage.jsx | 27 +- .../TeacherPages/classlistpages/classId.jsx | 5 + .../teachermanagetest/ManageTest.jsx | 6 +- app-dm/src/pages/Home/Home.jsx | 21 +- .../pages/ListPages/Analyse/AnalysePages.jsx | 4 + app-dm/src/pages/ListPages/Subject/Exam.jsx | 6 +- .../pages/ListPages/Subject/SubjectPage.jsx | 4 + .../pages/ListPages/Training/Operation1.css | 10 + .../pages/ListPages/Training/Operation1.jsx | 60 +- .../pages/ListPages/Training/TrainingPage.jsx | 4 + python/app.py | 8 + python/k8s.py | 3 + python/test.txt | 1146 +++++++++++++++++ 17 files changed, 1271 insertions(+), 53 deletions(-) create mode 100644 python/k8s.py create mode 100644 python/test.txt diff --git a/app-dm/src/TeacherPages/MarkingPages/Marking.jsx b/app-dm/src/TeacherPages/MarkingPages/Marking.jsx index bce9e56..2f08a58 100644 --- a/app-dm/src/TeacherPages/MarkingPages/Marking.jsx +++ b/app-dm/src/TeacherPages/MarkingPages/Marking.jsx @@ -6,7 +6,12 @@ import Test from '../../pages/Home/img/test.jpg' // 批改 function Marking(){ - + const teacher_ID=localStorage.getItem('islogin') + if(teacher_ID==null){ + alert('登录过期,请重新登录') + window.location.href='http://localhost:3000/signin' + } + return(
diff --git a/app-dm/src/TeacherPages/classlistpages/classid.css b/app-dm/src/TeacherPages/classlistpages/classid.css index 3008514..6b95246 100644 --- a/app-dm/src/TeacherPages/classlistpages/classid.css +++ b/app-dm/src/TeacherPages/classlistpages/classid.css @@ -53,7 +53,7 @@ } #body-right-student-box td { padding: 10px; - border: 1px solid #ccc; + border-bottom: 1px solid #ccc; text-align: center; } .box-content { @@ -98,4 +98,11 @@ .bar{ position: absolute; top: 10px; +} +.studentName{ + margin-top: 20px; + font-size: 18px; + width: 72px; + margin-left: 50px; + border: 1px solid black; } \ No newline at end of file diff --git a/app-dm/src/nav/nav.jsx b/app-dm/src/nav/nav.jsx index a776bbe..a02e548 100644 --- a/app-dm/src/nav/nav.jsx +++ b/app-dm/src/nav/nav.jsx @@ -12,7 +12,7 @@ import Computer from '../pages/Home/img/training.jpg'; function HeaderNav() { const outlog=()=>{ - localStorage.removeItem('islogin') + localStorage.clear() // setisChecked(false) alert('注销成功') window.location.href='http://36.138.114.105:30294/signin' diff --git a/app-dm/src/nav/teacherIndex.jsx b/app-dm/src/nav/teacherIndex.jsx index 5bc3e34..f01c04b 100644 --- a/app-dm/src/nav/teacherIndex.jsx +++ b/app-dm/src/nav/teacherIndex.jsx @@ -12,7 +12,7 @@ import Logo from '../pages/Home/img/logo.jpg' function HeaderNavTeacher() { const outlog=()=>{ - localStorage.removeItem('islogin') + localStorage.clear() // setisChecked(false) alert('注销成功') window.location.href='http://36.138.114.105:30294/signin' diff --git a/app-dm/src/pages/ListPages/Training/Operation1.jsx b/app-dm/src/pages/ListPages/Training/Operation1.jsx index 76a8ef3..a487a7f 100644 --- a/app-dm/src/pages/ListPages/Training/Operation1.jsx +++ b/app-dm/src/pages/ListPages/Training/Operation1.jsx @@ -14,17 +14,17 @@ function Operation1() { console.log(answeredJudge); } const clear=()=>{ - localStorage.clear('choice_answers'); + localStorage.removeItem('choice_answers'); setchoice_answer({}) - localStorage.clear('completion_answer') + localStorage.removeItem('completion_answer') setcompletion_answer({}) - localStorage.clear('judge_answer') + localStorage.removeItem('judge_answer') setjudge_answer({}) - localStorage.clear('answeredChoice') + localStorage.removeItem('answeredChoice') setAnsweredChoice([]) - localStorage.clear('answeredComple') + localStorage.removeItem('answeredComple') setAnsweredComple([]) - localStorage.clear('answeredJudge') + localStorage.removeItem('answeredJudge') setAnsweredJudge([]) } diff --git a/app-dm/src/setupProxy.js b/app-dm/src/setupProxy.js index 0c8ba35..f7ade0b 100644 --- a/app-dm/src/setupProxy.js +++ b/app-dm/src/setupProxy.js @@ -4,7 +4,7 @@ module.exports = function(app) { app.use( '/api', // 如果请求路径匹配'/api',则进行代理 createProxyMiddleware({ - target: 'http://localhost:5000', // 目标后端服务地址 + target: 'http://36.138.114.105:32087/', // 目标后端服务地址 changeOrigin: true, }) ); diff --git a/python/app.py b/python/app.py index debb11f..76cdd08 100644 --- a/python/app.py +++ b/python/app.py @@ -232,6 +232,9 @@ def SendTrainTest(): return '发布成功' +@app.route('/api/Find_details',methods=["POST"]) +def Find_details(): + return 'a' @app.route('/api/student-test',methods=["POST"]) def student_test(): diff --git a/python/student_func.py b/python/student_func.py index aaaf9bb..6eea386 100644 --- a/python/student_func.py +++ b/python/student_func.py @@ -190,7 +190,6 @@ def find_end_test(ID): TEST_ID = cursor.fetchall() for i in TEST_ID: testID.append(i[0]) - print(i) return testID # find_end_test('20240101') diff --git a/python/teacher_func.py b/python/teacher_func.py index 21ef154..a9e62f3 100644 --- a/python/teacher_func.py +++ b/python/teacher_func.py @@ -254,3 +254,32 @@ def SendTrainTestFunc(TrainChoice,TrainCompletion,TrainJudge,Hour,Min,StopTime,C db.commit() cursor.close() return '发布成功' + + +def Find_dic(dic): + # 获取字典的键,并按照从大到小的顺序排序 + keys_sorted = sorted(dic.keys(), reverse=True) + + # 取最后三个键 + last_three_keys = keys_sorted[:3] + + # 输出对应的值或进行进一步处理 + for key in last_three_keys: + print(dic[key]) # 这里假设你想打印每个键对应的值,可以根据需求进行处理 + print(dic) + + + +def Find_details(ID,teacher_ID): + dic={} + subject=fetch_subject(teacher_ID) + cursor = db.cursor() + cursor.execute(f"SELECT * FROM STUDENT_TEST WHERE STUDENT_ID=? AND TF='true' AND SUBJECT=? ",(ID,subject)) + data=cursor.fetchall() + for i in data: + dic[i[3]]=i + cursor.close() + + Find_dic(dic) + return dic +Find_details('20240101','111111') From f5dbab3a28e7d0e0c39716140ca04c416e9687c5 Mon Sep 17 00:00:00 2001 From: 30404 <3040471803@qq.com> Date: Tue, 25 Jun 2024 18:44:22 +0800 Subject: [PATCH 4/5] 6.25,18.44 --- python/k8s.py | 3 - python/test.txt | 1146 ----------------------------------------------- 2 files changed, 1149 deletions(-) delete mode 100644 python/k8s.py delete mode 100644 python/test.txt diff --git a/python/k8s.py b/python/k8s.py deleted file mode 100644 index d6f2c04..0000000 --- a/python/k8s.py +++ /dev/null @@ -1,3 +0,0 @@ -import json -def list_pods(): - return json.load('test.txt') \ No newline at end of file diff --git a/python/test.txt b/python/test.txt deleted file mode 100644 index 1ad4581..0000000 --- a/python/test.txt +++ /dev/null @@ -1,1146 +0,0 @@ -{'api_version': 'v1', - 'items': [{'api_version': None, - 'kind': None, - 'metadata': {'annotations': {'cni.projectcalico.org/containerID': '80f99777d7ba3e1b1ff45fb37d05ac5f6a147eed9b36a871c9e94d645a546c21', - 'cni.projectcalico.org/podIP': '10.233.57.173/32', - 'cni.projectcalico.org/podIPs': '10.233.57.173/32'}, - 'creation_timestamp': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc()), - 'deletion_grace_period_seconds': None, - 'deletion_timestamp': None, - 'finalizers': None, - 'generate_name': 'database-dmserver-', - 'generation': None, - 'labels': {'app': 'database', - 'controller-revision-hash': 'database-dmserver-7987c67c5b', - 'operator.dameng.com/canvas': 'database', - 'operator.dameng.com/controller': 'statefulSet', - 'operator.dameng.com/instance': 'dmserver-dmdbms-l2cvn7i0', - 'operator.dameng.com/service': 'stateful-1650779755715-dmdbms-l2cvn7i0', - 'statefulset.kubernetes.io/pod-name': 'database-dmserver-0'}, - 'managed_fields': [{'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:annotations': {'.': {}, - 'f:cni.projectcalico.org/containerID': {}, - 'f:cni.projectcalico.org/podIP': {}, - 'f:cni.projectcalico.org/podIPs': {}}}}, - 'manager': 'calico', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:generateName': {}, - 'f:labels': {'.': {}, - 'f:app': {}, - 'f:controller-revision-hash': {}, - 'f:operator.dameng.com/canvas': {}, - 'f:operator.dameng.com/controller': {}, - 'f:operator.dameng.com/instance': {}, - 'f:operator.dameng.com/service': {}, - 'f:statefulset.kubernetes.io/pod-name': {}}, - 'f:ownerReferences': {'.': {}, - 'k:{"uid":"c774430f-94c8-42b9-a701-bc1d9dbf4b56"}': {}}}, - 'f:spec': {'f:containers': {'k:{"name":"database"}': {'.': {}, - 'f:env': {'.': {}, - 'k:{"name":"DMCCA_CANVAS_NAME"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMCCA_CANVAS_NAMESPACE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_ARCH_FLAG"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_CASE_SENSITIVE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_CHARSET"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_EXTENT_SIZE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_LENGTH_IN_CHAR"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_LOG_SIZE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMINIT_PAGE_SIZE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DM_INI_MAX_SESSIONS"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"TZ"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}}, - 'f:image': {}, - 'f:imagePullPolicy': {}, - 'f:livenessProbe': {'.': {}, - 'f:failureThreshold': {}, - 'f:initialDelaySeconds': {}, - 'f:periodSeconds': {}, - 'f:successThreshold': {}, - 'f:tcpSocket': {'.': {}, - 'f:port': {}}, - 'f:timeoutSeconds': {}}, - 'f:name': {}, - 'f:readinessProbe': {'.': {}, - 'f:failureThreshold': {}, - 'f:periodSeconds': {}, - 'f:successThreshold': {}, - 'f:tcpSocket': {'.': {}, - 'f:port': {}}, - 'f:timeoutSeconds': {}}, - 'f:resources': {'.': {}, - 'f:limits': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}, - 'f:requests': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}}, - 'f:terminationMessagePath': {}, - 'f:terminationMessagePolicy': {}, - 'f:volumeMounts': {'.': {}, - 'k:{"mountPath":"/opt/dmdbms/data"}': {'.': {}, - 'f:mountPath': {}, - 'f:name': {}}, - 'k:{"mountPath":"/opt/dmdbms/log"}': {'.': {}, - 'f:mountPath': {}, - 'f:name': {}}}}}, - 'f:dnsPolicy': {}, - 'f:enableServiceLinks': {}, - 'f:hostname': {}, - 'f:restartPolicy': {}, - 'f:schedulerName': {}, - 'f:securityContext': {'.': {}, - 'f:fsGroup': {}, - 'f:runAsGroup': {}, - 'f:runAsUser': {}}, - 'f:subdomain': {}, - 'f:terminationGracePeriodSeconds': {}, - 'f:volumes': {'.': {}, - 'k:{"name":"data"}': {'.': {}, - 'f:name': {}, - 'f:persistentVolumeClaim': {'.': {}, - 'f:claimName': {}}}, - 'k:{"name":"database-4e332eab0df907f56edf8b460018f3ba"}': {'.': {}, - 'f:hostPath': {'.': {}, - 'f:path': {}, - 'f:type': {}}, - 'f:name': {}}}}}, - 'manager': 'kube-controller-manager', - 'operation': 'Update', - 'subresource': None, - 'time': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:status': {'f:conditions': {'k:{"type":"ContainersReady"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Initialized"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Ready"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}}, - 'f:containerStatuses': {}, - 'f:hostIP': {}, - 'f:phase': {}, - 'f:podIP': {}, - 'f:podIPs': {'.': {}, - 'k:{"ip":"10.233.57.173"}': {'.': {}, - 'f:ip': {}}}, - 'f:startTime': {}}}, - 'manager': 'kubelet', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 21, 18, 46, 26, tzinfo=tzutc())}], - 'name': 'database-dmserver-0', - 'namespace': 'cnsof50011836-system', - 'owner_references': [{'api_version': 'apps/v1', - 'block_owner_deletion': True, - 'controller': True, - 'kind': 'StatefulSet', - 'name': 'database-dmserver', - 'uid': 'c774430f-94c8-42b9-a701-bc1d9dbf4b56'}], - 'resource_version': '20606607', - 'self_link': None, - 'uid': '1e02bdf3-4099-42df-8d25-8c4545c937a7'}, - 'spec': {'active_deadline_seconds': None, - 'affinity': None, - 'automount_service_account_token': None, - 'containers': [{'args': None, - 'command': None, - 'env': [{'name': 'DMCCA_CANVAS_NAME', - 'value': 'database', - 'value_from': None}, - {'name': 'DMCCA_CANVAS_NAMESPACE', - 'value': 'cnsof50011836-system', - 'value_from': None}, - {'name': 'TZ', - 'value': 'Asia/Shanghai', - 'value_from': None}, - {'name': 'DMINIT_EXTENT_SIZE', - 'value': '16', - 'value_from': None}, - {'name': 'DMINIT_PAGE_SIZE', - 'value': '8', - 'value_from': None}, - {'name': 'DMINIT_LOG_SIZE', - 'value': '256', - 'value_from': None}, - {'name': 'DMINIT_CASE_SENSITIVE', - 'value': 'Y', - 'value_from': None}, - {'name': 'DMINIT_CHARSET', - 'value': '0', - 'value_from': None}, - {'name': 'DMINIT_LENGTH_IN_CHAR', - 'value': '0', - 'value_from': None}, - {'name': 'DMINIT_ARCH_FLAG', - 'value': '1', - 'value_from': None}, - {'name': 'DM_INI_MAX_SESSIONS', - 'value': '1000', - 'value_from': None}], - 'env_from': None, - 'image': 'harbor.dameng.io/dmcca/dmdbms:8_20240220', - 'image_pull_policy': 'IfNotPresent', - 'lifecycle': None, - 'liveness_probe': {'_exec': None, - 'failure_threshold': 3, - 'grpc': None, - 'http_get': None, - 'initial_delay_seconds': 120, - 'period_seconds': 10, - 'success_threshold': 1, - 'tcp_socket': {'host': None, - 'port': 5236}, - 'termination_grace_period_seconds': None, - 'timeout_seconds': 1}, - 'name': 'database', - 'ports': None, - 'readiness_probe': {'_exec': None, - 'failure_threshold': 3, - 'grpc': None, - 'http_get': None, - 'initial_delay_seconds': None, - 'period_seconds': 10, - 'success_threshold': 1, - 'tcp_socket': {'host': None, - 'port': 5236}, - 'termination_grace_period_seconds': None, - 'timeout_seconds': 1}, - 'resize_policy': None, - 'resources': {'claims': None, - 'limits': {'cpu': '1', - 'memory': '2Gi'}, - 'requests': {'cpu': '0', - 'memory': '0'}}, - 'restart_policy': None, - 'security_context': None, - 'startup_probe': None, - 'stdin': None, - 'stdin_once': None, - 'termination_message_path': '/dev/termination-log', - 'termination_message_policy': 'File', - 'tty': None, - 'volume_devices': None, - 'volume_mounts': [{'mount_path': '/opt/dmdbms/data', - 'mount_propagation': None, - 'name': 'data', - 'read_only': None, - 'recursive_read_only': None, - 'sub_path': None, - 'sub_path_expr': None}, - {'mount_path': '/opt/dmdbms/log', - 'mount_propagation': None, - 'name': 'database-4e332eab0df907f56edf8b460018f3ba', - 'read_only': None, - 'recursive_read_only': None, - 'sub_path': None, - 'sub_path_expr': None}, - {'mount_path': '/var/run/secrets/kubernetes.io/serviceaccount', - 'mount_propagation': None, - 'name': 'kube-api-access-lmqf7', - 'read_only': True, - 'recursive_read_only': None, - 'sub_path': None, - 'sub_path_expr': None}], - 'working_dir': None}], - 'dns_config': None, - 'dns_policy': 'ClusterFirst', - 'enable_service_links': False, - 'ephemeral_containers': None, - 'host_aliases': None, - 'host_ipc': None, - 'host_network': None, - 'host_pid': None, - 'host_users': None, - 'hostname': 'database-dmserver-0', - 'image_pull_secrets': [{'name': 'regcred-cnsof50011836-harbor'}], - 'init_containers': None, - 'node_name': 'm-0', - 'node_selector': None, - 'os': None, - 'overhead': None, - 'preemption_policy': 'PreemptLowerPriority', - 'priority': 0, - 'priority_class_name': None, - 'readiness_gates': None, - 'resource_claims': None, - 'restart_policy': 'Always', - 'runtime_class_name': None, - 'scheduler_name': 'default-scheduler', - 'scheduling_gates': None, - 'security_context': {'app_armor_profile': None, - 'fs_group': 1001, - 'fs_group_change_policy': None, - 'run_as_group': 1001, - 'run_as_non_root': None, - 'run_as_user': 1001, - 'se_linux_options': None, - 'seccomp_profile': None, - 'supplemental_groups': None, - 'sysctls': None, - 'windows_options': None}, - 'service_account': 'default', - 'service_account_name': 'default', - 'set_hostname_as_fqdn': None, - 'share_process_namespace': None, - 'subdomain': 'database-discovery', - 'termination_grace_period_seconds': 30, - 'tolerations': [{'effect': 'NoExecute', - 'key': 'node.kubernetes.io/not-ready', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}, - {'effect': 'NoExecute', - 'key': 'node.kubernetes.io/unreachable', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}], - 'topology_spread_constraints': None, - 'volumes': [{'aws_elastic_block_store': None, - 'azure_disk': None, - 'azure_file': None, - 'cephfs': None, - 'cinder': None, - 'config_map': None, - 'csi': None, - 'downward_api': None, - 'empty_dir': None, - 'ephemeral': None, - 'fc': None, - 'flex_volume': None, - 'flocker': None, - 'gce_persistent_disk': None, - 'git_repo': None, - 'glusterfs': None, - 'host_path': None, - 'iscsi': None, - 'name': 'data', - 'nfs': None, - 'persistent_volume_claim': {'claim_name': 'data-database-dmserver-0', - 'read_only': None}, - 'photon_persistent_disk': None, - 'portworx_volume': None, - 'projected': None, - 'quobyte': None, - 'rbd': None, - 'scale_io': None, - 'secret': None, - 'storageos': None, - 'vsphere_volume': None}, - {'aws_elastic_block_store': None, - 'azure_disk': None, - 'azure_file': None, - 'cephfs': None, - 'cinder': None, - 'config_map': None, - 'csi': None, - 'downward_api': None, - 'empty_dir': None, - 'ephemeral': None, - 'fc': None, - 'flex_volume': None, - 'flocker': None, - 'gce_persistent_disk': None, - 'git_repo': None, - 'glusterfs': None, - 'host_path': {'path': '/dmcca/logs/canvas/cnsof50011836-system/database/database', - 'type': 'DirectoryOrCreate'}, - 'iscsi': None, - 'name': 'database-4e332eab0df907f56edf8b460018f3ba', - 'nfs': None, - 'persistent_volume_claim': None, - 'photon_persistent_disk': None, - 'portworx_volume': None, - 'projected': None, - 'quobyte': None, - 'rbd': None, - 'scale_io': None, - 'secret': None, - 'storageos': None, - 'vsphere_volume': None}, - {'aws_elastic_block_store': None, - 'azure_disk': None, - 'azure_file': None, - 'cephfs': None, - 'cinder': None, - 'config_map': None, - 'csi': None, - 'downward_api': None, - 'empty_dir': None, - 'ephemeral': None, - 'fc': None, - 'flex_volume': None, - 'flocker': None, - 'gce_persistent_disk': None, - 'git_repo': None, - 'glusterfs': None, - 'host_path': None, - 'iscsi': None, - 'name': 'kube-api-access-lmqf7', - 'nfs': None, - 'persistent_volume_claim': None, - 'photon_persistent_disk': None, - 'portworx_volume': None, - 'projected': {'default_mode': 420, - 'sources': [{'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': None, - 'secret': None, - 'service_account_token': {'audience': None, - 'expiration_seconds': 3607, - 'path': 'token'}}, - {'cluster_trust_bundle': None, - 'config_map': {'items': [{'key': 'ca.crt', - 'mode': None, - 'path': 'ca.crt'}], - 'name': 'kube-root-ca.crt', - 'optional': None}, - 'downward_api': None, - 'secret': None, - 'service_account_token': None}, - {'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': {'items': [{'field_ref': {'api_version': 'v1', - 'field_path': 'metadata.namespace'}, - 'mode': None, - 'path': 'namespace', - 'resource_field_ref': None}]}, - 'secret': None, - 'service_account_token': None}]}, - 'quobyte': None, - 'rbd': None, - 'scale_io': None, - 'secret': None, - 'storageos': None, - 'vsphere_volume': None}]}, - 'status': {'conditions': [{'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Initialized'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 21, 18, 46, 26, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Ready'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 21, 18, 46, 26, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'ContainersReady'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'PodScheduled'}], - 'container_statuses': [{'allocated_resources': None, - 'container_id': 'containerd://b2f8935ba484708cc8b02cc7df2ed2e8b4cf59de0103f6363c7a97f7dbdecd83', - 'image': 'harbor.dameng.io/dmcca/dmdbms:8_20240220', - 'image_id': 'harbor.dameng.io/dmcca/dmdbms@sha256:3f18b93c31ff8036f4ef72766f213d2e742fb36ee68c822e0fdd00e98370cef3', - 'last_state': {'running': None, - 'terminated': None, - 'waiting': None}, - 'name': 'database', - 'ready': True, - 'resources': None, - 'restart_count': 0, - 'started': True, - 'state': {'running': {'started_at': datetime.datetime(2024, 6, 20, 4, 7, 9, tzinfo=tzutc())}, - 'terminated': None, - 'waiting': None}, - 'volume_mounts': None}], - 'ephemeral_container_statuses': None, - 'host_i_ps': None, - 'host_ip': '192.168.0.2', - 'init_container_statuses': None, - 'message': None, - 'nominated_node_name': None, - 'phase': 'Running', - 'pod_i_ps': [{'ip': '10.233.57.173'}], - 'pod_ip': '10.233.57.173', - 'qos_class': 'Burstable', - 'reason': None, - 'resize': None, - 'resource_claim_statuses': None, - 'start_time': datetime.datetime(2024, 6, 20, 4, 7, 8, tzinfo=tzutc())}}, - {'api_version': None, - 'kind': None, - 'metadata': {'annotations': {'cni.projectcalico.org/containerID': 'dd7f5a12a495f14249e29b01124afebfb530af99aeaad93ac54ef1c4ad558ef6', - 'cni.projectcalico.org/podIP': '10.233.183.42/32', - 'cni.projectcalico.org/podIPs': '10.233.183.42/32'}, - 'creation_timestamp': datetime.datetime(2024, 6, 20, 4, 7, 25, tzinfo=tzutc()), - 'deletion_grace_period_seconds': None, - 'deletion_timestamp': None, - 'finalizers': None, - 'generate_name': 'ff-deployment-669d56cfcb-', - 'generation': None, - 'labels': {'app': 'ff', - 'operator.dameng.com/canvas': 'ff', - 'operator.dameng.com/controller': 'deployment', - 'operator.dameng.com/instance': 'deployment-deployment-l22qzjmj', - 'operator.dameng.com/service': 'deployment-1650167271463-deployment-l22qzjmj', - 'pod-template-hash': '669d56cfcb'}, - 'managed_fields': [{'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:generateName': {}, - 'f:labels': {'.': {}, - 'f:app': {}, - 'f:operator.dameng.com/canvas': {}, - 'f:operator.dameng.com/controller': {}, - 'f:operator.dameng.com/instance': {}, - 'f:operator.dameng.com/service': {}, - 'f:pod-template-hash': {}}, - 'f:ownerReferences': {'.': {}, - 'k:{"uid":"d87a19ad-ef59-4468-b345-9b4562ae912f"}': {}}}, - 'f:spec': {'f:containers': {'k:{"name":"app"}': {'.': {}, - 'f:env': {'.': {}, - 'k:{"name":"DMCCA_CANVAS_NAME"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMCCA_CANVAS_NAMESPACE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"TZ"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}}, - 'f:image': {}, - 'f:imagePullPolicy': {}, - 'f:name': {}, - 'f:resources': {'.': {}, - 'f:limits': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}, - 'f:requests': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}}, - 'f:terminationMessagePath': {}, - 'f:terminationMessagePolicy': {}}}, - 'f:dnsPolicy': {}, - 'f:enableServiceLinks': {}, - 'f:restartPolicy': {}, - 'f:schedulerName': {}, - 'f:securityContext': {}, - 'f:terminationGracePeriodSeconds': {}}}, - 'manager': 'kube-controller-manager', - 'operation': 'Update', - 'subresource': None, - 'time': datetime.datetime(2024, 6, 20, 4, 7, 25, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:annotations': {'.': {}, - 'f:cni.projectcalico.org/containerID': {}, - 'f:cni.projectcalico.org/podIP': {}, - 'f:cni.projectcalico.org/podIPs': {}}}}, - 'manager': 'calico', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 20, 4, 7, 26, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:status': {'f:conditions': {'k:{"type":"ContainersReady"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Initialized"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Ready"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}}, - 'f:containerStatuses': {}, - 'f:hostIP': {}, - 'f:phase': {}, - 'f:podIP': {}, - 'f:podIPs': {'.': {}, - 'k:{"ip":"10.233.183.42"}': {'.': {}, - 'f:ip': {}}}, - 'f:startTime': {}}}, - 'manager': 'kubelet', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 20, 4, 7, 27, tzinfo=tzutc())}], - 'name': 'ff-deployment-669d56cfcb-gmrc2', - 'namespace': 'cnsof50011836-system', - 'owner_references': [{'api_version': 'apps/v1', - 'block_owner_deletion': True, - 'controller': True, - 'kind': 'ReplicaSet', - 'name': 'ff-deployment-669d56cfcb', - 'uid': 'd87a19ad-ef59-4468-b345-9b4562ae912f'}], - 'resource_version': '19284786', - 'self_link': None, - 'uid': '26efca34-ced8-4996-a013-45e3e96b37f0'}, - 'spec': {'active_deadline_seconds': None, - 'affinity': None, - 'automount_service_account_token': None, - 'containers': [{'args': None, - 'command': None, - 'env': [{'name': 'DMCCA_CANVAS_NAME', - 'value': 'ff', - 'value_from': None}, - {'name': 'DMCCA_CANVAS_NAMESPACE', - 'value': 'cnsof50011836-system', - 'value_from': None}, - {'name': 'TZ', - 'value': 'Asia/Shanghai', - 'value_from': None}], - 'env_from': None, - 'image': 'harbor.dameng.io/dmcca/centos:7.9.2009', - 'image_pull_policy': 'IfNotPresent', - 'lifecycle': None, - 'liveness_probe': None, - 'name': 'app', - 'ports': None, - 'readiness_probe': None, - 'resize_policy': None, - 'resources': {'claims': None, - 'limits': {'cpu': '500m', - 'memory': '1Gi'}, - 'requests': {'cpu': '300m', - 'memory': '214748364800m'}}, - 'restart_policy': None, - 'security_context': None, - 'startup_probe': None, - 'stdin': None, - 'stdin_once': None, - 'termination_message_path': '/dev/termination-log', - 'termination_message_policy': 'File', - 'tty': None, - 'volume_devices': None, - 'volume_mounts': [{'mount_path': '/var/run/secrets/kubernetes.io/serviceaccount', - 'mount_propagation': None, - 'name': 'kube-api-access-2mvgq', - 'read_only': True, - 'recursive_read_only': None, - 'sub_path': None, - 'sub_path_expr': None}], - 'working_dir': None}], - 'dns_config': None, - 'dns_policy': 'ClusterFirst', - 'enable_service_links': False, - 'ephemeral_containers': None, - 'host_aliases': None, - 'host_ipc': None, - 'host_network': None, - 'host_pid': None, - 'host_users': None, - 'hostname': None, - 'image_pull_secrets': [{'name': 'regcred-cnsof50011836-harbor'}], - 'init_containers': None, - 'node_name': 'm-1', - 'node_selector': None, - 'os': None, - 'overhead': None, - 'preemption_policy': 'PreemptLowerPriority', - 'priority': 0, - 'priority_class_name': None, - 'readiness_gates': None, - 'resource_claims': None, - 'restart_policy': 'Always', - 'runtime_class_name': None, - 'scheduler_name': 'default-scheduler', - 'scheduling_gates': None, - 'security_context': {'app_armor_profile': None, - 'fs_group': None, - 'fs_group_change_policy': None, - 'run_as_group': None, - 'run_as_non_root': None, - 'run_as_user': None, - 'se_linux_options': None, - 'seccomp_profile': None, - 'supplemental_groups': None, - 'sysctls': None, - 'windows_options': None}, - 'service_account': 'default', - 'service_account_name': 'default', - 'set_hostname_as_fqdn': None, - 'share_process_namespace': None, - 'subdomain': None, - 'termination_grace_period_seconds': 30, - 'tolerations': [{'effect': 'NoExecute', - 'key': 'node.kubernetes.io/not-ready', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}, - {'effect': 'NoExecute', - 'key': 'node.kubernetes.io/unreachable', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}], - 'topology_spread_constraints': None, - 'volumes': [{'aws_elastic_block_store': None, - 'azure_disk': None, - 'azure_file': None, - 'cephfs': None, - 'cinder': None, - 'config_map': None, - 'csi': None, - 'downward_api': None, - 'empty_dir': None, - 'ephemeral': None, - 'fc': None, - 'flex_volume': None, - 'flocker': None, - 'gce_persistent_disk': None, - 'git_repo': None, - 'glusterfs': None, - 'host_path': None, - 'iscsi': None, - 'name': 'kube-api-access-2mvgq', - 'nfs': None, - 'persistent_volume_claim': None, - 'photon_persistent_disk': None, - 'portworx_volume': None, - 'projected': {'default_mode': 420, - 'sources': [{'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': None, - 'secret': None, - 'service_account_token': {'audience': None, - 'expiration_seconds': 3607, - 'path': 'token'}}, - {'cluster_trust_bundle': None, - 'config_map': {'items': [{'key': 'ca.crt', - 'mode': None, - 'path': 'ca.crt'}], - 'name': 'kube-root-ca.crt', - 'optional': None}, - 'downward_api': None, - 'secret': None, - 'service_account_token': None}, - {'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': {'items': [{'field_ref': {'api_version': 'v1', - 'field_path': 'metadata.namespace'}, - 'mode': None, - 'path': 'namespace', - 'resource_field_ref': None}]}, - 'secret': None, - 'service_account_token': None}]}, - 'quobyte': None, - 'rbd': None, - 'scale_io': None, - 'secret': None, - 'storageos': None, - 'vsphere_volume': None}]}, - 'status': {'conditions': [{'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 25, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Initialized'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 27, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Ready'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 27, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'ContainersReady'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 7, 25, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'PodScheduled'}], - 'container_statuses': [{'allocated_resources': None, - 'container_id': 'containerd://2c0c03c286ff34185be40d173bfadb548bd96b43edd5376887c365dadd1e771e', - 'image': 'harbor.dameng.io/dmcca/centos:7.9.2009', - 'image_id': 'harbor.dameng.io/dmcca/centos@sha256:50eb12c15443bc4ab9f60ebddb47992af124dcecbf8c50a2f513f88c09072597', - 'last_state': {'running': None, - 'terminated': None, - 'waiting': None}, - 'name': 'app', - 'ready': True, - 'resources': None, - 'restart_count': 0, - 'started': True, - 'state': {'running': {'started_at': datetime.datetime(2024, 6, 20, 4, 7, 26, tzinfo=tzutc())}, - 'terminated': None, - 'waiting': None}, - 'volume_mounts': None}], - 'ephemeral_container_statuses': None, - 'host_i_ps': None, - 'host_ip': '192.168.0.3', - 'init_container_statuses': None, - 'message': None, - 'nominated_node_name': None, - 'phase': 'Running', - 'pod_i_ps': [{'ip': '10.233.183.42'}], - 'pod_ip': '10.233.183.42', - 'qos_class': 'Burstable', - 'reason': None, - 'resize': None, - 'resource_claim_statuses': None, - 'start_time': datetime.datetime(2024, 6, 20, 4, 7, 25, tzinfo=tzutc())}}, - {'api_version': None, - 'kind': None, - 'metadata': {'annotations': {'cni.projectcalico.org/containerID': '8aa2104f0dc345cdfbf0797b0c314b6d8745b5be35137f7c80159035cb4385f8', - 'cni.projectcalico.org/podIP': '10.233.10.227/32', - 'cni.projectcalico.org/podIPs': '10.233.10.227/32'}, - 'creation_timestamp': datetime.datetime(2024, 6, 20, 4, 45, 43, tzinfo=tzutc()), - 'deletion_grace_period_seconds': None, - 'deletion_timestamp': None, - 'finalizers': None, - 'generate_name': 'flask-app-deployment-76d66d98b8-', - 'generation': None, - 'labels': {'app': 'flask-app', - 'operator.dameng.com/canvas': 'flask-app', - 'operator.dameng.com/controller': 'deployment', - 'operator.dameng.com/instance': 'deployment-deployment-l22qzjmj', - 'operator.dameng.com/service': 'deployment-1650167271463-deployment-l22qzjmj', - 'pod-template-hash': '76d66d98b8'}, - 'managed_fields': [{'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:generateName': {}, - 'f:labels': {'.': {}, - 'f:app': {}, - 'f:operator.dameng.com/canvas': {}, - 'f:operator.dameng.com/controller': {}, - 'f:operator.dameng.com/instance': {}, - 'f:operator.dameng.com/service': {}, - 'f:pod-template-hash': {}}, - 'f:ownerReferences': {'.': {}, - 'k:{"uid":"679a0a7e-5d7f-4438-a498-910ccd2fa434"}': {}}}, - 'f:spec': {'f:containers': {'k:{"name":"app"}': {'.': {}, - 'f:env': {'.': {}, - 'k:{"name":"DMCCA_CANVAS_NAME"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"DMCCA_CANVAS_NAMESPACE"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}, - 'k:{"name":"TZ"}': {'.': {}, - 'f:name': {}, - 'f:value': {}}}, - 'f:image': {}, - 'f:imagePullPolicy': {}, - 'f:name': {}, - 'f:resources': {'.': {}, - 'f:limits': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}, - 'f:requests': {'.': {}, - 'f:cpu': {}, - 'f:memory': {}}}, - 'f:terminationMessagePath': {}, - 'f:terminationMessagePolicy': {}}}, - 'f:dnsPolicy': {}, - 'f:enableServiceLinks': {}, - 'f:restartPolicy': {}, - 'f:schedulerName': {}, - 'f:securityContext': {}, - 'f:terminationGracePeriodSeconds': {}}}, - 'manager': 'kube-controller-manager', - 'operation': 'Update', - 'subresource': None, - 'time': datetime.datetime(2024, 6, 20, 4, 45, 43, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:metadata': {'f:annotations': {'.': {}, - 'f:cni.projectcalico.org/containerID': {}, - 'f:cni.projectcalico.org/podIP': {}, - 'f:cni.projectcalico.org/podIPs': {}}}}, - 'manager': 'calico', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 20, 4, 45, 44, tzinfo=tzutc())}, - {'api_version': 'v1', - 'fields_type': 'FieldsV1', - 'fields_v1': {'f:status': {'f:conditions': {'k:{"type":"ContainersReady"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Initialized"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}, - 'k:{"type":"Ready"}': {'.': {}, - 'f:lastProbeTime': {}, - 'f:lastTransitionTime': {}, - 'f:status': {}, - 'f:type': {}}}, - 'f:containerStatuses': {}, - 'f:hostIP': {}, - 'f:phase': {}, - 'f:podIP': {}, - 'f:podIPs': {'.': {}, - 'k:{"ip":"10.233.10.227"}': {'.': {}, - 'f:ip': {}}}, - 'f:startTime': {}}}, - 'manager': 'kubelet', - 'operation': 'Update', - 'subresource': 'status', - 'time': datetime.datetime(2024, 6, 20, 4, 45, 47, tzinfo=tzutc())}], - 'name': 'flask-app-deployment-76d66d98b8-4kx9t', - 'namespace': 'cnsof50011836-system', - 'owner_references': [{'api_version': 'apps/v1', - 'block_owner_deletion': True, - 'controller': True, - 'kind': 'ReplicaSet', - 'name': 'flask-app-deployment-76d66d98b8', - 'uid': '679a0a7e-5d7f-4438-a498-910ccd2fa434'}], - 'resource_version': '19306616', - 'self_link': None, - 'uid': '1b7ffd59-7805-4bb3-b573-eaf59d19b5b0'}, - 'spec': {'active_deadline_seconds': None, - 'affinity': None, - 'automount_service_account_token': None, - 'containers': [{'args': None, - 'command': None, - 'env': [{'name': 'DMCCA_CANVAS_NAME', - 'value': 'flask-app', - 'value_from': None}, - {'name': 'DMCCA_CANVAS_NAMESPACE', - 'value': 'cnsof50011836-system', - 'value_from': None}, - {'name': 'TZ', - 'value': 'Asia/Shanghai', - 'value_from': None}], - 'env_from': None, - 'image': 'harbor.dameng.io/cnsof50011836/flask-app:latest', - 'image_pull_policy': 'Always', - 'lifecycle': None, - 'liveness_probe': None, - 'name': 'app', - 'ports': None, - 'readiness_probe': None, - 'resize_policy': None, - 'resources': {'claims': None, - 'limits': {'cpu': '1', - 'memory': '1Gi'}, - 'requests': {'cpu': '200m', - 'memory': '214748364800m'}}, - 'restart_policy': None, - 'security_context': None, - 'startup_probe': None, - 'stdin': None, - 'stdin_once': None, - 'termination_message_path': '/dev/termination-log', - 'termination_message_policy': 'File', - 'tty': None, - 'volume_devices': None, - 'volume_mounts': [{'mount_path': '/var/run/secrets/kubernetes.io/serviceaccount', - 'mount_propagation': None, - 'name': 'kube-api-access-c9jd2', - 'read_only': True, - 'recursive_read_only': None, - 'sub_path': None, - 'sub_path_expr': None}], - 'working_dir': None}], - 'dns_config': None, - 'dns_policy': 'ClusterFirst', - 'enable_service_links': False, - 'ephemeral_containers': None, - 'host_aliases': None, - 'host_ipc': None, - 'host_network': None, - 'host_pid': None, - 'host_users': None, - 'hostname': None, - 'image_pull_secrets': [{'name': 'regcred-cnsof50011836-harbor'}], - 'init_containers': None, - 'node_name': 'm-2', - 'node_selector': None, - 'os': None, - 'overhead': None, - 'preemption_policy': 'PreemptLowerPriority', - 'priority': 0, - 'priority_class_name': None, - 'readiness_gates': None, - 'resource_claims': None, - 'restart_policy': 'Always', - 'runtime_class_name': None, - 'scheduler_name': 'default-scheduler', - 'scheduling_gates': None, - 'security_context': {'app_armor_profile': None, - 'fs_group': None, - 'fs_group_change_policy': None, - 'run_as_group': None, - 'run_as_non_root': None, - 'run_as_user': None, - 'se_linux_options': None, - 'seccomp_profile': None, - 'supplemental_groups': None, - 'sysctls': None, - 'windows_options': None}, - 'service_account': 'default', - 'service_account_name': 'default', - 'set_hostname_as_fqdn': None, - 'share_process_namespace': None, - 'subdomain': None, - 'termination_grace_period_seconds': 30, - 'tolerations': [{'effect': 'NoExecute', - 'key': 'node.kubernetes.io/not-ready', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}, - {'effect': 'NoExecute', - 'key': 'node.kubernetes.io/unreachable', - 'operator': 'Exists', - 'toleration_seconds': 60, - 'value': None}], - 'topology_spread_constraints': None, - 'volumes': [{'aws_elastic_block_store': None, - 'azure_disk': None, - 'azure_file': None, - 'cephfs': None, - 'cinder': None, - 'config_map': None, - 'csi': None, - 'downward_api': None, - 'empty_dir': None, - 'ephemeral': None, - 'fc': None, - 'flex_volume': None, - 'flocker': None, - 'gce_persistent_disk': None, - 'git_repo': None, - 'glusterfs': None, - 'host_path': None, - 'iscsi': None, - 'name': 'kube-api-access-c9jd2', - 'nfs': None, - 'persistent_volume_claim': None, - 'photon_persistent_disk': None, - 'portworx_volume': None, - 'projected': {'default_mode': 420, - 'sources': [{'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': None, - 'secret': None, - 'service_account_token': {'audience': None, - 'expiration_seconds': 3607, - 'path': 'token'}}, - {'cluster_trust_bundle': None, - 'config_map': {'items': [{'key': 'ca.crt', - 'mode': None, - 'path': 'ca.crt'}], - 'name': 'kube-root-ca.crt', - 'optional': None}, - 'downward_api': None, - 'secret': None, - 'service_account_token': None}, - {'cluster_trust_bundle': None, - 'config_map': None, - 'downward_api': {'items': [{'field_ref': {'api_version': 'v1', - 'field_path': 'metadata.namespace'}, - 'mode': None, - 'path': 'namespace', - 'resource_field_ref': None}]}, - 'secret': None, - 'service_account_token': None}]}, - 'quobyte': None, - 'rbd': None, - 'scale_io': None, - 'secret': None, - 'storageos': None, - 'vsphere_volume': None}]}, - 'status': {'conditions': [{'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 45, 43, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Initialized'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 45, 47, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'Ready'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 45, 47, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'ContainersReady'}, - {'last_probe_time': None, - 'last_transition_time': datetime.datetime(2024, 6, 20, 4, 45, 43, tzinfo=tzutc()), - 'message': None, - 'reason': None, - 'status': 'True', - 'type': 'PodScheduled'}], - 'container_statuses': [{'allocated_resources': None, - 'container_id': 'containerd://a5bd68dfcbf12bb0d0f250276ac210179314c23da3c8b8f08facde3b5bdbeb2c', - 'image': 'harbor.dameng.io/cnsof50011836/flask-app:latest', - 'image_id': 'harbor.dameng.io/cnsof50011836/flask-app@sha256:662bc10607cdaafa86df90bdcf0201d7fa2647bca3bebf0eae570c3b9c6d54ad', - 'last_state': {'running': None, - 'terminated': None, - 'waiting': None}, - 'name': 'app', - 'ready': True, - 'resources': None, - 'restart_count': 0, - 'started': True, - 'state': {'running': {'started_at': datetime.datetime(2024, 6, 20, 4, 45, 46, tzinfo=tzutc())}, - 'terminated': None, - 'waiting': None}, - 'volume_mounts': None}], - 'ephemeral_container_statuses': None, - 'host_i_ps': None, - 'host_ip': '192.168.0.4', - 'init_container_statuses': None, - 'message': None, - 'nominated_node_name': None, - 'phase': 'Running', - 'pod_i_ps': [{'ip': '10.233.10.227'}], - 'pod_ip': '10.233.10.227', - 'qos_class': 'Burstable', - 'reason': None, - 'resize': None, - 'resource_claim_statuses': None, - 'start_time': datetime.datetime(2024, 6, 20, 4, 45, 43, tzinfo=tzutc())}}], - 'kind': 'PodList', - 'metadata': {'_continue': None, - 'remaining_item_count': None, - 'resource_version': '23339883', - 'self_link': None}} \ No newline at end of file From aa49c5dd8f4fa10c70cb87840b597a8f3e20fec4 Mon Sep 17 00:00:00 2001 From: 30404 <3040471803@qq.com> Date: Tue, 25 Jun 2024 18:44:33 +0800 Subject: [PATCH 5/5] 6.25,18.44 --- .../src/TeacherPages/MarkingPages/Marking.jsx | 2 +- app-dm/src/TeacherPages/SendTest/SendTest.jsx | 2 +- .../src/TeacherPages/SendTest/trainmanage.jsx | 2 +- .../src/TeacherPages/SendTrain/SendTrain.jsx | 2 +- app-dm/src/TeacherPages/TeacherPage.jsx | 3 +- .../TeacherPages/classlistpages/classId.jsx | 10 +++-- .../src/TeacherPages/list_pods/List_pods.css | 0 .../src/TeacherPages/list_pods/List_pods.jsx | 5 +++ .../teachermanagetest/ManageTest.jsx | 2 +- app-dm/src/pages/Home/Home.jsx | 2 +- .../pages/ListPages/Analyse/AnalysePages.jsx | 2 +- app-dm/src/pages/ListPages/Subject/Exam.jsx | 2 +- .../pages/ListPages/Subject/SubjectPage.jsx | 2 +- .../pages/ListPages/Training/TrainingPage.jsx | 2 +- app-dm/src/pages/SighUp/SignUpForm.jsx | 2 +- app-dm/src/setupProxy.js | 2 +- python/app.py | 8 +--- python/teacher_func.py | 39 +++++++++---------- 18 files changed, 46 insertions(+), 43 deletions(-) create mode 100644 app-dm/src/TeacherPages/list_pods/List_pods.css create mode 100644 app-dm/src/TeacherPages/list_pods/List_pods.jsx diff --git a/app-dm/src/TeacherPages/MarkingPages/Marking.jsx b/app-dm/src/TeacherPages/MarkingPages/Marking.jsx index 2f08a58..a96da06 100644 --- a/app-dm/src/TeacherPages/MarkingPages/Marking.jsx +++ b/app-dm/src/TeacherPages/MarkingPages/Marking.jsx @@ -9,7 +9,7 @@ function Marking(){ const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } return( diff --git a/app-dm/src/TeacherPages/SendTest/SendTest.jsx b/app-dm/src/TeacherPages/SendTest/SendTest.jsx index 32dc9f9..8e58515 100644 --- a/app-dm/src/TeacherPages/SendTest/SendTest.jsx +++ b/app-dm/src/TeacherPages/SendTest/SendTest.jsx @@ -9,7 +9,7 @@ function SendTest(){ const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } //获取题目 const [ChoiceQuestion,SetChoiceQuestion]=useState() diff --git a/app-dm/src/TeacherPages/SendTest/trainmanage.jsx b/app-dm/src/TeacherPages/SendTest/trainmanage.jsx index 4311dcf..7e97232 100644 --- a/app-dm/src/TeacherPages/SendTest/trainmanage.jsx +++ b/app-dm/src/TeacherPages/SendTest/trainmanage.jsx @@ -8,7 +8,7 @@ function TrainManage(){ const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } return(
diff --git a/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx b/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx index a7fd2c3..d4e7411 100644 --- a/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx +++ b/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx @@ -7,7 +7,7 @@ function SendTrain(){ const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } //获取所有基础题的所有题目 const [Trainquestion,SetTrainquestion]=useState() diff --git a/app-dm/src/TeacherPages/TeacherPage.jsx b/app-dm/src/TeacherPages/TeacherPage.jsx index c02b880..c8475c7 100644 --- a/app-dm/src/TeacherPages/TeacherPage.jsx +++ b/app-dm/src/TeacherPages/TeacherPage.jsx @@ -5,10 +5,11 @@ import axios from 'axios'; // import { useParams } from 'react-router-dom'; function TeacherPage() { + const teacher_ID = localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } const [classData, setClassData] = useState({}); const log=(key)=>{ diff --git a/app-dm/src/TeacherPages/classlistpages/classId.jsx b/app-dm/src/TeacherPages/classlistpages/classId.jsx index 6baf715..33f7a0d 100644 --- a/app-dm/src/TeacherPages/classlistpages/classId.jsx +++ b/app-dm/src/TeacherPages/classlistpages/classId.jsx @@ -9,12 +9,12 @@ import './classid.css' function TeacherPage() { const click=()=>{ - console.log(classdata); + console.log(TestScore); } const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } const { key } = useParams(); const [isclick,setisclick]=useState(false) @@ -59,13 +59,15 @@ function TeacherPage() { const formattedDate = `${year}-${(monthIndex + 1).toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`; return formattedDate; } + const[TestScore,setTestScore]=useState() const Find_details=async (ID)=>{ try{ - const Find_details=await axios.post('api/Find_details',{ + const Find_details_Src=await axios.post('api/Find_details',{ ID }) + setTestScore(Find_details_Src.data) }catch{ - + alert('Find_details出错') } } diff --git a/app-dm/src/TeacherPages/list_pods/List_pods.css b/app-dm/src/TeacherPages/list_pods/List_pods.css new file mode 100644 index 0000000..e69de29 diff --git a/app-dm/src/TeacherPages/list_pods/List_pods.jsx b/app-dm/src/TeacherPages/list_pods/List_pods.jsx new file mode 100644 index 0000000..9822453 --- /dev/null +++ b/app-dm/src/TeacherPages/list_pods/List_pods.jsx @@ -0,0 +1,5 @@ +function List_pods(){ + return( +
+ ) +} \ No newline at end of file diff --git a/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx b/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx index a9974ab..4a70674 100644 --- a/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx +++ b/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx @@ -9,7 +9,7 @@ function TeacherPage() { const teacher_ID=localStorage.getItem('islogin') if(teacher_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } const [classData, setClassData] = useState({}); const [classtest,setClassTest]=useState() diff --git a/app-dm/src/pages/Home/Home.jsx b/app-dm/src/pages/Home/Home.jsx index 5c5e246..bb83281 100644 --- a/app-dm/src/pages/Home/Home.jsx +++ b/app-dm/src/pages/Home/Home.jsx @@ -15,7 +15,7 @@ function Home(){ const student_ID=localStorage.getItem('islogin') if(student_ID==null){ alert('未登录,请先前往登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } //课表数据 const [lesson, setLesson] = useState([]); diff --git a/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx b/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx index e45fdd9..3a9b4c1 100644 --- a/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx +++ b/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx @@ -11,7 +11,7 @@ function SubjectPage(){ const student_ID=localStorage.getItem('islogin') if(student_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } //点击li弹出图像窗口 const [SubjectModal,setSubjectModal] = useState(false); diff --git a/app-dm/src/pages/ListPages/Subject/Exam.jsx b/app-dm/src/pages/ListPages/Subject/Exam.jsx index c9aef5e..a23fd21 100644 --- a/app-dm/src/pages/ListPages/Subject/Exam.jsx +++ b/app-dm/src/pages/ListPages/Subject/Exam.jsx @@ -9,7 +9,7 @@ function Exam(){ const student_ID=localStorage.getItem('islogin') if(student_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } // 初始化倒计时状态 const [countdown, setCountdown] = useState(0); diff --git a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx index 13d77f8..5363dd9 100644 --- a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx +++ b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx @@ -12,7 +12,7 @@ function SubjectPage(){ const student_ID=localStorage.getItem('islogin') if(student_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } const [testdata,settestdata]=useState('') const [time,settime]=useState(moment().format('YYYY-MM-DD HH:mm:ss')) diff --git a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx index fb68215..f9600dd 100755 --- a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx +++ b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx @@ -13,7 +13,7 @@ function SubjectPage(){ const student_ID=localStorage.getItem('islogin') if(student_ID==null){ alert('登录过期,请重新登录') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' } const [title,setTitle]=useState() // 获取实训标题 diff --git a/app-dm/src/pages/SighUp/SignUpForm.jsx b/app-dm/src/pages/SighUp/SignUpForm.jsx index a822c17..27d6d93 100644 --- a/app-dm/src/pages/SighUp/SignUpForm.jsx +++ b/app-dm/src/pages/SighUp/SignUpForm.jsx @@ -72,7 +72,7 @@ import axios from 'axios'; const register_data=register_func.data if (register_data.result==='注册成功'){ alert('注册成功') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/' }else if(register_data.result==='注册失败'){ alert('账号已存在') } diff --git a/app-dm/src/setupProxy.js b/app-dm/src/setupProxy.js index f7ade0b..4a40b4f 100644 --- a/app-dm/src/setupProxy.js +++ b/app-dm/src/setupProxy.js @@ -4,7 +4,7 @@ module.exports = function(app) { app.use( '/api', // 如果请求路径匹配'/api',则进行代理 createProxyMiddleware({ - target: 'http://36.138.114.105:32087/', // 目标后端服务地址 + target: 'http://127.0.0.1:5000', // 目标后端服务地址 changeOrigin: true, }) ); diff --git a/python/app.py b/python/app.py index 76cdd08..4dedab1 100644 --- a/python/app.py +++ b/python/app.py @@ -2,7 +2,6 @@ from teacher_func import * from student_func import * from flask import Flask, render_template, request, jsonify, send_from_directory, session from flask_cors import CORS -import python.k8s as k8s app = Flask(__name__, static_folder="public") CORS(app, resources={r"/*": {"origins": "*"}}) @@ -234,11 +233,8 @@ def SendTrainTest(): @app.route('/api/Find_details',methods=["POST"]) def Find_details(): - return 'a' - -@app.route('/api/student-test',methods=["POST"]) -def student_test(): - return k8s.list_pods() + id=request.json['student_ID'] + return Find_details(id) @app.route('/') diff --git a/python/teacher_func.py b/python/teacher_func.py index a9e62f3..10e6516 100644 --- a/python/teacher_func.py +++ b/python/teacher_func.py @@ -256,30 +256,29 @@ def SendTrainTestFunc(TrainChoice,TrainCompletion,TrainJudge,Hour,Min,StopTime,C return '发布成功' -def Find_dic(dic): - # 获取字典的键,并按照从大到小的顺序排序 - keys_sorted = sorted(dic.keys(), reverse=True) - - # 取最后三个键 - last_three_keys = keys_sorted[:3] - - # 输出对应的值或进行进一步处理 - for key in last_three_keys: - print(dic[key]) # 这里假设你想打印每个键对应的值,可以根据需求进行处理 - print(dic) +# def Find_dic(dic): +# # 获取字典的键,并按照从大到小的顺序排序 +# keys_sorted = sorted(dic.keys(), reverse=True) +# +# # 取最后三个键 +# last_three_keys = keys_sorted[:3] +# +# # 创建一个新的字典,仅包含排序后的最后三个键及其对应的值 +# dic_last_three = {key: dic[key] for key in last_three_keys} +# +# return dic_last_three # 返回一个新字典,该字典仅包含排序后的最后三个键及其对应的值 - -def Find_details(ID,teacher_ID): - dic={} - subject=fetch_subject(teacher_ID) +def Find_details(ID): + dic = {} cursor = db.cursor() - cursor.execute(f"SELECT * FROM STUDENT_TEST WHERE STUDENT_ID=? AND TF='true' AND SUBJECT=? ",(ID,subject)) - data=cursor.fetchall() + cursor.execute(f"SELECT * FROM STUDENT_TEST WHERE STUDENT_ID=? AND TF='true' ", (ID)) + data = cursor.fetchall() for i in data: - dic[i[3]]=i + dic[i[3]] = i cursor.close() - Find_dic(dic) + # 调用Find_dic函数并传入dic字典作为参数 return dic -Find_details('20240101','111111') + +# print(Find_details('20240101'))