@@ -119,6 +119,7 @@ Menu.setApplicationMenu(menu)
119119let serverProcess ;
120120let serverPort = 7788 ;
121121let extensionRegistry = "ghcr.io" ;
122+ let downloadTimeout = "1m" ;
122123
123124// This method will be called when Electron has finished
124125// initialization and is ready to create browser windows.
@@ -127,26 +128,33 @@ app.whenReady().then(() => {
127128 ipcMain . on ( 'openLogDir' , ( ) => {
128129 shell . openExternal ( 'file://' + server . getLogfile ( ) )
129130 } )
131+ ipcMain . handle ( 'openWithExternalBrowser' , ( e , address ) => {
132+ shell . openExternal ( address )
133+ } )
130134 ipcMain . on ( 'startServer' , startServer )
131135 ipcMain . on ( 'stopServer' , stopServer )
132136 ipcMain . on ( 'control' , ( e , okCallback , errCallback ) => {
133137 server . control ( okCallback , errCallback )
134138 } )
139+ ipcMain . handle ( 'getPort' , ( ) => {
140+ return serverPort
141+ } )
135142 ipcMain . handle ( 'setPort' , ( e , port ) => {
136- console . log ( 'setPort' , port )
137143 serverPort = port ;
138144 } )
145+ ipcMain . handle ( 'getExtensionRegistry' , ( ) => {
146+ return extensionRegistry
147+ } )
139148 ipcMain . handle ( 'setExtensionRegistry' , ( e , registry ) => {
140- console . log ( 'setExtensionRegistry' , registry )
141149 extensionRegistry = registry
142150 } )
143- ipcMain . handle ( 'getExtensionRegistry ' , ( ) => {
144- return extensionRegistry
151+ ipcMain . handle ( 'getDownloadTimeout ' , ( ) => {
152+ return downloadTimeout
145153 } )
146- ipcMain . handle ( 'getHomePage' , server . getHomePage )
147- ipcMain . handle ( 'getPort' , ( ) => {
148- return serverPort
154+ ipcMain . handle ( 'setDownloadTimeout' , ( e , timeout ) => {
155+ downloadTimeout = timeout
149156 } )
157+ ipcMain . handle ( 'getHomePage' , server . getHomePage )
150158 ipcMain . handle ( 'getHealthzUrl' , server . getHealthzUrl )
151159
152160 startServer ( )
@@ -195,6 +203,7 @@ const startServer = () => {
195203 "server" ,
196204 `--http-port=${ serverPort } ` ,
197205 "--port=0" ,
206+ `--download-timeout=${ downloadTimeout } ` ,
198207 `--extension-registry=${ extensionRegistry } ` ,
199208 "--local-storage" , path . join ( homeData , "*.yaml" )
200209 ] )
0 commit comments