pywebexec 1.5.2__tar.gz → 1.5.4__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 (39) hide show
  1. {pywebexec-1.5.2/pywebexec.egg-info → pywebexec-1.5.4}/PKG-INFO +1 -1
  2. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/css/style.css +15 -1
  3. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/popup.js +34 -1
  4. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/script.js +36 -1
  5. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/templates/index.html +2 -0
  6. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/templates/popup.html +2 -0
  7. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/version.py +2 -2
  8. {pywebexec-1.5.2 → pywebexec-1.5.4/pywebexec.egg-info}/PKG-INFO +1 -1
  9. {pywebexec-1.5.2 → pywebexec-1.5.4}/.github/workflows/python-publish.yml +0 -0
  10. {pywebexec-1.5.2 → pywebexec-1.5.4}/.gitignore +0 -0
  11. {pywebexec-1.5.2 → pywebexec-1.5.4}/LICENSE +0 -0
  12. {pywebexec-1.5.2 → pywebexec-1.5.4}/README.md +0 -0
  13. {pywebexec-1.5.2 → pywebexec-1.5.4}/pyproject.toml +0 -0
  14. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/__init__.py +0 -0
  15. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/pywebexec.py +0 -0
  16. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/css/Consolas NF.ttf +0 -0
  17. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/css/xterm.css +0 -0
  18. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/aborted.svg +0 -0
  19. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/copy.svg +0 -0
  20. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/copy_ok.svg +0 -0
  21. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/down-arrow.svg +0 -0
  22. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/failed.svg +0 -0
  23. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/favicon.svg +0 -0
  24. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/popup.svg +0 -0
  25. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/running.gif +0 -0
  26. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/images/success.svg +0 -0
  27. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/commands.js +0 -0
  28. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/xterm/LICENSE +0 -0
  29. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/xterm/addon-fit.js +0 -0
  30. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
  31. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/xterm/xterm.js +0 -0
  32. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/static/js/xterm/xterm.js.map +0 -0
  33. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec/templates/__init__.py +0 -0
  34. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec.egg-info/SOURCES.txt +0 -0
  35. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec.egg-info/dependency_links.txt +0 -0
  36. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec.egg-info/entry_points.txt +0 -0
  37. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec.egg-info/requires.txt +0 -0
  38. {pywebexec-1.5.2 → pywebexec-1.5.4}/pywebexec.egg-info/top_level.txt +0 -0
  39. {pywebexec-1.5.2 → pywebexec-1.5.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.5.2
3
+ Version: 1.5.4
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -286,10 +286,24 @@ span {
286
286
  border-radius: 5px;
287
287
  cursor: pointer;
288
288
  font-size: 14px;
289
- width: 45px;
289
+ width: 50px;
290
290
  }
291
291
 
292
292
  .font-size-button:hover {
293
293
  background-color: #666;
294
294
  }
295
295
 
296
+ .paused-message {
297
+ display: none;
298
+ position: absolute;
299
+ top: 10px;
300
+ right: 10px;
301
+ background-color: rgba(128, 128, 128, 0.7);
302
+ color: white;
303
+ padding: 5px 10px;
304
+ border-radius: 5px;
305
+ font-size: 14px;
306
+ z-index: 10;
307
+ pointer-events: none;
308
+ }
309
+
@@ -38,6 +38,9 @@ let fullOutput = '';
38
38
  let outputLength = 0;
39
39
  let title = null;
40
40
  let slider = null;
41
+ let isPaused = false;
42
+ const toggleButton = document.getElementById('toggleFetch');
43
+ const pausedMessage = document.getElementById('pausedMessage');
41
44
 
42
45
  function getTokenParam() {
43
46
  const urlParams = new URLSearchParams(window.location.search);
@@ -46,6 +49,7 @@ function getTokenParam() {
46
49
  const urlToken = getTokenParam();
47
50
 
48
51
  async function fetchOutput(url) {
52
+ if (isPaused) return;
49
53
  try {
50
54
  const response = await fetch(url);
51
55
  if (!response.ok) {
@@ -75,6 +79,9 @@ async function fetchOutput(url) {
75
79
  if (data.status != 'running') {
76
80
  title.innerText = `${data.status} ${title.innerText.split(' ').slice(1).join(' ')}`;
77
81
  clearInterval(outputInterval);
82
+ toggleButton.style.display = 'none';
83
+ } else {
84
+ toggleButton.style.display = 'block';
78
85
  }
79
86
  }
80
87
  } catch (error) {
@@ -105,9 +112,11 @@ async function viewOutput(command_id) {
105
112
  terminal.options.cursorInactiveStyle = 'none';
106
113
  if (data.status === 'running') {
107
114
  fetchOutput(nextOutputLink);
108
- outputInterval = setInterval(() => fetchOutput(nextOutputLink), 1000);
115
+ outputInterval = setInterval(() => fetchOutput(nextOutputLink), 500);
116
+ toggleButton.style.display = 'block';
109
117
  } else {
110
118
  fetchOutput(nextOutputLink);
119
+ toggleButton.style.display = 'none';
111
120
  }
112
121
  } catch (error) {
113
122
  console.log('Error viewing output:', error);
@@ -134,6 +143,30 @@ function sliderUpdateOutput() {
134
143
  document.getElementById('outputPercentage').innerText = `${percentage}%`;
135
144
  }
136
145
 
146
+ function toggleFetchOutput() {
147
+ if (isPaused) {
148
+ slider.value = 100;
149
+ document.getElementById('outputPercentage').innerText = '100%';
150
+ terminal.clear();
151
+ terminal.reset();
152
+ terminal.write(fullOutput);
153
+ fetchOutput(nextOutputLink);
154
+ outputInterval = setInterval(() => fetchOutput(nextOutputLink), 500);
155
+ toggleButton.innerText = '||';
156
+ pausedMessage.style.display = 'none';
157
+ } else {
158
+ clearInterval(outputInterval);
159
+ toggleButton.innerText = '|>';
160
+ pausedMessage.style.display = 'block';
161
+ const outputDiv = document.getElementById('output');
162
+ const rect = outputDiv.getBoundingClientRect();
163
+ pausedMessage.style.top = `${rect.top + 10}px`;
164
+ pausedMessage.style.right = `${window.innerWidth - rect.right + 10}px`;
165
+ }
166
+ isPaused = !isPaused;
167
+ }
168
+
169
+ toggleButton.addEventListener('click', toggleFetchOutput);
137
170
 
138
171
  window.addEventListener('resize', adjustOutputHeight);
139
172
  window.addEventListener('load', () => {
@@ -8,6 +8,7 @@ let outputLength = 0;
8
8
  const maxScrollback = 99999;
9
9
  const maxSize = 10485760; // 10MB
10
10
  let fontSize = 14;
11
+ let isPaused = false;
11
12
 
12
13
  function initTerminal()
13
14
  {
@@ -133,6 +134,7 @@ async function fetchCommands() {
133
134
  }
134
135
 
135
136
  async function fetchOutput(url) {
137
+ if (isPaused) return;
136
138
  try {
137
139
  const response = await fetch(url);
138
140
  if (!response.ok) {
@@ -159,6 +161,9 @@ async function fetchOutput(url) {
159
161
  nextOutputLink = data.links.next;
160
162
  if (data.status != 'running') {
161
163
  clearInterval(outputInterval);
164
+ toggleButton.style.display = 'none';
165
+ } else {
166
+ toggleButton.style.display = 'block';
162
167
  }
163
168
  }
164
169
  } catch (error) {
@@ -188,9 +193,11 @@ async function viewOutput(command_id) {
188
193
  terminal.options.cursorInactiveStyle = 'none';
189
194
  if (data.status === 'running') {
190
195
  fetchOutput(nextOutputLink);
191
- outputInterval = setInterval(() => fetchOutput(nextOutputLink), 1000);
196
+ outputInterval = setInterval(() => fetchOutput(nextOutputLink), 500);
197
+ toggleButton.style.display = 'block';
192
198
  } else {
193
199
  fetchOutput(nextOutputLink);
200
+ toggleButton.style.display = 'none';
194
201
  }
195
202
  fetchCommands(); // Refresh the command list to highlight the current command
196
203
  } catch (error) {
@@ -347,6 +354,34 @@ document.getElementById('increaseFontSize').addEventListener('click', () => {
347
354
  fitAddon.fit();
348
355
  });
349
356
 
357
+ const toggleButton = document.getElementById('toggleFetch');
358
+ const pausedMessage = document.getElementById('pausedMessage');
359
+
360
+ function toggleFetchOutput() {
361
+ if (isPaused) {
362
+ slider.value = 100;
363
+ outputPercentage.innerText = '100%';
364
+ terminal.clear();
365
+ terminal.reset();
366
+ terminal.write(fullOutput);
367
+ fetchOutput(nextOutputLink);
368
+ outputInterval = setInterval(() => fetchOutput(nextOutputLink), 500);
369
+ toggleButton.innerText = '||';
370
+ pausedMessage.style.display = 'none';
371
+ } else {
372
+ clearInterval(outputInterval);
373
+ toggleButton.innerText = '|>';
374
+ pausedMessage.style.display = 'block';
375
+ const outputDiv = document.getElementById('output');
376
+ const rect = outputDiv.getBoundingClientRect();
377
+ pausedMessage.style.top = `${rect.top + 10}px`;
378
+ pausedMessage.style.right = `${window.innerWidth - rect.right + 10}px`;
379
+ }
380
+ isPaused = !isPaused;
381
+ }
382
+
383
+ toggleButton.addEventListener('click', toggleFetchOutput);
384
+
350
385
  window.addEventListener('resize', adjustOutputHeight);
351
386
  window.addEventListener('load', initResizer);
352
387
 
@@ -44,9 +44,11 @@
44
44
  <div class="resizer" id="resizer"></div>
45
45
  </div>
46
46
  <div id="output" class="output"></div>
47
+ <div id="pausedMessage" class="paused-message">Paused</div>
47
48
  <div class="slider-container">
48
49
  <input type="range" id="outputSlider" min="0" max="100" value="100">
49
50
  <label for="outputSlider"><span id="outputPercentage">100%</span></label>
51
+ <button id="toggleFetch" class="font-size-button">||</button>
50
52
  <button id="decreaseFontSize" class="font-size-button">A&ndash;</button>
51
53
  <button id="increaseFontSize" class="font-size-button">A+</button>
52
54
  </div>
@@ -12,9 +12,11 @@
12
12
  <div class="dimmer-text">Server not available</div>
13
13
  </div>
14
14
  <div id="output" class="output"></div>
15
+ <div id="pausedMessage" class="paused-message">Paused</div>
15
16
  <div class="slider-container">
16
17
  <input type="range" id="outputSlider" min="0" max="100" value="100">
17
18
  <label for="outputSlider"><span id="outputPercentage">100%</span></label>
19
+ <button id="toggleFetch" class="font-size-button">||</button>
18
20
  <button id="decreaseFontSize" class="font-size-button">A&ndash;</button>
19
21
  <button id="increaseFontSize" class="font-size-button">A+</button>
20
22
  </div>
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.5.2'
16
- __version_tuple__ = version_tuple = (1, 5, 2)
15
+ __version__ = version = '1.5.4'
16
+ __version_tuple__ = version_tuple = (1, 5, 4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.5.2
3
+ Version: 1.5.4
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