pywebexec 2.4.0__py3-none-any.whl → 2.4.1__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.
@@ -538,6 +538,7 @@ body.dimmed * {
538
538
  text-align: center;
539
539
  padding: 0px 4px;
540
540
  margin-left: auto;
541
+ cursor: pointer
541
542
  }
542
543
 
543
544
  .xterm-accessibility {
@@ -21,11 +21,13 @@ function initTableFilters(table) {
21
21
  // Add sort button at the beginning
22
22
  contentSpan.insertBefore(sortBtn, contentSpan.firstChild);
23
23
 
24
- // Add row counter for last column
24
+ // Add export button and row counter for last column
25
25
  if (index === headers.length - 1) {
26
+ // Add row counter
26
27
  const rowCount = document.createElement('span');
27
28
  rowCount.className = 'row-count';
28
29
  rowCount.classList.add('system-font');
30
+ rowCount.onclick = () => exportToExcel(table);
29
31
  contentSpan.appendChild(rowCount);
30
32
  }
31
33
 
@@ -47,7 +49,7 @@ function initTableFilters(table) {
47
49
  function updateRowCount(table, count) {
48
50
  const rowCount = table.querySelector('.row-count');
49
51
  if (rowCount) {
50
- rowCount.textContent = `${count}`;
52
+ rowCount.textContent = `⤓ ${count}`;
51
53
  }
52
54
  }
53
55
 
@@ -143,6 +145,56 @@ function applyFilters(table) {
143
145
  }
144
146
  }
145
147
 
148
+ function exportToExcel(table) {
149
+ // Create HTML content
150
+ const html = `
151
+ <html>
152
+ <head>
153
+ <meta charset="UTF-8">
154
+ <style>
155
+ table { border-collapse: collapse; }
156
+ th, td { border: 1px solid black; padding: 5px; }
157
+ th { background-color: #f2f2f2; }
158
+ </style>
159
+ </head>
160
+ <body>
161
+ <table>
162
+ <thead>
163
+ <tr>${
164
+ Array.from(table.querySelectorAll('thead th'))
165
+ .filter((_, i) => i !== 4 || table !== commandsTable)
166
+ .map(th => `<th>${th.querySelector('.th-content')?.textContent.replace('⇕', '').replace(/⤓.*/, '').trim() || ''}</th>`)
167
+ .join('')
168
+ }</tr>
169
+ </thead>
170
+ <tbody>${
171
+ Array.from(table.querySelectorAll('tbody tr'))
172
+ .filter(row => row.style.display !== 'none')
173
+ .map(row =>
174
+ `<tr>${
175
+ Array.from(row.cells)
176
+ .filter((_, i) => i !== 4 || table !== commandsTable)
177
+ .map(cell => `<td>${cell.textContent.trim()}</td>`)
178
+ .join('')
179
+ }</tr>`
180
+ ).join('')
181
+ }</tbody>
182
+ </table>
183
+ </body>
184
+ </html>`;
185
+
186
+ // Create and trigger download
187
+ const blob = new Blob([html], { type: 'application/vnd.ms-excel' });
188
+ const url = window.URL.createObjectURL(blob);
189
+ const a = document.createElement('a');
190
+ a.href = url;
191
+ a.download = 'export_' + new Date().toISOString().slice(0,10) + '.xls';
192
+ document.body.appendChild(a);
193
+ a.click();
194
+ document.body.removeChild(a);
195
+ window.URL.revokeObjectURL(url);
196
+ }
197
+
146
198
  let commandsTable = document.querySelector('#commandsTable');
147
199
  document.addEventListener('DOMContentLoaded', () => {
148
200
  if (commandsTable) initTableFilters(commandsTable);
pywebexec/version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.4.0'
21
- __version_tuple__ = version_tuple = (2, 4, 0)
20
+ __version__ = version = '2.4.1'
21
+ __version_tuple__ = version_tuple = (2, 4, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pywebexec
3
- Version: 2.4.0
3
+ Version: 2.4.1
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -2,10 +2,10 @@ pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
2
2
  pywebexec/host_ip.py,sha256=oiCMlo2o3AkkgXDarUSx8T3FWXKI0vk1-EPnx5FGBd8,1332
3
3
  pywebexec/pywebexec.py,sha256=NT4f7Xd4qMkAgjgwguqKKbUkOTCqT7ArRYlsW57Pfwg,48477
4
4
  pywebexec/swagger.yaml,sha256=I_oLpp7Hqel8SDEEykvpmCT-Gv3ytGlziq9bvQOrtZY,7598
5
- pywebexec/version.py,sha256=KyHVhKcn4Ob8_JP09Buz8x5uB4b7RJZLl3FBlZ8sWSY,511
5
+ pywebexec/version.py,sha256=H3hbvip-BJTNbNG0ITRXctaII3Vc2949yckZEGuAGg8,511
6
6
  pywebexec/static/css/form.css,sha256=2JUhraeL46JaiNoD_MSKA2JdouHkXaamhd77DnCqG8k,7291
7
7
  pywebexec/static/css/markdown.css,sha256=br4-iK9wigTs54N2KHtjgZ4KLH0THVSvJo-XZAdMHiE,1970
8
- pywebexec/static/css/style.css,sha256=mdLDqKIGLxJtR9tSaThL8po0CXoEkm9P0k_gS8_wPcA,11652
8
+ pywebexec/static/css/style.css,sha256=X0f9IcYLgESCFHwL8TVhDNaeIeLZERkLt4U8ugL2meM,11672
9
9
  pywebexec/static/css/swagger-ui.css,sha256=xhXN8fnUaIACGHuPIEIr9-qmyYr6Zx0k2wv4Qy7Bg1Y,154985
10
10
  pywebexec/static/css/swagger-ui.css.map,sha256=dJy-xBn_htK4BNupTMIl33ddse7BXsrCdDJWlTJodnw,258842
11
11
  pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
@@ -38,7 +38,7 @@ pywebexec/static/js/popup.js,sha256=IaKmk2U2hEn-Nv6krf_PPW6LaG8NcpCkJKb7lUX0qZo,
38
38
  pywebexec/static/js/schemaform.js,sha256=2AIjwdjSDTE2ide8UMmQt4tS-7-JKqidKdopq9mNzvo,12458
39
39
  pywebexec/static/js/script.js,sha256=SpNmskHKJHza0Au7QWrb17EKqiMPbMz5CDmaLt_i3M4,21548
40
40
  pywebexec/static/js/swagger-form.js,sha256=CLcSHMhk5P4-_2MIRBoJLgEnIj_9keDDSzUugXHZjio,4565
41
- pywebexec/static/js/tablefilter.js,sha256=ml6oGCik11W61ifGWqLLmY_sC7gOH1tsqOFXFQ336lo,5590
41
+ pywebexec/static/js/tablefilter.js,sha256=Yy4oC--5kHwbKxM9MpmLPTty_4hthHTk5xfRXYDbbqA,7772
42
42
  pywebexec/static/js/js-yaml/LICENSE,sha256=oHvCRGi5ZUznalR9R6LbKC0HcztxXbTHOpi9Y5YflVA,1084
43
43
  pywebexec/static/js/js-yaml/js-yaml.min.js,sha256=Rdw90D3AegZwWiwpibjH9wkBPwS9U4bjJ51ORH8H69c,39430
44
44
  pywebexec/static/js/marked/LICENSE.md,sha256=jjo_gvWaYJWPVsoI9EVkfDKkcz3HymwsRvbriYRxq5w,2942
@@ -68,9 +68,9 @@ pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
68
68
  pywebexec/templates/index.html,sha256=29-MBjeJ5mgYdrkRB27WiY0okQLYcFFycJvdCMuwvV0,3974
69
69
  pywebexec/templates/popup.html,sha256=3kpMccKD_OLLhJ4Y9KRw6Ny8wQWjVaRrUfV9y5-bDiQ,1580
70
70
  pywebexec/templates/swagger_ui.html,sha256=MAPr-z96VERAecDvX37V8q2Nxph-O0fNDBul1x2w9SI,1147
71
- pywebexec-2.4.0.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
72
- pywebexec-2.4.0.dist-info/METADATA,sha256=of_DSpdHxXl41y6oQxQWaTvioxOEdYan-96zOHRIjz4,13015
73
- pywebexec-2.4.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
74
- pywebexec-2.4.0.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
75
- pywebexec-2.4.0.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
76
- pywebexec-2.4.0.dist-info/RECORD,,
71
+ pywebexec-2.4.1.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
72
+ pywebexec-2.4.1.dist-info/METADATA,sha256=NDiz3mJy1lEvTjgwbofaIR0UaIxhqsxxvbJ5po0Ffdc,13015
73
+ pywebexec-2.4.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
74
+ pywebexec-2.4.1.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
75
+ pywebexec-2.4.1.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
76
+ pywebexec-2.4.1.dist-info/RECORD,,