File tree Expand file tree Collapse file tree 2 files changed +1187
-1117
lines changed
Expand file tree Collapse file tree 2 files changed +1187
-1117
lines changed Original file line number Diff line number Diff line change @@ -170,10 +170,31 @@ class WebuiBridge {
170170 }
171171 }
172172 #freezeUi( ) {
173- document . body . style . filter = 'contrast(1%)' ;
173+ if ( document . getElementById ( 'webui-error-connection-lost' ) ) return ;
174+ const div = document . createElement ( 'div' ) ;
175+ div . id = 'webui-error-connection-lost' ;
176+ Object . assign ( div . style , {
177+ position : 'relative' ,
178+ top : '0' ,
179+ left : '0' ,
180+ width : '100%' ,
181+ backgroundColor : '#ff4d4d' ,
182+ color : '#fff' ,
183+ textAlign : 'center' ,
184+ padding : '2px 0' ,
185+ fontFamily : 'Arial, sans-serif' ,
186+ fontSize : '14px' ,
187+ zIndex : '1000' ,
188+ lineHeight : '1'
189+ } ) ;
190+ div . innerText = 'WebUI Error: Connection with the backend is lost.' ;
191+ document . body . insertBefore ( div , document . body . firstChild ) ;
174192 }
175193 #unfreezeUI( ) {
176- document . body . style . filter = 'contrast(100%)' ;
194+ const div = document . getElementById ( 'webui-error-connection-lost' ) ;
195+ if ( div ) {
196+ div . remove ( ) ;
197+ }
177198 }
178199 #isTextBasedCommand( cmd : number ) : Boolean {
179200 if ( cmd !== this . #CMD_SEND_RAW) return true ;
You can’t perform that action at this time.
0 commit comments