From 40a3cff4d3226e299955d589e21a1ed47df194d1 Mon Sep 17 00:00:00 2001 From: Kilton937342 Date: Tue, 2 Aug 2022 14:14:55 +0200 Subject: [PATCH] te --- backend/api/exercices/views.py | 5 +---- frontend/context/websocket.context.js | 8 +++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/backend/api/exercices/views.py b/backend/api/exercices/views.py index 6f2b934e..2724e12e 100644 --- a/backend/api/exercices/views.py +++ b/backend/api/exercices/views.py @@ -419,14 +419,11 @@ def pdfGen(request): template = get_template('test.tex') latex = template.render(context) - print('LATEX', latex) with tempfile.TemporaryDirectory() as tempdir: direct = tempdir with open(os.path.join(direct, 'tmp.tex'), 'x', encoding='utf-8') as f: f.write(latex) - - with open(os.path.join(direct, 'tmp.tex'), 'r', encoding='utf-8') as f: - print('FILE', f.read()) + command = f'xelatex -interaction=batchmode tmp.tex' try: subprocess.run(command, shell=True, diff --git a/frontend/context/websocket.context.js b/frontend/context/websocket.context.js index a32cff88..f4fc9bc5 100644 --- a/frontend/context/websocket.context.js +++ b/frontend/context/websocket.context.js @@ -13,14 +13,12 @@ export const WebsocketProvider = ({ children }) => { const [isConnected, setConnected] = useState(false); const router = useRouter(); const connect = (url) => { - if (isBrowser) { + if (isBrowser) { var url = url.startsWith('/')? url: '/' + url - console.log( - `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` - ); + ws.current = new ReconnectingWebSocket( - `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` + `ws://${process.env.NEXT_PUBLIC_HOST}${url}` ); ws.current.onopen = () => {