优化布局

This commit is contained in:
CN-JS-HuiBai
2026-04-04 15:40:51 +08:00
parent 888ca621e4
commit 97a339f08d
3 changed files with 24 additions and 16 deletions

View File

@@ -381,7 +381,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (stopTranscodeBtn) {
stopTranscodeBtn.classList.add('hidden');
stopTranscodeBtn.disabled = false;
stopTranscodeBtn.textContent = 'Stop Transcode';
stopTranscodeBtn.textContent = '停止播放';
}
};
@@ -862,13 +862,13 @@ document.addEventListener('DOMContentLoaded', () => {
if (transcodeBtn) {
transcodeBtn.disabled = false;
transcodeBtn.textContent = 'Start Transcode';
transcodeBtn.textContent = '开始播放';
transcodeBtn.classList.remove('hidden');
}
if (stopTranscodeBtn) {
stopTranscodeBtn.classList.add('hidden');
stopTranscodeBtn.disabled = false;
stopTranscodeBtn.textContent = 'Stop Transcode';
stopTranscodeBtn.textContent = '停止播放';
}
if (clearPlayingDownloadBtn) {
@@ -897,12 +897,12 @@ document.addEventListener('DOMContentLoaded', () => {
if (!selectedKey) return;
if (transcodeBtn) {
transcodeBtn.disabled = true;
transcodeBtn.textContent = 'Starting...';
transcodeBtn.textContent = '播放中...';
}
if (stopTranscodeBtn) {
stopTranscodeBtn.classList.remove('hidden');
stopTranscodeBtn.disabled = false;
stopTranscodeBtn.textContent = 'Stop Transcode';
stopTranscodeBtn.textContent = '停止播放';
}
stopPolling();
resetPhases();
@@ -983,7 +983,7 @@ document.addEventListener('DOMContentLoaded', () => {
const stopTranscode = async () => {
if (!currentVideoKey || !stopTranscodeBtn) return;
stopTranscodeBtn.disabled = true;
stopTranscodeBtn.textContent = 'Stopping...';
stopTranscodeBtn.textContent = '停止中...';
try {
const res = await fetch('/api/stop-transcode', {
@@ -1009,17 +1009,17 @@ document.addEventListener('DOMContentLoaded', () => {
updatePlayControls();
if (transcodeBtn) {
transcodeBtn.disabled = false;
transcodeBtn.textContent = 'Start Transcode';
transcodeBtn.textContent = '开始播放';
transcodeBtn.classList.remove('hidden');
}
stopTranscodeBtn.classList.add('hidden');
} catch (err) {
console.error('Stop transcode failed:', err);
alert(`Stop transcode failed: ${err.message}`);
alert(`停止播放失败: ${err.message}`);
} finally {
if (stopTranscodeBtn) {
stopTranscodeBtn.disabled = false;
stopTranscodeBtn.textContent = 'Stop Transcode';
stopTranscodeBtn.textContent = '停止播放';
}
}
};