pywebexec 1.6.8__py3-none-any.whl → 1.6.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pywebexec/pywebexec.py +20 -9
- pywebexec/static/js/script.js +9 -1
- pywebexec/version.py +2 -2
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/METADATA +3 -2
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/RECORD +9 -9
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/LICENSE +0 -0
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/WHEEL +0 -0
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.6.8.dist-info → pywebexec-1.6.10.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import sys
|
2
|
-
from flask import Flask, request, jsonify, render_template, session, redirect, url_for
|
2
|
+
from flask import Flask, request, jsonify, render_template, session, redirect, url_for, Response, stream_with_context
|
3
3
|
from flask_httpauth import HTTPBasicAuth
|
4
4
|
import threading
|
5
5
|
import os
|
@@ -798,14 +798,25 @@ def get_command_output(command_id):
|
|
798
798
|
@app.route('/command_output_raw/<command_id>', methods=['GET'])
|
799
799
|
def get_command_output_raw(command_id):
|
800
800
|
offset = int(request.args.get('offset', 0))
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
801
|
+
@stream_with_context
|
802
|
+
def generate(offset):
|
803
|
+
try:
|
804
|
+
output_file_path = get_output_file_path(command_id)
|
805
|
+
if os.path.exists(output_file_path):
|
806
|
+
with open(output_file_path, 'rb') as output_file:
|
807
|
+
while True:
|
808
|
+
while True:
|
809
|
+
chunk = output_file.read(1024)
|
810
|
+
if not chunk:
|
811
|
+
time.sleep(0.5)
|
812
|
+
break
|
813
|
+
yield chunk
|
814
|
+
status = read_command_status(command_id)
|
815
|
+
if not status or status['status'] != 'running':
|
816
|
+
break
|
817
|
+
except GeneratorExit:
|
818
|
+
return
|
819
|
+
return Response(generate(offset), content_type='text/plain')
|
809
820
|
|
810
821
|
@app.route('/executables', methods=['GET'])
|
811
822
|
def list_executables():
|
pywebexec/static/js/script.js
CHANGED
@@ -18,7 +18,7 @@ function initTerminal()
|
|
18
18
|
cursorBlink: false,
|
19
19
|
cursorInactiveStyle: 'none',
|
20
20
|
disableStdin: true,
|
21
|
-
convertEol: true,
|
21
|
+
//convertEol: true,
|
22
22
|
fontFamily: '"Consolas NF", "Fira Code", monospace, "Powerline Extra Symbols", courier-new, courier',
|
23
23
|
fontSize: fontSize,
|
24
24
|
scrollback: maxScrollback,
|
@@ -80,6 +80,14 @@ terminal.onTitleChange((title) => {
|
|
80
80
|
document.getElementById('commandInfo').innerText = title;
|
81
81
|
})
|
82
82
|
|
83
|
+
/*terminal.onResize((evt) => {
|
84
|
+
const terminal_size = {
|
85
|
+
Width: evt.cols,
|
86
|
+
Height: evt.rows,
|
87
|
+
};
|
88
|
+
console.log(terminal_size);
|
89
|
+
})*/
|
90
|
+
|
83
91
|
terminal.onSelectionChange(() => {
|
84
92
|
const selectionText = terminal.getSelection();
|
85
93
|
if (selectionText) {
|
pywebexec/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pywebexec
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.10
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
5
5
|
Home-page: https://github.com/joknarf/pywebexec
|
6
6
|
Author: Franck Jouvanceau
|
@@ -200,6 +200,7 @@ $ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
|
|
200
200
|
| POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
|
201
201
|
| POST | /stop_command/command_id | | message: str |
|
202
202
|
| GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
|
203
|
-
| GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
|
204
203
|
| GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
|
205
204
|
| GET | /executables | | array of str |
|
205
|
+
| GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
|
206
|
+
| GET | /command_output_raw/command_id | offset: int | output: stream raw output until end of command<br>curl -N -s http://srv/command_output_raw/command_id|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
|
2
|
-
pywebexec/pywebexec.py,sha256=
|
3
|
-
pywebexec/version.py,sha256=
|
2
|
+
pywebexec/pywebexec.py,sha256=3T3qSfM9wDLkjlQwj33gJ0KN9J3EwQC0UnFohHOV3M4,32161
|
3
|
+
pywebexec/version.py,sha256=Lku74dRhc9EC3uT_BFGpwGtdeZT0GPBqsGw5eMXm9qw,413
|
4
4
|
pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
|
5
5
|
pywebexec/static/css/style.css,sha256=MJHUBpjWL4sLxM7a7DxypmPKaFJQbmA_ESNXsbLviNI,8201
|
6
6
|
pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
|
@@ -20,7 +20,7 @@ pywebexec/static/images/running.svg,sha256=fBCYwYb2O9K4N3waC2nURP25NRwZlqR4PbDZy
|
|
20
20
|
pywebexec/static/images/success.svg,sha256=NVwezvVMplt46ElW798vqGfrL21Mw_DWHUp_qiD_FU8,489
|
21
21
|
pywebexec/static/js/commands.js,sha256=h2fkd9qpypLBxvhEEbay23nwuqUwcKJA0vHugcyL8pU,7961
|
22
22
|
pywebexec/static/js/popup.js,sha256=I5TLYUm5s2p12a0VfFONOxxzhXLBmnpVzM-B5W-GPis,8294
|
23
|
-
pywebexec/static/js/script.js,sha256=
|
23
|
+
pywebexec/static/js/script.js,sha256=8CcIn-O4I1ojbiAYOeQl3yTnykn0Lj3xdWdx6m6HyNs,17085
|
24
24
|
pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
|
25
25
|
pywebexec/static/js/xterm/addon-canvas.js,sha256=ez6QTVvsmLVNJmdJlM-ZQ5bErwlxAQ_9DUmDIptl2TM,94607
|
26
26
|
pywebexec/static/js/xterm/addon-canvas.js.map,sha256=ECBA4B-BqUpdFeRzlsEWLSQnudnhLP-yPQJ8_hKquMo,379537
|
@@ -33,9 +33,9 @@ pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCf
|
|
33
33
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
34
|
pywebexec/templates/index.html,sha256=5h8kLyzAhbvUDU9sEwrGIvD6FxAMcDZLXlN-ldlO8KU,2880
|
35
35
|
pywebexec/templates/popup.html,sha256=3ZqQcE9mYs-RXv0Lfb24zntOlvR137ZYI9mtCZNVAo0,1407
|
36
|
-
pywebexec-1.6.
|
37
|
-
pywebexec-1.6.
|
38
|
-
pywebexec-1.6.
|
39
|
-
pywebexec-1.6.
|
40
|
-
pywebexec-1.6.
|
41
|
-
pywebexec-1.6.
|
36
|
+
pywebexec-1.6.10.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
37
|
+
pywebexec-1.6.10.dist-info/METADATA,sha256=hM3te7ICelnKxOqnHCTYL9iCeY7gAhZcERYv2aiYiWA,7974
|
38
|
+
pywebexec-1.6.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
39
|
+
pywebexec-1.6.10.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
40
|
+
pywebexec-1.6.10.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
41
|
+
pywebexec-1.6.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|