mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed SocketIO calls when pgAdmin 4 server is running from a sub directory. #5521
This commit is contained in:
@@ -25,6 +25,8 @@ from pgadmin.utils.constants import MIMETYPE_APP_JS
|
||||
from pgadmin.utils.driver import get_driver
|
||||
from ... import socketio as sio
|
||||
from pgadmin.utils import get_complete_file_path
|
||||
from pgadmin.authenticate import socket_login_required
|
||||
|
||||
|
||||
if _platform == 'win32':
|
||||
# Check Windows platform support for WinPty api, Disable psql
|
||||
@@ -149,6 +151,7 @@ def set_term_size(fd, row, col, xpix=0, ypix=0):
|
||||
|
||||
|
||||
@sio.on('connect', namespace='/pty')
|
||||
@socket_login_required
|
||||
def connect():
|
||||
"""
|
||||
Connect to the server through socket.
|
||||
@@ -276,6 +279,7 @@ def pty_handel_io(connection_data, data, sid):
|
||||
|
||||
|
||||
@sio.on('start_process', namespace='/pty')
|
||||
@socket_login_required
|
||||
def start_process(data):
|
||||
"""
|
||||
Start the pty terminal and execute psql command and emit results to user.
|
||||
|
||||
@@ -275,7 +275,11 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, Browser)
|
||||
return new SearchAddon();
|
||||
},
|
||||
psql_socket: function() {
|
||||
return io('/pty', {pingTimeout: 120000, pingInterval: 25000});
|
||||
return io('/pty', {
|
||||
path: `${url_for('pgadmin.root')}/socket.io`,
|
||||
pingTimeout: 120000,
|
||||
pingInterval: 25000
|
||||
});
|
||||
},
|
||||
set_theme: function(term) {
|
||||
let theme = {
|
||||
|
||||
Reference in New Issue
Block a user