File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,6 @@ class VirtualNetworkInterface {
8989 return ;
9090
9191 case "webinterface_loaded" :
92- clearTimeout ( this . timeout ) ;
93- this . setParentState . parentState ( { show_spinner : false } ) ;
9492 iframe . contentWindow . postMessage ( {
9593 connection_id : this . id ,
9694 } ) ;
@@ -152,7 +150,14 @@ class VirtualNetworkInterface {
152150 case "ready" :
153151 this . setParentState . parentState ( { connection_state : ConnectionState . LoadingWebinterface } ) ;
154152 const iframe = document . getElementById ( "interface" ) as HTMLIFrameElement ;
155- iframe . src = `/wg-${ this . id } /` ;
153+ const path = window . location . pathname . slice ( 0 , window . location . pathname . endsWith ( "/" ) ? - 1 : undefined ) ;
154+ const split = path . split ( "/" ) ;
155+ const newPath = split . slice ( 3 ) . join ( "/" ) ;
156+ iframe . src = `/wg-${ this . id } /${ newPath } ` ;
157+ iframe . addEventListener ( "load" , ( ) => {
158+ clearTimeout ( this . timeout ) ;
159+ this . setParentState . parentState ( { show_spinner : false } ) ;
160+ } ) ;
156161 break ;
157162 case "closed" :
158163 this . worker . terminate ( ) ;
You can’t perform that action at this time.
0 commit comments