31
31
< section class ="px-8 py-4 sticky top-14 z-40 bg-gray-50 dark:bg-gray-900 border-b dark:border-gray-700 ">
32
32
< div class ="flex flex-col md:flex-row md:items-center gap-4 ">
33
33
< div class ="flex gap-2 flex-wrap ">
34
- < button data-protocol ="wifi " class ="connection-btn h-12 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
34
+ < button data-protocol ="wifi " class ="connection-btn h-10 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
35
35
< i class ="fas fa-wifi text-lg "> </ i >
36
36
< span class ="text-sm font-medium "> WiFi</ span >
37
37
</ button >
38
- < button data-protocol ="ble " class ="connection-btn h-12 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
38
+ < button data-protocol ="ble " class ="connection-btn h-10 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
39
39
< i class ="fab fa-bluetooth text-lg "> </ i >
40
40
< span class ="text-sm font-medium "> Bluetooth</ span >
41
41
</ button >
42
- < button data-protocol ="usb " class ="connection-btn h-12 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
42
+ < button data-protocol ="usb " class ="connection-btn h-10 px-4 border-2 border-cyan-500 rounded-lg flex items-center gap-2 hover:bg-cyan-500 hover:text-white transition-colors text-gray-700 dark:text-gray-200 cursor-pointer ">
43
43
< i class ="fas fa-microchip text-lg "> </ i >
44
44
< span class ="text-sm font-medium "> Serial</ span >
45
45
</ button >
46
46
</ div >
47
- < button id ="connect-btn " class ="h-12 bg-cyan-500 text-white rounded-lg hover:bg-cyan-600 transition-colors font-semibold px-6 ">
47
+ < button id ="connect-btn " class ="h-10 bg-cyan-500 text-white rounded-lg hover:bg-cyan-600 transition-colors font-semibold px-6 ">
48
48
Connect Device
49
49
</ button >
50
- < button id ="connecting-btn " class ="h-12 bg-yellow-500 text-white rounded-lg font-semibold px-6 hidden " disabled >
50
+ < button id ="connecting-btn " class ="h-10 bg-yellow-500 text-white rounded-lg font-semibold px-6 hidden " disabled >
51
51
< i class ="fas fa-spinner fa-spin mr-2 "> </ i > Connecting...
52
52
</ button >
53
- < button id ="disconnect-btn " class ="h-12 bg-gray-500 text-white rounded-lg hover:bg-gray-600 transition-colors font-semibold px-6 hidden ">
53
+ < button id ="disconnect-btn " class ="h-10 bg-gray-500 text-white rounded-lg hover:bg-gray-600 transition-colors font-semibold px-6 hidden ">
54
54
Disconnect
55
55
</ button >
56
+ < button id ="disconnecting-btn " class ="h-10 bg-yellow-500 text-white rounded-lg font-semibold px-6 hidden " disabled >
57
+ < i class ="fas fa-spinner fa-spin mr-2 "> </ i > Disconnecting...
58
+ </ button >
56
59
57
60
< div class ="hidden md:block self-stretch w-px bg-gray-300 dark:bg-gray-700 mx-4 "> </ div >
58
61
65
68
</ span >
66
69
</ div >
67
70
68
- < button id ="record-btn " class ="h-12 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors font-semibold px-6 ">
71
+ < button id ="record-btn " class ="h-10 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors font-semibold px-6 ">
69
72
Start Recording
70
73
</ button >
71
74
< div id ="recording-status " class ="flex items-center hidden ">
@@ -354,6 +357,7 @@ <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-1">${app.ti
354
357
const connectBtn = document . getElementById ( 'connect-btn' ) ;
355
358
const connectingBtn = document . getElementById ( 'connecting-btn' ) ;
356
359
const disconnectBtn = document . getElementById ( 'disconnect-btn' ) ;
360
+ const disconnectingBtn = document . getElementById ( 'disconnecting-btn' ) ;
357
361
const recordBtn = document . getElementById ( 'record-btn' ) ;
358
362
const filenameInput = document . getElementById ( 'filename' ) ;
359
363
const recordingStatus = document . getElementById ( 'recording-status' ) ;
@@ -699,7 +703,7 @@ <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-1">${app.ti
699
703
try {
700
704
// Show connecting state during disconnection
701
705
disconnectBtn . classList . add ( 'hidden' ) ;
702
- connectingBtn . classList . remove ( 'hidden' ) ;
706
+ disconnectingBtn . classList . remove ( 'hidden' ) ;
703
707
showStatus ( 'Disconnecting...' , 'fa-spinner fa-spin' , 'text-blue-500' ) ;
704
708
705
709
const response = await fetch ( '/disconnect' , { method : 'POST' } ) ;
@@ -708,7 +712,7 @@ <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-1">${app.ti
708
712
if ( data . status === 'disconnected' ) {
709
713
isConnected = false ;
710
714
// Return to connect state
711
- connectingBtn . classList . add ( 'hidden' ) ;
715
+ disconnectingBtn . classList . add ( 'hidden' ) ;
712
716
connectBtn . classList . remove ( 'hidden' ) ;
713
717
714
718
// Reset all protocol buttons
@@ -748,7 +752,7 @@ <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-1">${app.ti
748
752
} catch ( error ) {
749
753
console . error ( 'Disconnection error:' , error ) ;
750
754
// Return to disconnect state if disconnection failed
751
- connectingBtn . classList . add ( 'hidden' ) ;
755
+ disconnectingBtn . classList . add ( 'hidden' ) ;
752
756
disconnectBtn . classList . remove ( 'hidden' ) ;
753
757
showStatus ( `Disconnection failed: ${ error . message } ` , 'fa-times-circle' , 'text-red-500' ) ;
754
758
}
@@ -867,6 +871,7 @@ <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-1">${app.ti
867
871
if ( isConnected ) {
868
872
isConnected = false ;
869
873
disconnectBtn . classList . add ( 'hidden' ) ;
874
+ disconnectingBtn . classList . add ( 'hidden' ) ;
870
875
connectingBtn . classList . add ( 'hidden' ) ;
871
876
connectBtn . classList . remove ( 'hidden' ) ;
872
877
0 commit comments