@@ -319,13 +319,13 @@
const response = await axios.get('/api/devices');
this.devices = response.data;
} catch (error) {
- this.showToast('Failed to load devices', 'error');
+ this.showToast('加载设备失败', 'error');
}
},
async createAndStartSession() {
if (!this.config.deviceId) {
- this.showToast('Please select a device', 'error');
+ this.showToast('请选择设备', 'error');
return;
}
@@ -348,16 +348,16 @@
// 保存到 localStorage
localStorage.setItem('current_session_id', this.currentSessionId);
- this.showToast('Session created! Starting...', 'success');
+ this.showToast('会话已创建!正在启动...', 'success');
// Start session
await VideoLearningModule.startSession(this.currentSessionId);
- this.showToast('Learning session started!', 'success');
+ this.showToast('学习会话已启动!', 'success');
// Initial status update
await this.updateSessionStatus();
} catch (error) {
- this.showToast('Failed to create session: ' + error.message, 'error');
+ this.showToast('创建会话失败:' + error.message, 'error');
} finally {
this.loading = false;
}
@@ -369,9 +369,9 @@
try {
await VideoLearningModule.controlSession(this.currentSessionId, 'pause');
await this.updateSessionStatus();
- this.showToast('Session paused', 'info');
+ this.showToast('会话已暂停', 'info');
} catch (error) {
- this.showToast('Failed to pause session', 'error');
+ this.showToast('暂停会话失败', 'error');
}
},
@@ -381,16 +381,16 @@
try {
await VideoLearningModule.controlSession(this.currentSessionId, 'resume');
await this.updateSessionStatus();
- this.showToast('Session resumed', 'info');
+ this.showToast('会话已恢复', 'info');
} catch (error) {
- this.showToast('Failed to resume session', 'error');
+ this.showToast('恢复会话失败', 'error');
}
},
async stopSession() {
if (!this.currentSessionId) return;
- if (!confirm('Are you sure you want to stop this session?')) return;
+ if (!confirm('确定要停止此会话吗?')) return;
try {
await VideoLearningModule.controlSession(this.currentSessionId, 'stop');
@@ -400,9 +400,9 @@
if (this.sessionStatus) {
this.sessionStatus.is_active = false;
}
- this.showToast('Session stopped', 'info');
+ this.showToast('会话已停止', 'info');
} catch (error) {
- this.showToast('Failed to stop session', 'error');
+ this.showToast('停止会话失败', 'error');
}
},
@@ -413,7 +413,7 @@
this.sessionStatus = await VideoLearningModule.getSessionStatus(this.currentSessionId);
this.videos = await VideoLearningModule.getSessionVideos(this.currentSessionId);
} catch (error) {
- console.error('Error updating session status:', error);
+ console.error('更新会话状态错误:', error);
}
},