pywebexec 1.5.18__py3-none-any.whl → 1.6.0__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.
@@ -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>
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.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
@@ -1,8 +1,8 @@
1
1
  pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
2
  pywebexec/pywebexec.py,sha256=S24FSD4XywesMvM6nqJMdS8E1lF9mklN4nUlnZUp9Zs,28760
3
- pywebexec/version.py,sha256=4dXebS3MmuJVzRzthWNVLSC2f7ozQPniKxTATW5ZukM,413
3
+ pywebexec/version.py,sha256=Ry70pc5l-IBhT9gahlkNwZPp4g0CzVEWqsat9H-UASY,411
4
4
  pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
5
- pywebexec/static/css/style.css,sha256=ALqne5pOJrAgujkl3YiFPwG85iZGKatYfZteEx1pZV8,7872
5
+ pywebexec/static/css/style.css,sha256=eQOnaLHBr9AOsqnfJVvbK3rtCvwrRBMqqbXs9W2vFP8,7997
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
@@ -12,6 +12,7 @@ pywebexec/static/images/failed.svg,sha256=ADZ7IKrUyOXtqpivnz3VcH0-Wru-I5MOi3OJAk
12
12
  pywebexec/static/images/favicon.svg,sha256=9gSN5Oak1zTWhTCyutlupPBKUxcbdoVt7dvhk8xvEug,1224
13
13
  pywebexec/static/images/font-decrease.svg,sha256=89TJXQpfZ-XDJ2qC0c7cbLH-tWC-4AJQr_VOgsp06Gg,1782
14
14
  pywebexec/static/images/font-increase.svg,sha256=u-EBxUzmOhKx4UH96fb4gLZ0l6Jkew1HLhcSqz7Z1ak,1869
15
+ pywebexec/static/images/norun.svg,sha256=_9PyQklBOfUwFak1gVrm-76tYM825urAFhj-zMBec20,555
15
16
  pywebexec/static/images/pause.svg,sha256=qKDx76yirEvSeeez50zUn0i9Twdem9XLgveekALVLy4,1387
16
17
  pywebexec/static/images/popup.svg,sha256=0Bl9A_v5cBsMPn6FnOlVWlAQKgd2zqiWQbhjcL9BDzI,559
17
18
  pywebexec/static/images/resume.svg,sha256=99LP1Ya2JXakRCO9kW8JMuT_4a_CannF65EiuwtvK4A,607
@@ -19,7 +20,7 @@ pywebexec/static/images/running.svg,sha256=fBCYwYb2O9K4N3waC2nURP25NRwZlqR4PbDZy
19
20
  pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaOLQemmc,489
20
21
  pywebexec/static/js/commands.js,sha256=8JDb3Q55EJOYf2Q9Uy6qEuqAnn1oGjM0RndgQ4aOjqo,7725
21
22
  pywebexec/static/js/popup.js,sha256=TCzGoPVS_EvwzGc544SvRgLYG7XWXRF8tIQGfu3atrU,8533
22
- pywebexec/static/js/script.js,sha256=Vt1CT8-MbxcYQRuHORPL6mCgFxHQyjutm6QiHm7xlFA,16456
23
+ pywebexec/static/js/script.js,sha256=aqv-Oa6k3JWfrXKUV54nKE34c7HUUg7yHiTfZJzosKg,17335
23
24
  pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
24
25
  pywebexec/static/js/xterm/addon-canvas.js,sha256=ez6QTVvsmLVNJmdJlM-ZQ5bErwlxAQ_9DUmDIptl2TM,94607
25
26
  pywebexec/static/js/xterm/addon-canvas.js.map,sha256=ECBA4B-BqUpdFeRzlsEWLSQnudnhLP-yPQJ8_hKquMo,379537
@@ -30,11 +31,11 @@ pywebexec/static/js/xterm/addon-unicode11.js.map,sha256=paDj5KKtTIUGedQn2x7CaUTD
30
31
  pywebexec/static/js/xterm/xterm.js,sha256=H5kaw7Syg-v5bmCuI6AKUnZd06Lkb6b92p8aqwMvdJU,289441
31
32
  pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCfN0U_OI6Zw,1118392
32
33
  pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- pywebexec/templates/index.html,sha256=_3tt0tHElhH75aMNtfqpM_AoHTXTi7Gkuf7ku12NltI,2755
34
+ pywebexec/templates/index.html,sha256=3XAXlpluzmTxC75KLzHDI4aJvQyQrOShB_weJ27PE2U,2815
34
35
  pywebexec/templates/popup.html,sha256=6FfzMjxuAC_xwyMGPf3p5tm6iPVY0QCsqY80eotD0z8,1362
35
- pywebexec-1.5.18.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
36
- pywebexec-1.5.18.dist-info/METADATA,sha256=zc9Gi99XxKqgY8Ubi1IiPgQgndA5P2Q4AA1Yc46J4FI,7802
37
- pywebexec-1.5.18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
38
- pywebexec-1.5.18.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
39
- pywebexec-1.5.18.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
40
- pywebexec-1.5.18.dist-info/RECORD,,
36
+ pywebexec-1.6.0.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
37
+ pywebexec-1.6.0.dist-info/METADATA,sha256=YG21s478D9Zya980eKHBB0hq15jFprpqtBbdwIrZJJc,7801
38
+ pywebexec-1.6.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
39
+ pywebexec-1.6.0.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
40
+ pywebexec-1.6.0.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
41
+ pywebexec-1.6.0.dist-info/RECORD,,