Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update index.html
Browse files- index.html +28 -6
index.html
CHANGED
|
@@ -916,17 +916,39 @@
|
|
| 916 |
};
|
| 917 |
|
| 918 |
this.ws.onclose = (event) => {
|
| 919 |
-
|
|
|
|
|
|
|
| 920 |
this.isGenerating = false;
|
|
|
|
|
|
|
|
|
|
| 921 |
this.stopFrameExtraction();
|
| 922 |
this.stopRecording();
|
| 923 |
this.stopPlaybackLoop();
|
| 924 |
-
this.ws = null;
|
| 925 |
-
this.updateUI();
|
| 926 |
|
| 927 |
-
// Update
|
| 928 |
-
document.getElementById('
|
| 929 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 930 |
};
|
| 931 |
|
| 932 |
} catch (error) {
|
|
|
|
| 916 |
};
|
| 917 |
|
| 918 |
this.ws.onclose = (event) => {
|
| 919 |
+
console.log('WebSocket closed:', event.reason);
|
| 920 |
+
|
| 921 |
+
// Force state reset
|
| 922 |
this.isGenerating = false;
|
| 923 |
+
this.ws = null;
|
| 924 |
+
|
| 925 |
+
// Stop all processes
|
| 926 |
this.stopFrameExtraction();
|
| 927 |
this.stopRecording();
|
| 928 |
this.stopPlaybackLoop();
|
|
|
|
|
|
|
| 929 |
|
| 930 |
+
// Update UI immediately
|
| 931 |
+
const btn = document.getElementById('startStopBtn');
|
| 932 |
+
if (btn) {
|
| 933 |
+
btn.textContent = 'Start Generation';
|
| 934 |
+
btn.className = 'btn btn-primary';
|
| 935 |
+
btn.disabled = false;
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
// Update status
|
| 939 |
+
const statusPill = document.getElementById('statusPill');
|
| 940 |
+
if (statusPill) {
|
| 941 |
+
statusPill.className = 'status-pill status-disconnected';
|
| 942 |
+
statusPill.textContent = 'Disconnected';
|
| 943 |
+
}
|
| 944 |
+
|
| 945 |
+
// Re-enable mode buttons
|
| 946 |
+
['textModeBtn', 'videoModeBtn', 'webcamModeBtn'].forEach(id => {
|
| 947 |
+
const btn = document.getElementById(id);
|
| 948 |
+
if (btn) btn.disabled = false;
|
| 949 |
+
});
|
| 950 |
+
|
| 951 |
+
this.showInfo(`Disconnected: ${event.reason || 'Generation complete'}`);
|
| 952 |
};
|
| 953 |
|
| 954 |
} catch (error) {
|