pywebexec 1.4.8__tar.gz → 1.4.9__tar.gz

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.
Files changed (38) hide show
  1. {pywebexec-1.4.8/pywebexec.egg-info → pywebexec-1.4.9}/PKG-INFO +1 -1
  2. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/pywebexec.py +3 -2
  3. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/popup.js +11 -5
  4. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/script.js +6 -1
  5. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/version.py +2 -2
  6. {pywebexec-1.4.8 → pywebexec-1.4.9/pywebexec.egg-info}/PKG-INFO +1 -1
  7. {pywebexec-1.4.8 → pywebexec-1.4.9}/.github/workflows/python-publish.yml +0 -0
  8. {pywebexec-1.4.8 → pywebexec-1.4.9}/.gitignore +0 -0
  9. {pywebexec-1.4.8 → pywebexec-1.4.9}/LICENSE +0 -0
  10. {pywebexec-1.4.8 → pywebexec-1.4.9}/README.md +0 -0
  11. {pywebexec-1.4.8 → pywebexec-1.4.9}/pyproject.toml +0 -0
  12. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/__init__.py +0 -0
  13. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/css/Consolas NF.ttf +0 -0
  14. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/css/style.css +0 -0
  15. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/css/xterm.css +0 -0
  16. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/aborted.svg +0 -0
  17. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/copy.svg +0 -0
  18. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/copy_ok.svg +0 -0
  19. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/down-arrow.svg +0 -0
  20. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/failed.svg +0 -0
  21. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/favicon.svg +0 -0
  22. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/popup.svg +0 -0
  23. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/running.gif +0 -0
  24. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/images/success.svg +0 -0
  25. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/commands.js +0 -0
  26. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/xterm/LICENSE +0 -0
  27. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/xterm/ansi_up.min.js +0 -0
  28. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/xterm/xterm-addon-fit.js +0 -0
  29. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/static/js/xterm/xterm.js +0 -0
  30. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/templates/__init__.py +0 -0
  31. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/templates/index.html +0 -0
  32. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec/templates/popup.html +0 -0
  33. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec.egg-info/SOURCES.txt +0 -0
  34. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec.egg-info/dependency_links.txt +0 -0
  35. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec.egg-info/entry_points.txt +0 -0
  36. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec.egg-info/requires.txt +0 -0
  37. {pywebexec-1.4.8 → pywebexec-1.4.9}/pywebexec.egg-info/top_level.txt +0 -0
  38. {pywebexec-1.4.8 → pywebexec-1.4.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.4.8
3
+ Version: 1.4.9
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -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':
@@ -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: 999999,
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
- document.getElementById('outputSlider').value = 100;
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
  });
@@ -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: 999999,
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 {
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.4.8'
16
- __version_tuple__ = version_tuple = (1, 4, 8)
15
+ __version__ = version = '1.4.9'
16
+ __version_tuple__ = version_tuple = (1, 4, 9)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.4.8
3
+ Version: 1.4.9
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
File without changes
File without changes
File without changes
File without changes
File without changes