pywebexec 1.5.2__py3-none-any.whl → 1.5.4__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.
@@ -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>
pywebexec/version.py CHANGED
@@ -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
@@ -1,8 +1,8 @@
1
1
  pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
2
  pywebexec/pywebexec.py,sha256=hacpB6OnS_ZN1SBmuReTUkvAuenl6czD6aD_yV8wusY,28462
3
- pywebexec/version.py,sha256=P-JlE1bO3FGbbntvKHqxjgKk7ORvjFhybkK-h8R2s5g,411
3
+ pywebexec/version.py,sha256=RrBLyJ4gK-bCUwTO6RYVanFzMRY7N_emKX_fTlh7w3Q,411
4
4
  pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
5
- pywebexec/static/css/style.css,sha256=oHjmcuKWG6Gv03POupZgvIREgBQMfiPZLguKKnXGf70,6000
5
+ pywebexec/static/css/style.css,sha256=FLTK6RhdKuZSDMONOBjQnKEJuqqdkmUFAOtzPXmYfcg,6273
6
6
  pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
7
7
  pywebexec/static/images/aborted.svg,sha256=_mP43hU5QdRLFZIknBgjx-dIXrHgQG23-QV27ApXK2A,381
8
8
  pywebexec/static/images/copy.svg,sha256=d9OwtGh5GzzZHzYcDrLfNxZYLth1Q64x7bRyYxu4Px0,622
@@ -14,19 +14,19 @@ 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=pNNsUotHoLx7YYtiXCIUhD5L6EY46U2KFrFIQXFwPJM,5196
18
- pywebexec/static/js/script.js,sha256=DpgFByRpVj07QJDv1-DgQ-P9EI9HEppy-4ozZzfbkOo,12701
17
+ pywebexec/static/js/popup.js,sha256=PXZVNRgG0kNpK03PRPjp_DSkCtF-zwDcSyAo213ma3w,6519
18
+ pywebexec/static/js/script.js,sha256=w8BiB_3ViVmTu0Z6jEmSbgZf8Fz48KxYOm7yIUuQcB0,13999
19
19
  pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
20
20
  pywebexec/static/js/xterm/addon-fit.js,sha256=va76Nwsb_ELuiNRv5gckAJAqTUstRc2TQ43amyPJcIk,1497
21
21
  pywebexec/static/js/xterm/addon-fit.js.map,sha256=zPUOkZVKfQNvj1W_fUktD5UNNu80XwqfSEWXBVxA8uY,5477
22
22
  pywebexec/static/js/xterm/xterm.js,sha256=H5kaw7Syg-v5bmCuI6AKUnZd06Lkb6b92p8aqwMvdJU,289441
23
23
  pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCfN0U_OI6Zw,1118392
24
24
  pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- pywebexec/templates/index.html,sha256=-fdhtsbqXql4b67QiLY5e501fjpSKpzhitPnsSIxWVk,2411
26
- pywebexec/templates/popup.html,sha256=BMIILNsvprcqNTfZVCL3UszgEs1-OdBtH2qWoXuzyoE,1035
27
- pywebexec-1.5.2.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
28
- pywebexec-1.5.2.dist-info/METADATA,sha256=e-Uu8PjfiTDpMbseZt5J6FlqIRsJ_7CX901ppPPIcmc,7800
29
- pywebexec-1.5.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
30
- pywebexec-1.5.2.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
31
- pywebexec-1.5.2.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
32
- pywebexec-1.5.2.dist-info/RECORD,,
25
+ pywebexec/templates/index.html,sha256=HTXq4Xs7NeOGXgjQpiHWJwK5uYvIIcxybiqv2yRBI60,2545
26
+ pywebexec/templates/popup.html,sha256=3STgi9niVeylT2X9xm8I7RsEvLCNRk2tmOK2wPhyD5s,1169
27
+ pywebexec-1.5.4.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
28
+ pywebexec-1.5.4.dist-info/METADATA,sha256=eNGDp0PlrJD7ZJtytsljy9uHgOqGSTpH2Wvpt36RUw8,7800
29
+ pywebexec-1.5.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
30
+ pywebexec-1.5.4.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
31
+ pywebexec-1.5.4.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
32
+ pywebexec-1.5.4.dist-info/RECORD,,