MCPcopy Index your code
hub / github.com/code3-dev/dengvpn / createWindow

Function createWindow

main.js:385–511  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383}
384
385function createWindow() {
386 if (splash) {
387 splash.close();
388 }
389
390 win = new BrowserWindow({
391 minWidth: 840,
392 minHeight: 630,
393 width: 840,
394 height: 630,
395 icon: getAssetPath('icon.png'),
396 webPreferences: {
397 nodeIntegration: false,
398 contextIsolation: true,
399 preload: getPreloadPath(),
400 devTools: false
401 },
402 resizable: true,
403 center: true,
404 });
405
406 win.loadFile(getAssetPath('ui.html'));
407
408 const menuTemplate = [
409 {
410 label: 'DengVPN',
411 submenu: [
412 {
413 label: 'Select Core Directory',
414 click: async () => {
415 const selected = await selectCoreDirectory();
416 if (selected) {
417 dialog.showMessageBox({
418 type: 'info',
419 title: 'Core Directory',
420 message: 'V2Ray core directory has been updated. Please restart the application.',
421 buttons: ['OK']
422 });
423 }
424 }
425 },
426 { type: 'separator' },
427 { role: 'quit' }
428 ]
429 },
430 {
431 label: 'Tools',
432 submenu: [
433 {
434 label: 'IP Information',
435 click: () => {
436 const ipInfoWindow = new BrowserWindow({
437 width: 800,
438 height: 600,
439 parent: win,
440 icon: getAssetPath('icon.png'),
441 webPreferences: {
442 nodeIntegration: false,

Callers 1

main.jsFile · 0.85

Calls 3

getAssetPathFunction · 0.85
getPreloadPathFunction · 0.85
selectCoreDirectoryFunction · 0.85

Tested by

no test coverage detected