some chage
This commit is contained in:
31
Html/.log
31
Html/.log
@@ -434,3 +434,34 @@ Traceback (most recent call last):
|
||||
File "/usr/lib/python3/dist-packages/cryptography/exceptions.py", line 9, in <module>
|
||||
from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
|
||||
pyo3_runtime.PanicException: Python API call failed
|
||||
[2025-10-28 14:36:27,578] ERROR in app: Exception on /dashboard [GET]
|
||||
Traceback (most recent call last):
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/app.py", line 1511, in wsgi_app
|
||||
response = self.full_dispatch_request()
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/app.py", line 919, in full_dispatch_request
|
||||
rv = self.handle_user_exception(e)
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function
|
||||
return cors_after_request(app.make_response(f(*args, **kwargs)))
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/app.py", line 917, in full_dispatch_request
|
||||
rv = self.dispatch_request()
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/app.py", line 902, in dispatch_request
|
||||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
|
||||
File "/home/flask/hsmooc/hsa/Html/apps/auth/decorators.py", line 61, in wrapper
|
||||
return func(*args, **kwargs)
|
||||
File "/home/flask/hsmooc/hsa/Html/apps/views/dashboard.py", line 28, in dashboard
|
||||
return render_template(
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/templating.py", line 150, in render_template
|
||||
return _render(app, template, context)
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/templating.py", line 131, in _render
|
||||
rv = template.render(context)
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 1295, in render
|
||||
self.environment.handle_exception()
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 942, in handle_exception
|
||||
raise rewrite_traceback_stack(source=source)
|
||||
File "/home/flask/hsmooc/hsa/Html/apps/templates/dashboard.html", line 17, in top-level template code
|
||||
{% include 'learning-path.html' %} <!-- 引入learning-path.html -->
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/templating.py", line 65, in get_source
|
||||
return self._get_source_fast(environment, template)
|
||||
File "/home/flask/hsmooc/.venv/lib/python3.10/site-packages/flask/templating.py", line 99, in _get_source_fast
|
||||
raise TemplateNotFound(template)
|
||||
jinja2.exceptions.TemplateNotFound: learning-path.html
|
||||
|
||||
281
Html/apps/static/css/learning-path.css
Normal file
281
Html/apps/static/css/learning-path.css
Normal file
@@ -0,0 +1,281 @@
|
||||
:root {
|
||||
--primary-blue: #6A9FB5;
|
||||
--secondary-blue: #8BB4C5;
|
||||
--light-blue: #E1F0F7;
|
||||
--accent-blue: #4A7B9D;
|
||||
--text-dark: #2C3E50;
|
||||
--text-light: #7F8C8D;
|
||||
--card-shadow: 0 4px 12px rgba(106, 159, 181, 0.15);
|
||||
}
|
||||
|
||||
/* 学习路径区域 */
|
||||
.learning-path-section {
|
||||
background: linear-gradient(135deg, var(--light-blue), #D4E9F2);
|
||||
padding: 2rem 0;
|
||||
border-radius: 0 0 20px 20px;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
color: var(--accent-blue);
|
||||
font-weight: 600;
|
||||
margin-bottom: 1.5rem;
|
||||
position: relative;
|
||||
padding-bottom: 0.5rem;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.section-title:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 60px;
|
||||
height: 3px;
|
||||
background-color: var(--primary-blue);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* 专业选择器 */
|
||||
.major-selector {
|
||||
position: relative;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.major-selector label {
|
||||
font-weight: 600;
|
||||
color: var(--accent-blue);
|
||||
margin-bottom: 0.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.major-selector select {
|
||||
appearance: none;
|
||||
background-color: white;
|
||||
border: 2px solid var(--primary-blue);
|
||||
border-radius: 8px;
|
||||
padding: 0.75rem 1.5rem;
|
||||
font-size: 1rem;
|
||||
color: var(--text-dark);
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.major-selector select:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px rgba(106, 159, 181, 0.3);
|
||||
border-color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.major-selector::after {
|
||||
content: '\f078';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 1rem;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
color: var(--primary-blue);
|
||||
}
|
||||
|
||||
/* 学习路径流程图 */
|
||||
.path-flow {
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
padding: 2rem;
|
||||
box-shadow: var(--card-shadow);
|
||||
overflow-x: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.path-container {
|
||||
display: flex;
|
||||
min-width: 900px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.path-step {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.step-connector {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: -50%;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-color: var(--primary-blue);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.step-node {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--light-blue);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.step-node:hover {
|
||||
transform: scale(1.05);
|
||||
background-color: var(--primary-blue);
|
||||
}
|
||||
|
||||
.step-node:hover .step-icon {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.step-icon {
|
||||
font-size: 1.8rem;
|
||||
color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.step-content {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.step-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.step-courses {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-light);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.step-progress {
|
||||
height: 6px;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.step-progress-bar {
|
||||
height: 100%;
|
||||
background-color: var(--primary-blue);
|
||||
border-radius: 3px;
|
||||
transition: width 0.5s ease;
|
||||
}
|
||||
|
||||
.step-status {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
/* 阶段状态样式 */
|
||||
.step-completed .step-node {
|
||||
background-color: var(--primary-blue);
|
||||
}
|
||||
|
||||
.step-completed .step-icon {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.step-active .step-node {
|
||||
background-color: var(--accent-blue);
|
||||
box-shadow: 0 0 0 4px rgba(74, 123, 157, 0.3);
|
||||
}
|
||||
|
||||
.step-active .step-icon {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* 课程详情面板 */
|
||||
.course-panel {
|
||||
display: none;
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
box-shadow: var(--card-shadow);
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.course-panel.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-weight: 600;
|
||||
color: var(--accent-blue);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.close-panel {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.2rem;
|
||||
color: var(--text-light);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.course-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.course-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.75rem;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e9ecef;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.course-item:hover {
|
||||
border-color: var(--primary-blue);
|
||||
box-shadow: 0 2px 8px rgba(106, 159, 181, 0.15);
|
||||
}
|
||||
|
||||
.course-check {
|
||||
margin-right: 0.75rem;
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.course-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.course-name {
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.course-duration {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.course-action {
|
||||
margin-left: 0.75rem;
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
/* 页眉导航栏 */
|
||||
.navbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #2575fc;
|
||||
color: rgb(235, 235, 235);
|
||||
border-radius: 10px;
|
||||
margin-bottom: 30px;
|
||||
background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
padding: 0.8rem 1rem;
|
||||
}
|
||||
|
||||
.navbar .logo h1 {
|
||||
|
||||
30
Html/apps/static/js/learning-path.js
Normal file
30
Html/apps/static/js/learning-path.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// 1. 点击学习阶段节点,显示对应课程面板
|
||||
document.querySelectorAll('.step-node').forEach((node) => {
|
||||
node.addEventListener('click', function () {
|
||||
// 隐藏所有面板
|
||||
document.querySelectorAll('.course-panel').forEach(panel => {
|
||||
panel.classList.remove('active');
|
||||
});
|
||||
// 获取当前阶段名称,匹配面板ID
|
||||
const stepTitle = this.closest('.path-step').querySelector('.step-title').textContent;
|
||||
const panelId = stepTitle.toLowerCase().replace(' ', '-') + '-panel';
|
||||
const targetPanel = document.getElementById(panelId);
|
||||
// 显示对应面板(若存在)
|
||||
if (targetPanel) {
|
||||
targetPanel.classList.add('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 2. 关闭课程面板
|
||||
document.querySelectorAll('.close-panel').forEach(button => {
|
||||
button.addEventListener('click', function () {
|
||||
this.closest('.course-panel').classList.remove('active');
|
||||
});
|
||||
});
|
||||
|
||||
// 3. 切换专业方向(可扩展为动态更新学习路径)
|
||||
document.getElementById('majorSelect').addEventListener('change', function () {
|
||||
const selectedMajor = this.options[this.selectedIndex].text;
|
||||
// 实际项目中可替换为AJAX请求,加载对应专业的学习路径
|
||||
});
|
||||
@@ -9,10 +9,12 @@
|
||||
<!-- Font Awesome 图标 -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="/static/css/dashboard.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
{% include 'navbar.html' %} <!-- 引入navbar.html -->
|
||||
{% include 'learning-path.html' %} <!-- 引入learning-path.html -->
|
||||
<section class="search-section">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
|
||||
145
Html/apps/templates/learning-path.html
Normal file
145
Html/apps/templates/learning-path.html
Normal file
@@ -0,0 +1,145 @@
|
||||
<link rel="stylesheet" href="/static/css/learning-path.css">
|
||||
<!-- 学习路径区域 -->
|
||||
<section class="learning-path-section">
|
||||
<div class="container">
|
||||
<h2 class="section-title">学习路径</h2>
|
||||
|
||||
<!-- 专业选择器 -->
|
||||
<div class="major-selector">
|
||||
<label for="majorSelect">选择专业方向:</label>
|
||||
<select class="form-select" id="majorSelect">
|
||||
<option value="computer">计算机科学与技术</option>
|
||||
<option value="data">数据科学与大数据</option>
|
||||
<option value="business">工商管理</option>
|
||||
<option value="design">艺术设计</option>
|
||||
<option value="language">语言文学</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 学习路径流程图 -->
|
||||
<div class="path-flow">
|
||||
<div class="path-container">
|
||||
<!-- 阶段1:已完成 -->
|
||||
<div class="path-step step-completed">
|
||||
<div class="step-connector"></div>
|
||||
<div class="step-node">
|
||||
<i class="fas fa-code step-icon"></i>
|
||||
</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">编程基础</div>
|
||||
<div class="step-courses">3门课程</div>
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-bar" style="width: 100%"></div>
|
||||
</div>
|
||||
<div class="step-status">已完成</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 阶段2:已完成 -->
|
||||
<div class="path-step step-completed">
|
||||
<div class="step-connector"></div>
|
||||
<div class="step-node">
|
||||
<i class="fas fa-project-diagram step-icon"></i>
|
||||
</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">数据结构</div>
|
||||
<div class="step-courses">2门课程</div>
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-bar" style="width: 100%"></div>
|
||||
</div>
|
||||
<div class="step-status">已完成</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 阶段3:进行中 -->
|
||||
<div class="path-step step-active">
|
||||
<div class="step-connector"></div>
|
||||
<div class="step-node">
|
||||
<i class="fas fa-brain step-icon"></i>
|
||||
</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">算法设计</div>
|
||||
<div class="step-courses">3门课程</div>
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-bar" style="width: 67%"></div>
|
||||
</div>
|
||||
<div class="step-status">进行中</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 阶段4:未开始 -->
|
||||
<div class="path-step">
|
||||
<div class="step-connector"></div>
|
||||
<div class="step-node">
|
||||
<i class="fas fa-database step-icon"></i>
|
||||
</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">数据库原理</div>
|
||||
<div class="step-courses">2门课程</div>
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-bar" style="width: 0%"></div>
|
||||
</div>
|
||||
<div class="step-status">未开始</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 阶段5:未开始 -->
|
||||
<div class="path-step">
|
||||
<div class="step-connector"></div>
|
||||
<div class="step-node">
|
||||
<i class="fas fa-laptop-code step-icon"></i>
|
||||
</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">Web开发</div>
|
||||
<div class="step-courses">5门课程</div>
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-bar" style="width: 0%"></div>
|
||||
</div>
|
||||
<div class="step-status">未开始</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 课程详情面板(默认隐藏,点击阶段显示) -->
|
||||
<div class="course-panel" id="algorithm-panel">
|
||||
<div class="panel-header">
|
||||
<h3 class="panel-title">算法设计 - 课程列表</h3>
|
||||
<button class="close-panel"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="course-list">
|
||||
<div class="course-item">
|
||||
<i class="fas fa-check-circle course-check"></i>
|
||||
<div class="course-info">
|
||||
<div class="course-name">算法基础与复杂度分析</div>
|
||||
<div class="course-duration">12课时</div>
|
||||
</div>
|
||||
<div class="course-action">
|
||||
<button class="btn btn-sm btn-primary">继续学习</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="course-item">
|
||||
<i class="fas fa-check-circle course-check"></i>
|
||||
<div class="course-info">
|
||||
<div class="course-name">排序与搜索算法</div>
|
||||
<div class="course-duration">15课时</div>
|
||||
</div>
|
||||
<div class="course-action">
|
||||
<button class="btn btn-sm btn-primary">继续学习</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="course-item">
|
||||
<i class="far fa-circle course-check"></i>
|
||||
<div class="course-info">
|
||||
<div class="course-name">动态规划与贪心算法</div>
|
||||
<div class="course-duration">18课时</div>
|
||||
</div>
|
||||
<div class="course-action">
|
||||
<button class="btn btn-sm btn-outline-primary">开始学习</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/js/learning-path.js"></script>
|
||||
</section>
|
||||
Reference in New Issue
Block a user