fastpluggy-postgres-tools 0.1.45__tar.gz → 0.1.46__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.

Potentially problematic release.


This version of fastpluggy-postgres-tools might be problematic. Click here for more details.

Files changed (31) hide show
  1. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/PKG-INFO +1 -1
  2. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/PKG-INFO +1 -1
  3. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/pyproject.toml +1 -1
  4. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/sequences.py +7 -3
  5. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/templates/sequences.html.j2 +15 -1
  6. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/README.md +0 -0
  7. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/SOURCES.txt +0 -0
  8. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/dependency_links.txt +0 -0
  9. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/entry_points.txt +0 -0
  10. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/requires.txt +0 -0
  11. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/fastpluggy_postgres_tools.egg-info/top_level.txt +0 -0
  12. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/setup.cfg +0 -0
  13. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/__init__.py +0 -0
  14. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/badges.py +0 -0
  15. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/plugin.py +0 -0
  16. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/__init__.py +0 -0
  17. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/alerts.py +0 -0
  18. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/connections.py +0 -0
  19. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/dashboard.py +0 -0
  20. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/db_size.py +0 -0
  21. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/extensions.py +0 -0
  22. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/indexes.py +0 -0
  23. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/queries.py +0 -0
  24. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/replication.py +0 -0
  25. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/tables.py +0 -0
  26. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/vacuum.py +0 -0
  27. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/routers/visibility_map.py +0 -0
  28. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/templates/dashboard_cards.html.j2 +0 -0
  29. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/utils/__init__.py +0 -0
  30. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/src/utils/db_utils.py +0 -0
  31. {fastpluggy_postgres_tools-0.1.45 → fastpluggy_postgres_tools-0.1.46}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastpluggy-postgres-tools
3
- Version: 0.1.45
3
+ Version: 0.1.46
4
4
  Summary: PostgreSQL database monitoring and management plugin for FastPluggy
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastpluggy-postgres-tools
3
- Version: 0.1.45
3
+ Version: 0.1.46
4
4
  Summary: PostgreSQL database monitoring and management plugin for FastPluggy
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fastpluggy-postgres-tools"
7
- version = "0.1.45"
7
+ version = "0.1.46"
8
8
  readme = "README.md"
9
9
  description = "PostgreSQL database monitoring and management plugin for FastPluggy"
10
10
  requires-python = ">=3.10"
@@ -51,7 +51,8 @@ def get_sequences_data(db: Session):
51
51
  schemaname || '.' || sequencename AS sequence_name,
52
52
  last_value,
53
53
  max_value,
54
- COALESCE(max_value - last_value, 0) AS remaining
54
+ COALESCE(max_value - last_value, 0) AS remaining,
55
+ COALESCE(cycle, false) AS cycle
55
56
  FROM pg_sequences
56
57
  WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
57
58
  ORDER BY remaining ASC
@@ -62,21 +63,23 @@ def get_sequences_data(db: Session):
62
63
  for row in result:
63
64
  last_value = row["last_value"]
64
65
  max_value = row["max_value"]
66
+ cycle = row["cycle"]
65
67
 
66
68
  if last_value is None or max_value is None or max_value == 0:
67
69
  percent_used = 0.0
68
70
  else:
69
71
  percent_used = round((last_value * 100) / max_value, 2)
70
72
 
71
- status = _classify(percent_used)
73
+ status = "cycle" if cycle else _classify(percent_used)
72
74
  rows.append({
73
75
  "sequence_name": row["sequence_name"],
74
76
  "last_value": last_value,
75
77
  "max_value": max_value,
76
78
  "remaining": row["remaining"],
77
79
  "percent_used": percent_used,
80
+ "cycle": cycle,
78
81
  "status": status,
79
- "bar_color": _bar_color(status),
82
+ "bar_color": "info" if cycle else _bar_color(status),
80
83
  "bar_width": max(percent_used, 0.5) if percent_used > 0 else 0,
81
84
  "last_display": _format_big_number(last_value),
82
85
  "max_display": _format_big_number(max_value),
@@ -94,6 +97,7 @@ async def get_sequences_view(request: Request, db=Depends(get_db), view_builder=
94
97
  "healthy": sum(1 for s in sequences if s["status"] == "healthy"),
95
98
  "warning": sum(1 for s in sequences if s["status"] == "warning"),
96
99
  "critical": sum(1 for s in sequences if s["status"] == "critical"),
100
+ "cycle": sum(1 for s in sequences if s["status"] == "cycle"),
97
101
  }
98
102
 
99
103
  widget = CustomTemplateWidget(
@@ -45,6 +45,18 @@
45
45
  </div>
46
46
  </div>
47
47
  </div>
48
+ {% if widget.summary.cycle > 0 %}
49
+ <div class="col-6 col-sm-3">
50
+ <div class="card border-info">
51
+ <div class="card-body p-3 text-center">
52
+ <div class="text-info small text-uppercase fw-bold">
53
+ <i class="fas fa-sync-alt me-1"></i>Cycling
54
+ </div>
55
+ <div class="h1 mb-0 text-info">{{ widget.summary.cycle }}</div>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ {% endif %}
48
60
  </div>
49
61
 
50
62
  {# ── Sequence cards with progress bars ── #}
@@ -98,7 +110,9 @@
98
110
  <span class="font-monospace">{{ seq.remaining_display }}</span>
99
111
  </td>
100
112
  <td class="text-center">
101
- {% if seq.status == 'critical' %}
113
+ {% if seq.status == 'cycle' %}
114
+ <span class="badge bg-info-lt"><i class="fas fa-sync-alt me-1"></i>Cycle</span>
115
+ {% elif seq.status == 'critical' %}
102
116
  <span class="badge bg-danger-lt">Critical</span>
103
117
  {% elif seq.status == 'warning' %}
104
118
  <span class="badge bg-warning-lt text-dark">Warning</span>