mergeok
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
<div class="course-info">
|
||||
<h3 class="course-name">{{course.name}}</h3>
|
||||
<p class="course-description">{{course.description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -168,30 +168,36 @@
|
||||
method: 'GET',
|
||||
credentials: 'include' // 包含 Cookie,确保 Flask 可以识别 session
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) return response.json();
|
||||
throw new Error('Failed to fetch session');
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Session data:', data);
|
||||
|
||||
// 在成功获取 session 后创建并插入 iframe
|
||||
const iframe = document.createElement('iframe');
|
||||
const sessionInfo = data
|
||||
iframe.src = '{{vscode_web_url}}/?workspace={{workspace_path}}&folder={{workspace_path}}';
|
||||
iframe.style.width = '100%';
|
||||
iframe.style.height = '99%';
|
||||
|
||||
// 将 iframe 插入到指定的 div 中
|
||||
document.getElementById('vscodeWeb').appendChild(iframe);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching session:', error);
|
||||
});
|
||||
|
||||
|
||||
.then(response => {
|
||||
if (response.ok) return response.json();
|
||||
throw new Error('Failed to fetch session');
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Session data:', data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching session:', error);
|
||||
});
|
||||
|
||||
|
||||
let lastIframe = null;
|
||||
function OpenIframe(){
|
||||
// 在成功获取 session 后创建并插入 iframe
|
||||
const iframe = document.createElement('iframe');
|
||||
const div=document.getElementById('vscodeWeb')
|
||||
if (lastIframe){
|
||||
lastIframe.remove();
|
||||
}
|
||||
|
||||
lastIframe = iframe;
|
||||
|
||||
const sessionInfo = data
|
||||
iframe.src = '{{vscode_web_url}}/?workspace={{workspace_path}}&folder={{workspace_path}}';
|
||||
iframe.style.width = '100%';
|
||||
iframe.style.height = '99%';
|
||||
// 将 iframe 插入到指定的 div 中
|
||||
div.appendChild(iframe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -237,6 +243,8 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
<script src="/static/js/chatbox.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -29,9 +29,14 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>版权所有 © 2024 “华实伴学君”——教学练评一体的虚拟编码助教</p>
|
||||
</footer>
|
||||
<footer>
|
||||
<p>版权所有 © 2024 “华实伴学君”——教学练评一体的虚拟编码助教</p>
|
||||
<p>
|
||||
<a href="https://beian.miit.gov.cn" target="_blank" rel="noopener noreferrer">
|
||||
沪ICP备2025142149号
|
||||
</a>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
<a href="/">首页</a>
|
||||
<a href="/dashboard">课程</a>
|
||||
<a href="/grades">成绩</a>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="avatar dropdown">
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>学生注册</title>
|
||||
<link rel="stylesheet" href="/static/css/login.css">
|
||||
<link rel="stylesheet" href="/static/css/register_field_tip.css">
|
||||
<script src="/static/js/register.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -15,6 +16,17 @@
|
||||
<div class="input-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username" placeholder="请输入用户名" required>
|
||||
<div class="field-tip" id="username-tip" role="tooltip" aria-hidden="true">
|
||||
<strong>用户名规则</strong>
|
||||
<ul>
|
||||
<li>以<span>小写字母</span>或<span>下划线</span>开头</li>
|
||||
<li>仅含<span>小写字母</span>、<span>数字</span>、<span>下划线 _</span>、<span>连字符 -</span></li>
|
||||
<li>允许以 <span>$</span> 结尾(可选)</li>
|
||||
<li>长度 ≤ 32 个字符</li>
|
||||
<li>不可使用纯数字</li>
|
||||
<li>避免保留名:root / daemon 等</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="email">邮箱</label>
|
||||
@@ -32,5 +44,8 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/js/register_field_tip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>教师注册</title>
|
||||
<link rel="stylesheet" href="/static/css/login.css">
|
||||
<link rel="stylesheet" href="/static/css/register_field_tip.css">
|
||||
<script src="/static/js/register_teacher.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -30,7 +31,20 @@
|
||||
</div>
|
||||
<button type="submit" class="login-btn">注册</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-tip" id="username-tip" role="tooltip" aria-hidden="true">
|
||||
<strong>用户名规则</strong>
|
||||
<ul>
|
||||
<li>以<span>小写字母</span>或<span>下划线</span>开头</li>
|
||||
<li>仅含<span>小写字母</span>、<span>数字</span>、<span>下划线 _</span>、<span>连字符 -</span></li>
|
||||
<li>允许以 <span>$</span> 结尾(可选)</li>
|
||||
<li>长度 ≤ 32 个字符</li>
|
||||
<li>不可使用纯数字</li>
|
||||
<li>避免保留名:root / daemon 等</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/register_field_tip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user