Merge pull request 'Auto-commit local changes before build (2026-01-12 13:58:49)' (#99) from v20260112-12-vspc-company-mapping-popup-visible into main
Reviewed-on: #99
This commit is contained in:
commit
066c45ab9b
@ -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 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})
|
return jsonify({"status": "ok", "meta": meta, "body_html": body_html, "objects": objects})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -510,26 +510,33 @@ function findCustomerIdByName(name) {
|
|||||||
mapBtn.classList.add("d-none");
|
mapBtn.classList.add("d-none");
|
||||||
if (approveBtn) approveBtn.classList.remove("d-none");
|
if (approveBtn) approveBtn.classList.remove("d-none");
|
||||||
|
|
||||||
var bsw = String(meta.backup_software || "").trim().toLowerCase();
|
var bsw = String(meta.backup_software || "").trim();
|
||||||
var btype = String(meta.backup_type || "").trim().toLowerCase();
|
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.
|
if (bsw !== "Veeam" || btype !== "Service Provider Console" || jname !== "Active alarms summary") {
|
||||||
// Do not rely on an exact job name match (it can vary between mail variants / legacy data).
|
|
||||||
if (bsw !== "veeam" || btype !== "service provider console") {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var objs = data.objects || [];
|
|
||||||
var companies = [];
|
var companies = [];
|
||||||
var seen = {};
|
if (Array.isArray(meta.vspc_companies) && meta.vspc_companies.length) {
|
||||||
objs.forEach(function (o) {
|
meta.vspc_companies.forEach(function (c) {
|
||||||
var name = String((o && o.name) || "");
|
c = String(c || "").trim();
|
||||||
var ix = name.indexOf(" | ");
|
if (c) companies.push(c);
|
||||||
if (ix > 0) {
|
});
|
||||||
var c = name.substring(0, ix).trim();
|
} else {
|
||||||
if (c && !seen[c]) { seen[c] = true; companies.push(c); }
|
// 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;
|
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.
|
- 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.
|
- 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
|
## 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.
|
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