File size: 1,038 Bytes
6b6d936
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////

const misc = require('../js/misc.js');

// Get the window object of server error window
let gui = require('nw.gui');
let errorWindow = gui.Window.get();

errorWindow.on('loaded', function() {
  document.getElementById('server_error_label').innerHTML = 'The pgAdmin 4 server could not be contacted:';
  document.getElementById('server_error_log').innerHTML = misc.readServerLog();
  document.getElementById('btnConfigure').addEventListener('click', function() {
    nw.Window.open('src/html/configure.html', {
      'frame': true,
      'width': 600,
      'height': 420,
      'position': 'center',
      'resizable': false,
      'focus': true,
      'show': true,
    });
  });
});

errorWindow.on('close', function() {
  misc.cleanupAndQuitApp();
});