pywebexec 1.4.8__py3-none-any.whl → 1.4.9__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 +3 -2
- pywebexec/static/js/popup.js +11 -5
- pywebexec/static/js/script.js +6 -1
- pywebexec/version.py +2 -2
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/METADATA +1 -1
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/RECORD +10 -10
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/LICENSE +0 -0
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/WHEEL +0 -0
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.4.8.dist-info → pywebexec-1.4.9.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -655,6 +655,7 @@ def list_commands():
|
|
655
655
|
@app.route('/command_output/<command_id>', methods=['GET'])
|
656
656
|
def get_command_output(command_id):
|
657
657
|
offset = int(request.args.get('offset', 0))
|
658
|
+
maxsize = int(request.args.get('maxsize', 10485760))
|
658
659
|
output_file_path = get_output_file_path(command_id)
|
659
660
|
if os.path.exists(output_file_path):
|
660
661
|
with open(output_file_path, 'rb') as output_file:
|
@@ -665,10 +666,10 @@ def get_command_output(command_id):
|
|
665
666
|
token = app.config.get("TOKEN_URL")
|
666
667
|
token_param = f"&token={token}" if token else ""
|
667
668
|
response = {
|
668
|
-
'output': output,
|
669
|
+
'output': output[-maxsize:],
|
669
670
|
'status': status_data.get("status"),
|
670
671
|
'links': {
|
671
|
-
'next': f'{request.url_root}command_output/{command_id}?offset={new_offset}{token_param}'
|
672
|
+
'next': f'{request.url_root}command_output/{command_id}?offset={new_offset}&maxsize={maxsize}{token_param}'
|
672
673
|
}
|
673
674
|
}
|
674
675
|
if request.headers.get('Accept') == 'text/plain':
|
pywebexec/static/js/popup.js
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
const maxScrollback = 99999;
|
2
|
+
const maxSize = 10485760; // 10MB
|
1
3
|
let terminal = new Terminal({
|
2
4
|
cursorBlink: false,
|
3
5
|
cursorInactiveStyle: 'none',
|
4
6
|
disableStdin: true,
|
5
7
|
convertEol: true,
|
6
8
|
fontFamily: 'Consolas NF, monospace, courier-new, courier',
|
7
|
-
scrollback:
|
9
|
+
scrollback: maxScrollback,
|
8
10
|
theme: {
|
9
11
|
background: '#111412',
|
10
12
|
black: '#111412',
|
@@ -16,6 +18,7 @@ let terminal = new Terminal({
|
|
16
18
|
cyan: "#00a7aa",
|
17
19
|
brightBlack: "#243C4F",
|
18
20
|
brightBlue: "#5584b1",
|
21
|
+
brightGreen: "#18Ed93",
|
19
22
|
},
|
20
23
|
customGlyphs: false,
|
21
24
|
rescaleOverlappingGlyphs: true,
|
@@ -32,6 +35,7 @@ let nextOutputLink = null;
|
|
32
35
|
let fullOutput = '';
|
33
36
|
let outputLength = 0;
|
34
37
|
let title = null;
|
38
|
+
let slider = null;
|
35
39
|
|
36
40
|
function getTokenParam() {
|
37
41
|
const urlParams = new URLSearchParams(window.location.search);
|
@@ -50,9 +54,10 @@ async function fetchOutput(url) {
|
|
50
54
|
terminal.write(data.error);
|
51
55
|
clearInterval(outputInterval);
|
52
56
|
} else {
|
53
|
-
slider = document.getElementById('outputSlider')
|
54
57
|
percentage = slider.value;
|
55
58
|
fullOutput += data.output;
|
59
|
+
if (fullOutput.length > maxSize)
|
60
|
+
fullOutput = fullOutput.slice(-maxSize);
|
56
61
|
if (percentage == 100)
|
57
62
|
terminal.write(data.output);
|
58
63
|
else {
|
@@ -72,7 +77,7 @@ async function fetchOutput(url) {
|
|
72
77
|
}
|
73
78
|
|
74
79
|
async function viewOutput(command_id) {
|
75
|
-
|
80
|
+
slider.value = 100;
|
76
81
|
adjustOutputHeight();
|
77
82
|
currentCommandId = command_id;
|
78
83
|
nextOutputLink = `/command_output/${command_id}${urlToken}`;
|
@@ -109,10 +114,10 @@ function adjustOutputHeight() {
|
|
109
114
|
const maxHeight = windowHeight - outputTop - 60; // Adjusted for slider height
|
110
115
|
outputDiv.style.height = `${maxHeight}px`;
|
111
116
|
fitAddon.fit();
|
117
|
+
sliderUpdateOutput();
|
112
118
|
}
|
113
119
|
|
114
120
|
function sliderUpdateOutput() {
|
115
|
-
const slider = document.getElementById('outputSlider');
|
116
121
|
const percentage = slider.value;
|
117
122
|
outputLength = Math.floor((fullOutput.length * percentage) / 100);
|
118
123
|
const limitedOutput = fullOutput.slice(0, outputLength);
|
@@ -122,11 +127,12 @@ function sliderUpdateOutput() {
|
|
122
127
|
document.getElementById('outputPercentage').innerText = `${percentage}%`;
|
123
128
|
}
|
124
129
|
|
125
|
-
document.getElementById('outputSlider').addEventListener('input', sliderUpdateOutput);
|
126
130
|
|
127
131
|
window.addEventListener('resize', adjustOutputHeight);
|
128
132
|
window.addEventListener('load', () => {
|
129
133
|
title = document.getElementById('outputTitle');
|
134
|
+
slider = document.getElementById('outputSlider');
|
135
|
+
slider.addEventListener('input', sliderUpdateOutput);
|
130
136
|
const commandId = window.location.pathname.split('/').slice(-1)[0];
|
131
137
|
viewOutput(commandId);
|
132
138
|
});
|
pywebexec/static/js/script.js
CHANGED
@@ -3,6 +3,8 @@ let outputInterval = null;
|
|
3
3
|
let nextOutputLink = null;
|
4
4
|
let fullOutput = '';
|
5
5
|
let outputLength = 0;
|
6
|
+
const maxScrollback = 99999;
|
7
|
+
const maxSize = 10485760; // 10MB
|
6
8
|
|
7
9
|
function initTerminal()
|
8
10
|
{
|
@@ -12,7 +14,7 @@ function initTerminal()
|
|
12
14
|
disableStdin: true,
|
13
15
|
convertEol: true,
|
14
16
|
fontFamily: 'Consolas NF, monospace, courier-new, courier',
|
15
|
-
scrollback:
|
17
|
+
scrollback: maxScrollback,
|
16
18
|
theme: {
|
17
19
|
background: '#111412',
|
18
20
|
black: '#111412',
|
@@ -24,6 +26,7 @@ function initTerminal()
|
|
24
26
|
cyan: "#00a7aa",
|
25
27
|
brightBlack: "#243C4F",
|
26
28
|
brightBlue: "#5584b1",
|
29
|
+
brightGreen: "#18Ed93",
|
27
30
|
},
|
28
31
|
customGlyphs: false,
|
29
32
|
rescaleOverlappingGlyphs: true,
|
@@ -137,6 +140,8 @@ async function fetchOutput(url) {
|
|
137
140
|
slider = document.getElementById('outputSlider')
|
138
141
|
percentage = slider.value;
|
139
142
|
fullOutput += data.output;
|
143
|
+
if (fullOutput.length > maxSize)
|
144
|
+
fullOutput = fullOutput.slice(-maxSize);
|
140
145
|
if (percentage == 100)
|
141
146
|
terminal.write(data.output); //.replace(/ \r/g, "\r\n")); tty size mismatch
|
142
147
|
else {
|
pywebexec/version.py
CHANGED
@@ -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=7N8cq8qDn7z9mXXWVAOd-eijNAkd-EYvWBGKKSOWeTQ,26211
|
3
|
+
pywebexec/version.py,sha256=7YfyzKekRBziu-K_N0hnrpsNnrC-U6NwEUBuUEQ_xUA,411
|
4
4
|
pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
|
5
5
|
pywebexec/static/css/style.css,sha256=sDBhZ-csW5THIKfTDsHqxCSg6rIJ91Oh15sjw_HjJo4,5702
|
6
6
|
pywebexec/static/css/xterm.css,sha256=gy8_LGA7Q61DUf8ElwFQzHqHMBQnbbEmpgZcbdgeSHI,5383
|
@@ -14,8 +14,8 @@ pywebexec/static/images/popup.svg,sha256=0Bl9A_v5cBsMPn6FnOlVWlAQKgd2zqiWQbhjcL9
|
|
14
14
|
pywebexec/static/images/running.gif,sha256=iYuzQGkMxrakSIwt6gPieKCImGZoSAHmU5MUNZa7cpw,25696
|
15
15
|
pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaOLQemmc,489
|
16
16
|
pywebexec/static/js/commands.js,sha256=8JDb3Q55EJOYf2Q9Uy6qEuqAnn1oGjM0RndgQ4aOjqo,7725
|
17
|
-
pywebexec/static/js/popup.js,sha256=
|
18
|
-
pywebexec/static/js/script.js,sha256=
|
17
|
+
pywebexec/static/js/popup.js,sha256=VdkDXEIwd4IawhDIWew6poWhpE7sAReVn0MopdSx5wY,4519
|
18
|
+
pywebexec/static/js/script.js,sha256=opY6g03aeTZH_PuZEEb3x-RtYDnDonVqJINUy_NP2Ik,12181
|
19
19
|
pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
|
20
20
|
pywebexec/static/js/xterm/ansi_up.min.js,sha256=KNGV0vEr30hNqKQimTAvGVy-icD5A1JqMQTtvYtKR2Y,13203
|
21
21
|
pywebexec/static/js/xterm/xterm-addon-fit.js,sha256=Pprm9pZe4SadVXS5Bc8b9VnC9Ex4QlWwA0pxOH53Gck,1460
|
@@ -23,9 +23,9 @@ pywebexec/static/js/xterm/xterm.js,sha256=Bzka76jZwEhVt_LlS0e0qMw7ryGa1p5qfxFyeo
|
|
23
23
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
pywebexec/templates/index.html,sha256=DYtT555wSNhnFtzzHhPMWJireynCJNnAuTytpoORQeE,2321
|
25
25
|
pywebexec/templates/popup.html,sha256=6kmZKb0tGJ7jsr9DqDEriSMlbkW-PJTtCiUE9U5_FOE,837
|
26
|
-
pywebexec-1.4.
|
27
|
-
pywebexec-1.4.
|
28
|
-
pywebexec-1.4.
|
29
|
-
pywebexec-1.4.
|
30
|
-
pywebexec-1.4.
|
31
|
-
pywebexec-1.4.
|
26
|
+
pywebexec-1.4.9.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
27
|
+
pywebexec-1.4.9.dist-info/METADATA,sha256=E6Kc1LaQN1358Xw9tZY7nD9rPELY4iWEuAmaUKkHLbU,7399
|
28
|
+
pywebexec-1.4.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
29
|
+
pywebexec-1.4.9.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
30
|
+
pywebexec-1.4.9.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
31
|
+
pywebexec-1.4.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|