pywebexec 1.5.18__tar.gz → 1.6.0__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 (48) hide show
  1. {pywebexec-1.5.18/pywebexec.egg-info → pywebexec-1.6.0}/PKG-INFO +1 -1
  2. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/css/style.css +17 -6
  3. pywebexec-1.6.0/pywebexec/static/images/norun.svg +1 -0
  4. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/script.js +25 -5
  5. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/templates/index.html +2 -2
  6. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/version.py +2 -2
  7. {pywebexec-1.5.18 → pywebexec-1.6.0/pywebexec.egg-info}/PKG-INFO +1 -1
  8. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec.egg-info/SOURCES.txt +1 -0
  9. {pywebexec-1.5.18 → pywebexec-1.6.0}/.github/workflows/python-publish.yml +0 -0
  10. {pywebexec-1.5.18 → pywebexec-1.6.0}/.gitignore +0 -0
  11. {pywebexec-1.5.18 → pywebexec-1.6.0}/LICENSE +0 -0
  12. {pywebexec-1.5.18 → pywebexec-1.6.0}/README.md +0 -0
  13. {pywebexec-1.5.18 → pywebexec-1.6.0}/pyproject.toml +0 -0
  14. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/__init__.py +0 -0
  15. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/pywebexec.py +0 -0
  16. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/css/Consolas NF.ttf +0 -0
  17. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/css/xterm.css +0 -0
  18. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/aborted.svg +0 -0
  19. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/copy.svg +0 -0
  20. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/copy_ok.svg +0 -0
  21. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/down-arrow.svg +0 -0
  22. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/failed.svg +0 -0
  23. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/favicon.svg +0 -0
  24. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/font-decrease.svg +0 -0
  25. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/font-increase.svg +0 -0
  26. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/pause.svg +0 -0
  27. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/popup.svg +0 -0
  28. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/resume.svg +0 -0
  29. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/running.svg +0 -0
  30. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/images/success.svg +0 -0
  31. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/commands.js +0 -0
  32. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/popup.js +0 -0
  33. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/LICENSE +0 -0
  34. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-canvas.js +0 -0
  35. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-canvas.js.map +0 -0
  36. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-fit.js +0 -0
  37. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
  38. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-unicode11.js +0 -0
  39. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/addon-unicode11.js.map +0 -0
  40. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/xterm.js +0 -0
  41. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/static/js/xterm/xterm.js.map +0 -0
  42. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/templates/__init__.py +0 -0
  43. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec/templates/popup.html +0 -0
  44. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec.egg-info/dependency_links.txt +0 -0
  45. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec.egg-info/entry_points.txt +0 -0
  46. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec.egg-info/requires.txt +0 -0
  47. {pywebexec-1.5.18 → pywebexec-1.6.0}/pywebexec.egg-info/top_level.txt +0 -0
  48. {pywebexec-1.5.18 → pywebexec-1.6.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.5.18
3
+ Version: 1.6.0
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -55,7 +55,9 @@ select { /* Safari bug */
55
55
  border-radius: 10px;
56
56
  overflow-y: hidden;
57
57
  }
58
- .copy-icon { cursor: pointer; }
58
+ .copy-icon {
59
+ cursor: pointer;
60
+ }
59
61
  .monospace {
60
62
  font-family: Consolas NF,monospace;
61
63
  font-size: 13px;
@@ -63,7 +65,10 @@ select { /* Safari bug */
63
65
  .system-font {
64
66
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
65
67
  }
66
- .copied { color: green; margin-left: 5px; }
68
+ .copied {
69
+ color: green;
70
+ margin-left: 5px;
71
+ }
67
72
  button {
68
73
  -webkit-appearance: none;
69
74
  -webkit-border-radius: none;
@@ -101,17 +106,23 @@ form {
101
106
  background-image: url("/static/images/favicon.svg");
102
107
  vertical-align: bottom;
103
108
  }
109
+ #thStatus {
110
+ cursor: pointer;
111
+ }
112
+ .status-norun {
113
+ background-image: url("/static/images/norun.svg");
114
+ }
104
115
  .status-running {
105
- background-image: url("/static/images/running.svg")
116
+ background-image: url("/static/images/running.svg");
106
117
  }
107
118
  .status-success {
108
- background-image: url("/static/images/success.svg")
119
+ background-image: url("/static/images/success.svg");
109
120
  }
110
121
  .status-failed {
111
- background-image: url("/static/images/failed.svg")
122
+ background-image: url("/static/images/failed.svg");
112
123
  }
113
124
  .status-aborted {
114
- background-image: url("/static/images/aborted.svg")
125
+ background-image: url("/static/images/aborted.svg");
115
126
  }
116
127
  .copy_clip {
117
128
  padding-right: 20px;
@@ -0,0 +1 @@
1
+ <svg fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="m0 12c0-6.627 5.373-12 12-12s12 5.373 12 12-5.373 12-12 12c-6.624-.008-11.992-5.376-12-11.999zm2.4 0c0 5.302 4.298 9.6 9.6 9.6s9.6-4.298 9.6-9.6-4.298-9.6-9.6-9.6c-5.299.006-9.594 4.301-9.6 9.599v.001zm4 0c0-3.093 2.507-5.6 5.6-5.6s5.6 2.507 5.6 5.6-2.507 5.6-5.6 5.6c-3.093 0-5.6-2.507-5.6-5.6z"></path></g></svg>
@@ -9,6 +9,8 @@ const maxScrollback = 99999;
9
9
  const maxSize = 10485760; // 10MB
10
10
  let fontSize = 14;
11
11
  let isPaused = false;
12
+ let showRunningOnly = false;
13
+ let hiddenCommandIds = [];
12
14
 
13
15
  function initTerminal()
14
16
  {
@@ -115,7 +117,7 @@ document.getElementById('launchForm').addEventListener('submit', async (event) =
115
117
  }
116
118
  });
117
119
 
118
- async function fetchCommands() {
120
+ async function fetchCommands(hide=false) {
119
121
  try {
120
122
  const response = await fetch(`/commands${urlToken}`);
121
123
  if (!response.ok) {
@@ -130,21 +132,28 @@ async function fetchCommands() {
130
132
  currentCommandId = commands[0].command_id;
131
133
  viewOutput(currentCommandId);
132
134
  }
135
+ runningCommands = [];
133
136
  commands.forEach(command => {
137
+ if (hide && showRunningOnly && command.status !== 'running') {
138
+ hiddenCommandIds.push(command.command_id);
139
+ return;
140
+ }
141
+ if (hiddenCommandIds.includes(command.command_id)) return;
134
142
  const commandRow = document.createElement('tr');
135
143
  commandRow.className = `clickable-row ${command.command_id === currentCommandId ? 'currentcommand' : ''}`;
136
144
  commandRow.onclick = () => viewOutput(command.command_id);
145
+ if (command.status === 'running') runningCommands.push(command.command.replace(/^\.\//, ''));
137
146
  commandRow.innerHTML = `
138
147
  <td class="monospace">
139
148
  ${navigator.clipboard == undefined ? `${command.command_id.slice(0, 8)}` : `<span class="copy_clip" onclick="copyToClipboard('${command.command_id}', this, event)">${command.command_id.slice(0, 8)}</span>`}
140
149
  </td>
141
150
  <td>${formatTime(command.start_time)}</td>
142
151
  <td>${command.status === 'running' ? formatDuration(command.start_time, new Date().toISOString()) : formatDuration(command.start_time, command.end_time)}</td>
143
- <td class="system-font">${command.command.replace(/^\.\//, '')}</td>
144
152
  <td><span class="status-icon status-${command.status}"></span>${command.status}${command.status === 'failed' ? ` (${command.exit_code})` : ''}</td>
145
153
  <td>
146
154
  ${command.command.startsWith('term') ? '' : command.status === 'running' ? `<button onclick="stopCommand('${command.command_id}', event)">Stop</button>` : `<button onclick="relaunchCommand('${command.command_id}', event)">Run</button>`}
147
155
  </td>
156
+ <td class="system-font">${command.command.replace(/^\.\//, '')}</td>
148
157
  <td class="monospace outcol">
149
158
  <button class="popup-button" onclick="openPopup('${command.command_id}', event)"></button>
150
159
  ${command.last_output_line || ''}
@@ -152,6 +161,13 @@ async function fetchCommands() {
152
161
  `;
153
162
  commandsTbody.appendChild(commandRow);
154
163
  });
164
+ if (runningCommands.length) {
165
+ document.getElementById('thStatus').innerHTML=`<span class="status-icon status-running"></span>Running (${runningCommands.length})`;
166
+ document.getElementById('thStatus').setAttribute('title', runningCommands.join("\n"));
167
+ } else {
168
+ document.getElementById('thStatus').innerHTML=`<span class="status-icon status-norun"></span>Status`;
169
+ document.getElementById('thStatus').setAttribute('title', "no command running");
170
+ }
155
171
  document.getElementById('dimmer').style.display = 'none';
156
172
  } catch (error) {
157
173
  console.log('Error fetching commands:', error);
@@ -198,9 +214,7 @@ async function fetchOutput(url) {
198
214
  toggleButton.style.display = 'none';
199
215
  document.getElementById('commandStatus').classList.remove('status-running');
200
216
  document.getElementById('commandStatus').classList.add(`status-${data.status}`);
201
- const row = document.getElementsByClassName("currentcommand");
202
- if (row.length > 0)
203
- row[0].cells[4].innerHTML = `<span class="status-icon status-${data.status}"></span>${data.status}${data.status === 'failed' ? ` (${data.exit_code})` : ''}`;
217
+ fetchCommands();
204
218
  } else {
205
219
  toggleButton.style.display = 'block';
206
220
  const title = extractTitle(data.output);
@@ -429,6 +443,12 @@ function toggleFetchOutput() {
429
443
 
430
444
  toggleButton.addEventListener('click', toggleFetchOutput);
431
445
 
446
+ document.getElementById('thStatus').addEventListener('click', () => {
447
+ showRunningOnly = !showRunningOnly;
448
+ hiddenCommandIds = [];
449
+ fetchCommands(showRunningOnly);
450
+ });
451
+
432
452
  window.addEventListener('resize', adjustOutputHeight);
433
453
  window.addEventListener('load', () => {
434
454
  initResizer();
@@ -31,9 +31,9 @@
31
31
  <th>ID</th>
32
32
  <th>Start Time</th>
33
33
  <th>Duration</th>
34
- <th>Command</th>
35
- <th>Status</th>
34
+ <th id="thStatus"><span class="status-icon status-norun"></span>Status</th>
36
35
  <th>Action</th>
36
+ <th>Command</th>
37
37
  <th>Output</th>
38
38
  </tr>
39
39
  </thead>
@@ -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.18'
16
- __version_tuple__ = version_tuple = (1, 5, 18)
15
+ __version__ = version = '1.6.0'
16
+ __version_tuple__ = version_tuple = (1, 6, 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.5.18
3
+ Version: 1.6.0
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -24,6 +24,7 @@ pywebexec/static/images/failed.svg
24
24
  pywebexec/static/images/favicon.svg
25
25
  pywebexec/static/images/font-decrease.svg
26
26
  pywebexec/static/images/font-increase.svg
27
+ pywebexec/static/images/norun.svg
27
28
  pywebexec/static/images/pause.svg
28
29
  pywebexec/static/images/popup.svg
29
30
  pywebexec/static/images/resume.svg
File without changes
File without changes
File without changes
File without changes
File without changes