portune 0.1.5__py3-none-any.whl → 0.1.6__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.

Potentially problematic release.


This version of portune might be problematic. Click here for more details.

portune/portune.py CHANGED
@@ -281,8 +281,8 @@ function initTableFilters(table) {
281
281
  // Add filter input
282
282
  const input = document.createElement('input');
283
283
  input.type = 'search';
284
- input.className = 'column-filter';
285
- input.placeholder = '\\uD83D\\uDD0E\\uFE0E';
284
+ input.className = `column-filter input-${index}`;
285
+ input.placeholder = '\\uD83D\\uDD0E\\uFE0E';
286
286
  input.addEventListener('input', () => applyFilters(table));
287
287
  header.appendChild(input);
288
288
  }
@@ -547,6 +547,7 @@ function exportToExcel(table, fileNamePrefix = 'export') {
547
547
  let commandsTable = document.querySelector('#commandTable');
548
548
  document.addEventListener('DOMContentLoaded', () => {
549
549
  if (commandsTable) initTableFilters(commandsTable);
550
+ document.querySelector('.input-4').value = '{FILTER}';
550
551
  });
551
552
  </script>
552
553
  """
@@ -1187,6 +1188,7 @@ def generate_html_report(
1187
1188
  stats: Dict[str, Any],
1188
1189
  input_file: str = '',
1189
1190
  desc_titles: List[str] = [],
1191
+ filter: str = '',
1190
1192
  ) -> None:
1191
1193
  """Generate a complete HTML report of the port scan results.
1192
1194
 
@@ -1256,8 +1258,11 @@ def generate_html_report(
1256
1258
  ping_status = 'UP' if ping else 'N/A' if noping else 'DOWN'
1257
1259
  ping_class = 'green' if ping else 'blue' if noping else 'red'
1258
1260
  status_class = 'green' if status == 'CONNECTED' else 'blue' if status == 'REFUSED' else 'red'
1261
+ row_class = ''
1262
+ if filter and status != filter:
1263
+ row_class = 'hidden'
1259
1264
  f.write(f'''
1260
- <tr>
1265
+ <tr class="{row_class}">
1261
1266
  <td>{escape(str(hostname))}</td>
1262
1267
  <td>{escape(str(ip))}</td>
1263
1268
  <td>{str(get_vlan_base(ip, stats['vlan_bits']))}</td>
@@ -1274,7 +1279,7 @@ def generate_html_report(
1274
1279
  f.write(generate_html_summary(stats, parallelism, timeout))
1275
1280
 
1276
1281
  # Add JavaScript for interactivity
1277
- f.write(f'</body>{JS}</html>\n')
1282
+ f.write(f'</body>{JS.replace("{FILTER}", filter)}</html>\n')
1278
1283
 
1279
1284
  def print_statistics(stats, timeout, parallelism):
1280
1285
  def format_percent(value, total):
@@ -1449,6 +1454,9 @@ def main():
1449
1454
  parser.add_argument('-s', '--summary', action="store_true", help='Print scan summary information')
1450
1455
  parser.add_argument('-b', '--bits', type=int, default=16, help='VLAN bits for timeout summary (default: 16)')
1451
1456
  parser.add_argument('-d', '--desc_titles', type=str, nargs='*', help='List of custom description titles for hosts (optional)')
1457
+ parser.add_argument('-f', '--filter', type=str, help='default status filter for html report (optional)',
1458
+ choices=['CONNECTED', 'REFUSED', 'TIMEOUT', 'UNREACHABLE', 'RESOLVE_FAIL'], default='')
1459
+
1452
1460
  # Email related arguments
1453
1461
  email_group = parser.add_argument_group('Email Options')
1454
1462
  email_group.add_argument('--email-to', help='Comma-separated list of email recipients')
@@ -1516,6 +1524,7 @@ def main():
1516
1524
  stats,
1517
1525
  args.input_file,
1518
1526
  args.desc_titles,
1527
+ args.filter,
1519
1528
  )
1520
1529
 
1521
1530
  # Print summary
portune/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 = '0.1.5'
21
- __version_tuple__ = version_tuple = (0, 1, 5)
20
+ __version__ = version = '0.1.6'
21
+ __version_tuple__ = version_tuple = (0, 1, 6)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: portune
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Author: Franck Jouvanceau
6
6
  Maintainer: Franck Jouvanceau
@@ -0,0 +1,9 @@
1
+ portune/__init__.py,sha256=RfXuNfHBqfRt_z4IukwN1a0oeCXahuMOO8_eBt4T8NM,58
2
+ portune/portune.py,sha256=F54wyOz50SQTA8VX4zesh579tkGeRQ_RqxKSttjO3x8,66340
3
+ portune/version.py,sha256=ESbJO0YD7TYfOUv_WDIJJgWELGepEWsoyhqVifEcXPA,511
4
+ portune-0.1.6.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
5
+ portune-0.1.6.dist-info/METADATA,sha256=NskJQhjxaHfwCHBdlDxlg-pfvMj8USEIGPRKWzybuiY,3281
6
+ portune-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ portune-0.1.6.dist-info/entry_points.txt,sha256=6j7jAf5fOZrLPbVIs3z92R1tT891WyY9YxQ6OVnPKG0,80
8
+ portune-0.1.6.dist-info/top_level.txt,sha256=CITDikHhRKAsSOGmNJzD-xSp6D5iBhSr9ZS1qy8-SL0,8
9
+ portune-0.1.6.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- portune/__init__.py,sha256=RfXuNfHBqfRt_z4IukwN1a0oeCXahuMOO8_eBt4T8NM,58
2
- portune/portune.py,sha256=cMn0fosBTV98wXWHKdFYtUN9S1ZseRXJ6emNe2rWFns,65846
3
- portune/version.py,sha256=Y4jy4bEMmwl_qNPCmiMFnlQ2ofMoqyG37hp8uwI3m10,511
4
- portune-0.1.5.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
5
- portune-0.1.5.dist-info/METADATA,sha256=hHJ5KFpUxEbSeF4FOXpbhqzjdZ92jf55g3iUTOk2-2g,3281
6
- portune-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- portune-0.1.5.dist-info/entry_points.txt,sha256=6j7jAf5fOZrLPbVIs3z92R1tT891WyY9YxQ6OVnPKG0,80
8
- portune-0.1.5.dist-info/top_level.txt,sha256=CITDikHhRKAsSOGmNJzD-xSp6D5iBhSr9ZS1qy8-SL0,8
9
- portune-0.1.5.dist-info/RECORD,,