Implement compliance decryption package with HTML report, streamline audit and envelope routes

This commit is contained in:
2026-01-10 19:41:49 +03:00
Unverified
parent fd4c00057c
commit 0b683e3c83
14 changed files with 1229 additions and 429 deletions
@@ -0,0 +1,347 @@
/* FromChat compliance bundle report styles (conversation-like, minimal JS) */
:root {
--bg: #0b0f14;
--panel: #0f1520;
--panel-2: #121a27;
--text: #e6edf3;
--muted: #9aa7b2;
--border: #223045;
--accent: #4f7cff;
--bubble-in: #131b28;
--bubble-out: #1a2540;
--shadow: rgba(0, 0, 0, 0.35);
}
html, body {
height: 100%;
}
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.wrap {
max-width: 980px;
margin: 0 auto;
padding: 22px 14px 64px;
}
.topbar {
position: sticky;
top: 0;
z-index: 10;
backdrop-filter: blur(10px);
background: rgba(11, 15, 20, 0.75);
border-bottom: 1px solid rgba(34, 48, 69, 0.7);
}
.topbar-inner {
max-width: 980px;
margin: 0 auto;
padding: 14px 14px;
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
justify-content: space-between;
}
.brand {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.brand-title {
font-size: 15px;
font-weight: 700;
letter-spacing: 0.2px;
}
.brand-subtitle {
font-size: 12px;
color: var(--muted);
white-space: normal;
word-break: break-word;
}
.tools {
display: flex;
gap: 10px;
align-items: center;
}
.search {
width: min(420px, 55vw);
border: 1px solid var(--border);
border-radius: 12px;
background: rgba(255, 255, 255, 0.03);
padding: 9px 10px;
color: var(--text);
outline: none;
}
.search:focus {
border-color: rgba(79, 124, 255, 0.65);
box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.18);
}
.hint {
font-size: 12px;
color: var(--muted);
}
.conversation {
margin-top: 16px;
border: 1px solid var(--border);
background: var(--panel);
border-radius: 16px;
overflow: hidden;
box-shadow: 0 12px 28px var(--shadow);
}
.conv-header {
cursor: default;
padding: 14px 14px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
border-bottom: 1px solid rgba(34, 48, 69, 0.65);
}
.conv-title {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.conv-title .line1 {
font-weight: 700;
font-size: 14px;
}
.conv-title .line2 {
font-size: 12px;
color: var(--muted);
}
.conv-meta {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: flex-end;
color: var(--muted);
font-size: 12px;
}
.pill {
border: 1px solid rgba(34, 48, 69, 0.9);
border-radius: 999px;
padding: 3px 8px;
background: rgba(255, 255, 255, 0.02);
}
.messages {
padding: 12px 10px 14px;
}
.day {
display: flex;
justify-content: center;
margin: 12px 0 10px;
}
.day span {
font-size: 12px;
color: var(--muted);
border: 1px solid rgba(34, 48, 69, 0.8);
background: rgba(255, 255, 255, 0.02);
padding: 3px 10px;
border-radius: 999px;
}
.message-container {
display: flex;
margin: 8px 0;
gap: 12px;
align-items: flex-start;
}
.edit-tabs-vertical {
display: flex;
flex-direction: column;
min-width: 80px;
gap: 4px;
}
.tab-vertical {
padding: 6px 4px;
cursor: pointer;
border: 1px solid rgba(34, 48, 69, 0.6);
border-radius: 6px;
background: rgba(255, 255, 255, 0.02);
text-align: center;
transition: background-color 0.15s ease;
display: flex;
flex-direction: column;
align-items: center;
gap: 1px;
min-height: 40px;
}
.tab-vertical:hover {
background: rgba(79, 124, 255, 0.08);
}
.tab-vertical.active {
background: var(--accent);
color: white;
border-color: var(--accent);
}
.tab-label-vertical {
font-size: 10px;
font-weight: 700;
line-height: 1.1;
}
.tab-time-vertical {
font-size: 8px;
opacity: 0.9;
line-height: 1.1;
white-space: nowrap;
}
.bubble-area {
flex: 1;
min-width: 0;
}
.bubble {
display: none;
max-width: min(720px, 92%);
border: 1px solid rgba(34, 48, 69, 0.9);
border-radius: 16px;
padding: 10px 10px 9px;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
background: var(--bubble-in);
border-top-left-radius: 6px;
}
.bubble.active {
display: block;
}
.bubble-header {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 10px;
margin-bottom: 6px;
}
.who {
font-size: 12px;
color: var(--muted);
}
.who strong {
color: var(--text);
font-weight: 700;
}
.text {
white-space: pre-wrap;
word-break: break-word;
font-size: 14px;
line-height: 1.45;
}
.msg-meta {
margin-top: 8px;
font-size: 11px;
color: var(--muted);
display: flex;
justify-content: space-between;
gap: 10px;
}
.msg-meta-left {
white-space: nowrap;
}
.msg-meta-right {
white-space: nowrap;
text-align: right;
}
.attachments {
margin-top: 10px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 10px;
}
.att {
border: 1px solid rgba(34, 48, 69, 0.9);
border-radius: 12px;
padding: 10px;
background: rgba(255, 255, 255, 0.02);
}
.att-name {
font-size: 13px;
font-weight: 700;
margin-bottom: 7px;
}
.thumb {
width: 100%;
max-height: 260px;
object-fit: contain;
border-radius: 10px;
border: 1px solid rgba(34, 48, 69, 0.9);
background: rgba(0, 0, 0, 0.18);
}
.att-actions {
margin-top: 8px;
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
.att-size {
font-size: 12px;
color: var(--muted);
}
.footer {
margin-top: 18px;
font-size: 12px;
color: var(--muted);
padding: 10px 2px;
}
.hidden {
display: none !important;
}
@@ -0,0 +1,105 @@
/* Minimal JS for filtering messages in the static report. */
function normalizeText(s) {
return (s || "").toString().toLowerCase();
}
function filterReport(query) {
const q = normalizeText(query).trim();
const conversations = document.querySelectorAll(".conversation");
let anyVisible = false;
conversations.forEach((conv) => {
const rows = conv.querySelectorAll("[data-search]");
let visibleInConv = 0;
rows.forEach((row) => {
const hay = normalizeText(row.getAttribute("data-search"));
const match = !q || hay.includes(q);
row.classList.toggle("hidden", !match);
if (match) visibleInConv += 1;
});
const convMatch = visibleInConv > 0;
conv.classList.toggle("hidden", !convMatch);
if (convMatch) anyVisible = true;
});
const hint = document.getElementById("filterHint");
if (hint) {
hint.textContent = q
? (anyVisible ? "Filtered" : "No matches")
: "Type to filter by text, user id, filename";
}
}
function setupEditHistoryTabs() {
document.querySelectorAll(".edit-tabs-vertical").forEach((tabsContainer) => {
const tabs = tabsContainer.querySelectorAll(".tab-vertical");
tabs.forEach((tab) => {
tab.addEventListener("click", () => {
const version = tab.getAttribute("data-version");
const messageId = tab.getAttribute("data-message-id");
// Find the corresponding message container
const messageContainer = document.querySelector(`.message-container:has([data-message-id="${messageId}"])`);
if (!messageContainer) return;
// Update tab states within this message
const allTabs = messageContainer.querySelectorAll(".tab-vertical");
allTabs.forEach(t => t.classList.remove("active"));
tab.classList.add("active");
// Update bubble states within this message
const allBubbles = messageContainer.querySelectorAll(".bubble");
allBubbles.forEach(bubble => {
bubble.classList.toggle("active", bubble.getAttribute("data-version") === version);
});
});
});
});
}
function convertTimestampsToLocal() {
// Convert all timestamps to local timezone
document.querySelectorAll("[data-timestamp]").forEach((element) => {
const timestamp = element.getAttribute("data-timestamp");
if (!timestamp) return;
try {
// Parse the ISO timestamp
const date = new Date(timestamp.replace(" ", "T").replace("Z", "+00:00"));
// Format in local timezone
const localTime = date.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
});
// Update the displayed text
element.textContent = localTime;
} catch (e) {
// If parsing fails, leave the original text
console.warn("Failed to parse timestamp:", timestamp);
}
});
}
document.addEventListener("DOMContentLoaded", () => {
const input = document.getElementById("searchInput");
if (input) {
input.addEventListener("input", (e) => {
filterReport(e.target.value);
});
}
// Initialize edit history tabs
setupEditHistoryTabs();
// Convert timestamps to local timezone
convertTimestampsToLocal();
});