已批改试卷
diff --git a/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx b/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx
index 734c247..a7fd2c3 100644
--- a/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx
+++ b/app-dm/src/TeacherPages/SendTrain/SendTrain.jsx
@@ -5,6 +5,10 @@ import axios from 'axios';
function SendTrain(){
const teacher_ID=localStorage.getItem('islogin')
+ if(teacher_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
//获取所有基础题的所有题目
const [Trainquestion,SetTrainquestion]=useState()
//章节内容
diff --git a/app-dm/src/TeacherPages/TeacherPage.jsx b/app-dm/src/TeacherPages/TeacherPage.jsx
index 49f2e61..c02b880 100644
--- a/app-dm/src/TeacherPages/TeacherPage.jsx
+++ b/app-dm/src/TeacherPages/TeacherPage.jsx
@@ -5,29 +5,12 @@ import axios from 'axios';
// import { useParams } from 'react-router-dom';
function TeacherPage() {
- const [isChecked, setisChecked] = useState(false);
- const [teacher_ID, setTeacher_ID] = useState(localStorage.getItem('islogin'));
+ const teacher_ID = localStorage.getItem('islogin')
+ if(teacher_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
const [classData, setClassData] = useState({});
-
- //判断是否登录
- // useEffect(() => {
- // if (!isChecked) {
- // const is_login = localStorage.getItem('islogin');
- // if (!is_login) {
- // alert('未登录');
- // window.location.href = 'http://36.138.114.105:30294/signin';
- // } else {
- // if(teacher_ID.length===8){
- // window.location.href='http://36.138.114.105:30294'
- // return
- // }else{
- // console.log(teacher_ID);
- // }
- // }
- // }
- // }, []);
-
- //可以删
const log=(key)=>{
console.log(key);
}
diff --git a/app-dm/src/TeacherPages/classlistpages/classId.jsx b/app-dm/src/TeacherPages/classlistpages/classId.jsx
index 0e43f84..afbff7a 100644
--- a/app-dm/src/TeacherPages/classlistpages/classId.jsx
+++ b/app-dm/src/TeacherPages/classlistpages/classId.jsx
@@ -8,6 +8,11 @@ import './classid.css'
function TeacherPage() {
+ const teacher_ID=localStorage.getItem('islogin')
+ if(teacher_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
const { key } = useParams();
const [isclick,setisclick]=useState(false)
//学生表格
diff --git a/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx b/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx
index 517c3b9..a9974ab 100644
--- a/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx
+++ b/app-dm/src/TeacherPages/teachermanagetest/ManageTest.jsx
@@ -6,7 +6,11 @@ import './ManageTest.css'
function TeacherPage() {
- const teacher_ID = localStorage.getItem('islogin')
+ const teacher_ID=localStorage.getItem('islogin')
+ if(teacher_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
const [classData, setClassData] = useState({});
const [classtest,setClassTest]=useState()
const [defaultclass,setDefaultClass]=useState()
diff --git a/app-dm/src/pages/Home/Home.jsx b/app-dm/src/pages/Home/Home.jsx
index 40e4815..5c5e246 100644
--- a/app-dm/src/pages/Home/Home.jsx
+++ b/app-dm/src/pages/Home/Home.jsx
@@ -12,22 +12,11 @@ import { max, min } from 'lodash';
// 首页
function Home(){
const [isChecked,setisChecked]=useState(false)
- //判断是否登录
- // useEffect(()=>{
- // if (!isChecked){
- // const is_login=localStorage.getItem('islogin')
- // if(!is_login){
- // alert('未登录')
- // window.location.href='http://localhost:3000/signin'
- // }else{
- // console.log(is_login);
- // console.log('已登录');
- // setisChecked(true)
- // }
- // //组件加载时自动调用login函数进行登录检测
- // }
- // },[]);//在组件加载时只调用一次
-
+ const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('未登录,请先前往登录')
+ window.location.href='http://localhost:3000/signin'
+ }
//课表数据
const [lesson, setLesson] = useState([]);
const [firstlesson, setfirstlesson] = useState([]);
diff --git a/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx b/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx
index 5f1b566..e45fdd9 100644
--- a/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx
+++ b/app-dm/src/pages/ListPages/Analyse/AnalysePages.jsx
@@ -9,6 +9,10 @@ import axios from 'axios';
// 首页 学习分析
function SubjectPage(){
const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
//点击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 67a3c4d..c9aef5e 100644
--- a/app-dm/src/pages/ListPages/Subject/Exam.jsx
+++ b/app-dm/src/pages/ListPages/Subject/Exam.jsx
@@ -6,7 +6,11 @@ import { useEffect, useState } from 'react';
// 首页 课程班级
function Exam(){
const {examId} = useParams()
- const student_ID =localStorage.getItem('islogin')
+ const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
// 初始化倒计时状态
const [countdown, setCountdown] = useState(0);
const Countdown=true
diff --git a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx
index 32a61fe..13d77f8 100644
--- a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx
+++ b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx
@@ -10,6 +10,10 @@ import moment from 'moment';
// 首页 题目集
function SubjectPage(){
const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
const [testdata,settestdata]=useState('')
const [time,settime]=useState(moment().format('YYYY-MM-DD HH:mm:ss'))
const [result,setresult]=useState({})
diff --git a/app-dm/src/pages/ListPages/Training/Operation1.css b/app-dm/src/pages/ListPages/Training/Operation1.css
index 216ab7e..113e8db 100644
--- a/app-dm/src/pages/ListPages/Training/Operation1.css
+++ b/app-dm/src/pages/ListPages/Training/Operation1.css
@@ -128,4 +128,14 @@
margin-top: 5px;
cursor: pointer;
}
+.answered {
+ /* 例如,改变题目的背景色 */
+ width: 40px;
+ height: 30px;
+ background-color: rgb(136, 243, 209);
+ text-align: center;
+ margin-left: 5px;
+ margin-top: 5px;
+ cursor: pointer;
+ }
diff --git a/app-dm/src/pages/ListPages/Training/Operation1.jsx b/app-dm/src/pages/ListPages/Training/Operation1.jsx
index 3052e07..76a8ef3 100644
--- a/app-dm/src/pages/ListPages/Training/Operation1.jsx
+++ b/app-dm/src/pages/ListPages/Training/Operation1.jsx
@@ -11,7 +11,7 @@ import axios from 'axios';
function Operation1() {
const click=()=>{
- console.log(TrainData);
+ console.log(answeredJudge);
}
const clear=()=>{
localStorage.clear('choice_answers');
@@ -20,6 +20,12 @@ function Operation1() {
setcompletion_answer({})
localStorage.clear('judge_answer')
setjudge_answer({})
+ localStorage.clear('answeredChoice')
+ setAnsweredChoice([])
+ localStorage.clear('answeredComple')
+ setAnsweredComple([])
+ localStorage.clear('answeredJudge')
+ setAnsweredJudge([])
}
const { operateID } = useParams();
@@ -33,28 +39,24 @@ function Operation1() {
})
const returnData=TrainDataSrc.data
setTrainData(returnData)
- settime(parseInt(returnData['operateID'][4]))
+ setCountdown(60*parseInt(returnData['operateID'][4]))
}catch{
alert('TrainDataFunc出错')
}
}
-
useEffect(()=>{
TrainDataFunc()
},[])
//倒计时
- const [countdown, setCountdown] = useState(0);
+ const [countdown, setCountdown] = useState();
const [time,settime]=useState()
// 倒计时初始化
- useEffect(() => {
- const examDuration = 60 * time; // 假设考试时长为1小时
- setCountdown(examDuration);
- }, [time]);
+
// 倒计时更新
useEffect(() => {
let interval = setInterval(() => {
- if (countdown > 0) {
+ if (countdown != 0) {
setCountdown(countdown - 1);
} else {
clearInterval(interval);
@@ -79,6 +81,11 @@ function Operation1() {
const [choice_answer,setchoice_answer]=useState({})
const [completion_answer,setcompletion_answer]=useState({})
const [judge_answer,setjudge_answer]=useState({})
+ //选中反馈
+ const [answeredChoice, setAnsweredChoice] = useState([]);
+ const [answeredComple, setAnsweredComple] = useState([]);
+ const [answeredJudge, setAnsweredJudge] = useState([]);
+
//给选择题添加事件监听器
const handleOptionChange = (event) => {
@@ -86,6 +93,10 @@ function Operation1() {
const key = parseInt(event.target.name.replace('group', ''));
const updatedChoiceAnswer = { ...choice_answer, [key]: selectedValue };
setchoice_answer(updatedChoiceAnswer);
+ // 更新已做题目的状态
+ if (!answeredChoice.includes(key)) {
+ setAnsweredChoice([...answeredChoice, key]);
+ }
};
//填空题
const handleInputChange = (event) => {
@@ -94,6 +105,10 @@ function Operation1() {
...completion_answer,
[name]: value
});
+ if (!answeredComple.includes(parseInt(name))) {
+ setAnsweredComple([...answeredComple, parseInt(name)]);
+ }
+
};
//判断题
@@ -102,6 +117,9 @@ function Operation1() {
const key=parseInt(event.target.name.replace('judge',''))
const updatedJudgeAnswer={ ...judge_answer,[key]:judgeoption}
setjudge_answer(updatedJudgeAnswer)
+ if (!answeredJudge.includes(key)) {
+ setAnsweredJudge([...answeredJudge, key]);
+ }
}
//保存答案到 localStorage
@@ -109,6 +127,9 @@ function Operation1() {
localStorage.setItem('choice_answers', JSON.stringify(choice_answer));
localStorage.setItem('completion_answer', JSON.stringify(completion_answer));
localStorage.setItem('judge_answer',JSON.stringify(judge_answer))
+ localStorage.setItem('answeredChoice',answeredChoice)
+ localStorage.setItem('answeredComple',answeredComple)
+ localStorage.setItem('answeredJudge',answeredJudge)
};
// 在组件加载时从 localStorage 中恢复答案
@@ -116,6 +137,9 @@ function Operation1() {
const storedChoiceAnswers = localStorage.getItem('choice_answers');
const storedCompleAnswers = localStorage.getItem('completion_answer');
const storedJudgeAnswers = localStorage.getItem('judge_answer')
+ const storedAnsweredChoice=localStorage.getItem('answeredChoice')
+ const storedAnsweredComple=localStorage.getItem('answeredComple')
+ const storedAnsweredJudge=localStorage.getItem('answeredJudge')
if (storedChoiceAnswers) {
const parsedAnswers = JSON.parse(storedChoiceAnswers);
setchoice_answer(parsedAnswers);
@@ -128,6 +152,16 @@ function Operation1() {
const parsedAnswers = JSON.parse(storedJudgeAnswers);
setjudge_answer(parsedAnswers);
}
+
+ if(storedAnsweredChoice){
+ setAnsweredChoice(storedAnsweredChoice)
+ }
+ if(storedAnsweredComple){
+ setAnsweredComple(storedAnsweredComple)
+ }
+ if(storedAnsweredJudge){
+ setAnsweredJudge(storedAnsweredJudge)
+ }
}, []);
//不包含实训分数
@@ -158,6 +192,8 @@ function Operation1() {
}
+
+
return (
@@ -191,19 +227,19 @@ function Operation1() {
选择题:
{Object.keys(TrainData['operateID'][0]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
填空题:
{Object.keys(TrainData['operateID'][1]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
判断题:
{Object.keys(TrainData['operateID'][2]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
}
diff --git a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
index 9ff46e9..fb68215 100755
--- a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
+++ b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
@@ -11,6 +11,10 @@ const list4=[
// 首页 学习分析
function SubjectPage(){
const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://localhost:3000/signin'
+ }
const [title,setTitle]=useState()
// 获取实训标题
const FetchTrainFunc=async()=>{
diff --git a/python/app.py b/python/app.py
index 8be6d84..debb11f 100644
--- a/python/app.py
+++ b/python/app.py
@@ -2,6 +2,7 @@ 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": "*"}})
@@ -230,6 +231,13 @@ def SendTrainTest():
SendTrainTestFunc(TrainChoice, TrainCompletion, TrainJudge, Hour, Min, StopTime,Class,Train,teacher_id)
return '发布成功'
+
+
+@app.route('/api/student-test',methods=["POST"])
+def student_test():
+ return k8s.list_pods()
+
+
@app.route('/')
@app.route('/
')
def catch_all(path = "index.html"):
diff --git a/python/k8s.py b/python/k8s.py
new file mode 100644
index 0000000..d6f2c04
--- /dev/null
+++ b/python/k8s.py
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..1ad4581
--- /dev/null
+++ b/python/test.txt
@@ -0,0 +1,1146 @@
+{'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 e6ecf80799baa82036e7aeec2b800b5fb8a9e306 Mon Sep 17 00:00:00 2001
From: 30404 <3040471803@qq.com>
Date: Tue, 25 Jun 2024 14:49:31 +0800
Subject: [PATCH 3/5] 1
---
.../TeacherPages/classlistpages/classId.jsx | 39 ++++++++++++++-----
.../TeacherPages/classlistpages/classid.css | 9 ++++-
app-dm/src/nav/nav.jsx | 2 +-
app-dm/src/nav/teacherIndex.jsx | 2 +-
.../pages/ListPages/Training/Operation1.jsx | 12 +++---
app-dm/src/setupProxy.js | 2 +-
python/app.py | 3 ++
python/student_func.py | 1 -
python/teacher_func.py | 29 ++++++++++++++
9 files changed, 79 insertions(+), 20 deletions(-)
diff --git a/app-dm/src/TeacherPages/classlistpages/classId.jsx b/app-dm/src/TeacherPages/classlistpages/classId.jsx
index afbff7a..6baf715 100644
--- a/app-dm/src/TeacherPages/classlistpages/classId.jsx
+++ b/app-dm/src/TeacherPages/classlistpages/classId.jsx
@@ -8,6 +8,9 @@ import './classid.css'
function TeacherPage() {
+ const click=()=>{
+ console.log(classdata);
+ }
const teacher_ID=localStorage.getItem('islogin')
if(teacher_ID==null){
alert('登录过期,请重新登录')
@@ -31,12 +34,6 @@ function TeacherPage() {
class_succeed();
},[])
-
- //学生画像
- const student_fig_btn=()=>{
-
- }
-
//柱形图
const [studentScores, setStudentScores] = useState([]);
@@ -50,6 +47,28 @@ function TeacherPage() {
});
}, [isclick]);
+ function formatDate(dateString) {
+ // 将日期字符串转换为 Date 对象
+ const date = new Date(dateString);
+ // 获取年份、月份和日期
+ const year = date.getFullYear();
+ const monthIndex = date.getMonth();
+ const day = date.getDate();
+
+ // 构建格式化后的日期字符串
+ const formattedDate = `${year}-${(monthIndex + 1).toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
+ return formattedDate;
+ }
+ const Find_details=async (ID)=>{
+ try{
+ const Find_details=await axios.post('api/Find_details',{
+ ID
+ })
+ }catch{
+
+ }
+ }
+
return(
@@ -71,13 +90,13 @@ function TeacherPage() {
{Object.keys(classdata).map((item)=>(
- 班级 |
+ {classdata[item][2]} |
{classdata[item][0]} |
{classdata[item][1]} |
{classdata[item][3]} |
{classdata[item][5]} |
- 出生日期 |
- |
+ {formatDate(classdata[item][4])} |
+ |
))}
@@ -88,6 +107,8 @@ function TeacherPage() {
成绩
+
名字
+