Compare commits
2 Commits
09e19a72d0
...
066c45ab9b
| Author | SHA1 | Date | |
|---|---|---|---|
| 066c45ab9b | |||
| 1e652fe311 |
@ -1 +1 @@
|
||||
v20260112-11-show-vspc-company-mapping-popup
|
||||
v20260112-12-vspc-company-mapping-popup-visible
|
||||
|
||||
@ -149,6 +149,33 @@ def inbox_message_detail(message_id: int):
|
||||
for obj in MailObject.query.filter_by(mail_message_id=msg.id).order_by(MailObject.object_name.asc()).all()
|
||||
]
|
||||
|
||||
# For VSPC Active Alarms summary messages, objects are typically not persisted until approval.
|
||||
# To enable multi-company mapping in the Inbox, we expose the company list derived from parsing
|
||||
# the stored HTML body (best-effort, without persisting objects).
|
||||
bsw = (getattr(msg, "backup_software", "") or "").strip()
|
||||
btype = (getattr(msg, "backup_type", "") or "").strip()
|
||||
jname = (getattr(msg, "job_name", "") or "").strip()
|
||||
if not objects and bsw == "Veeam" and btype == "Service Provider Console" and jname == "Active alarms summary":
|
||||
try:
|
||||
from ..parsers.veeam import _parse_vspc_active_alarms_from_html
|
||||
|
||||
parsed_objs, _status, _msg = _parse_vspc_active_alarms_from_html(body_html or "")
|
||||
companies: list[str] = []
|
||||
seen: set[str] = set()
|
||||
for o in parsed_objs or []:
|
||||
name = str((o or {}).get("name") or "")
|
||||
ix = name.find(" | ")
|
||||
if ix > 0:
|
||||
c = name[:ix].strip()
|
||||
if c and c not in seen:
|
||||
seen.add(c)
|
||||
companies.append(c)
|
||||
if companies:
|
||||
meta["vspc_companies"] = companies
|
||||
except Exception:
|
||||
# Never fail the message detail endpoint due to best-effort parsing.
|
||||
pass
|
||||
|
||||
return jsonify({"status": "ok", "meta": meta, "body_html": body_html, "objects": objects})
|
||||
|
||||
|
||||
|
||||
@ -510,26 +510,33 @@ function findCustomerIdByName(name) {
|
||||
mapBtn.classList.add("d-none");
|
||||
if (approveBtn) approveBtn.classList.remove("d-none");
|
||||
|
||||
var bsw = String(meta.backup_software || "").trim().toLowerCase();
|
||||
var btype = String(meta.backup_type || "").trim().toLowerCase();
|
||||
var bsw = String(meta.backup_software || "").trim();
|
||||
var btype = String(meta.backup_type || "").trim();
|
||||
var jname = String(meta.job_name || "").trim();
|
||||
|
||||
// Show the dedicated mapping popup for VSPC multi-company summary emails.
|
||||
// Do not rely on an exact job name match (it can vary between mail variants / legacy data).
|
||||
if (bsw !== "veeam" || btype !== "service provider console") {
|
||||
if (bsw !== "Veeam" || btype !== "Service Provider Console" || jname !== "Active alarms summary") {
|
||||
return;
|
||||
}
|
||||
|
||||
var objs = data.objects || [];
|
||||
var companies = [];
|
||||
var seen = {};
|
||||
objs.forEach(function (o) {
|
||||
var name = String((o && o.name) || "");
|
||||
var ix = name.indexOf(" | ");
|
||||
if (ix > 0) {
|
||||
var c = name.substring(0, ix).trim();
|
||||
if (c && !seen[c]) { seen[c] = true; companies.push(c); }
|
||||
}
|
||||
});
|
||||
if (Array.isArray(meta.vspc_companies) && meta.vspc_companies.length) {
|
||||
meta.vspc_companies.forEach(function (c) {
|
||||
c = String(c || "").trim();
|
||||
if (c) companies.push(c);
|
||||
});
|
||||
} else {
|
||||
// fallback: derive from parsed objects (when available)
|
||||
var objs = data.objects || [];
|
||||
var seen = {};
|
||||
objs.forEach(function (o) {
|
||||
var name = String((o && o.name) || "");
|
||||
var ix = name.indexOf(" | ");
|
||||
if (ix > 0) {
|
||||
var c = name.substring(0, ix).trim();
|
||||
if (c && !seen[c]) { seen[c] = true; companies.push(c); }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!companies.length) return;
|
||||
|
||||
|
||||
@ -199,6 +199,13 @@
|
||||
- Fixed VSPC company-mapping popup visibility by removing strict job name matching in the Inbox modal logic.
|
||||
- Made VSPC detection case-insensitive for backup software/type to improve robustness across mail variants and legacy data.
|
||||
|
||||
---
|
||||
|
||||
## v20260112-12-vspc-company-mapping-popup-visible
|
||||
- Enabled VSPC company-mapping popup visibility for “Active alarms summary” messages even when no objects are parsed.
|
||||
- Exposed parsed VSPC company list via the inbox message detail endpoint.
|
||||
- Updated inbox popup logic to trigger the dedicated VSPC company-mapping workflow based on detected companies instead of parsed objects.
|
||||
|
||||
================================================================================================================================================
|
||||
## v0.1.19
|
||||
This release delivers a broad set of improvements focused on reliability, transparency, and operational control across mail processing, administrative auditing, and Run Checks workflows. The changes aim to make message handling more robust, provide better insight for administrators, and give operators clearer and more flexible control when reviewing backup runs.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user