File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 99 < body >
1010 < div class ="heading "> STORINATOR</ div >
1111
12- < button id ="powerLed " type ="button " class ="button " disabled >
12+ < button
13+ id ="powerLed "
14+ type ="button "
15+ class ="button "
16+ disabled
17+ style ="color: #b413ff "
18+ >
1319 NO CONNECTION
1420 </ button >
1521 < button
6975 powerLed . textContent = 'POWER LED'
7076 powerLed . style . color = '#eb1e8f'
7177 } else {
72- powerLed . style . color = '#cfcfcf '
78+ powerLed . style . color = '#b413ff '
7379 powerLed . textContent = 'NO CONNECTION'
7480 }
7581 }
100106 if ( this . response . toString ( ) . includes ( REQ_POWER_STATUS + ':on' ) )
101107 togglePowerLedColor ( 'on' )
102108 else togglePowerLedColor ( 'off' )
109+ } else if ( this . readyState == 4 ) {
110+ togglePowerLedColor ( 'nocon' )
111+ console . log ( 'No connection to server.' )
103112 }
104- } else if ( this . readyState == 4 && this . status == 404 ) {
105- togglePowerLedColor ( 'nocon' )
106- console . log ( 'No connection to server.' )
107113 }
108114 }
115+ xhttp . onerror = function ( ) {
116+ togglePowerLedColor ( 'nocon' )
117+ console . log ( 'No connection to server.' )
118+ }
109119 xhttp . open ( 'GET' , request , true )
110120 xhttp . send ( )
111121 }
Original file line number Diff line number Diff line change 4949 display : flex;
5050 align-items : center;
5151 justify-content : center;
52- padding : 5% ;
52+ margin : 5% ;
5353}
You can’t perform that action at this time.
0 commit comments