Files
WooCow/assets/css/woocow.css
Malin 1c5b58f238 feat: domains, transports, logs, quarantine, spam filter, i18n + UX fixes
Features added:
- Admin > Domains: add domains to Mailcow servers, auto-generate DKIM,
  display full DNS record set (MX, SPF, DMARC, DKIM, autoconfig CNAMEs)
  with one-click copy per record
- Admin > Transports: manage sender-dependent relay hosts (add/delete)
- Admin > Logs: view Postfix, Dovecot, Rspamd, Ratelimit, API and other
  server logs in a dark scrollable panel
- My Account: per-domain Quarantine panel — view score, sender, subject,
  date; permanently delete quarantined messages
- My Account: per-mailbox Spam Filter slider (1–15 threshold) saved via API
- My Account: Aliases & Forwarders (alias creation doubles as forwarder
  to any external address)

UX fixes:
- Quota 0 now displays ∞ (unlimited) in both admin and account views
- Admin mailbox action buttons replaced with Dashicon icon buttons
  (lock, chart-bar, trash) with title tooltips

i18n:
- load_plugin_textdomain registered on init hook
- All user-facing PHP strings wrapped in __() / esc_html__()
- Translated strings array passed to account JS via wp_localize_script
- woocow-es_ES.po/.mo — Spanish translation
- woocow-ro_RO.po/.mo — Romanian translation (with correct plural forms)
- English remains the fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 08:38:52 +01:00

436 lines
12 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =========================================================
WooCow Shared styles (admin + account)
========================================================= */
/* ── Admin wrap ──────────────────────────────────────────── */
.woocow-wrap h1 { margin-bottom: 8px; }
.woocow-version { font-size: 13px; font-weight: 400; color: #777; vertical-align: middle; }
.woocow-toolbar {
display: flex;
gap: 10px;
align-items: center;
margin: 16px 0;
}
.woocow-flex { flex-wrap: wrap; }
/* ── Cards ───────────────────────────────────────────────── */
.woocow-card {
background: #fff;
border: 1px solid #ddd;
border-radius: 6px;
padding: 20px 24px;
margin-bottom: 20px;
}
.woocow-form table.form-table th { width: 160px; }
.woocow-form-actions {
display: flex;
align-items: center;
gap: 10px;
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid #f0f0f0;
}
/* ── Dashboard cards ─────────────────────────────────────── */
.woocow-dashboard-cards {
display: flex;
gap: 20px;
flex-wrap: wrap;
margin-top: 20px;
}
.woocow-dashboard-cards .woocow-card {
flex: 1;
min-width: 180px;
text-align: center;
padding: 30px 20px;
}
.woocow-card-number {
display: block;
font-size: 48px;
font-weight: 700;
color: #2c3e50;
line-height: 1;
margin-bottom: 8px;
}
.woocow-card-label {
display: block;
font-size: 14px;
color: #666;
margin-bottom: 16px;
}
/* ── Tables ──────────────────────────────────────────────── */
.woocow-table { margin-top: 12px; }
.woocow-table td.woocow-actions { white-space: nowrap; }
.woocow-table td.woocow-actions button { margin-right: 4px; }
/* ── Badges ──────────────────────────────────────────────── */
.woocow-badge {
display: inline-block;
padding: 2px 8px;
border-radius: 10px;
font-size: 12px;
font-weight: 600;
}
.woocow-badge-green { background: #d4edda; color: #155724; }
.woocow-badge-grey { background: #e9ecef; color: #495057; }
/* ── Quota bar (admin) ───────────────────────────────────── */
.woocow-quota-bar {
width: 80px;
height: 6px;
background: #eee;
border-radius: 3px;
overflow: hidden;
display: inline-block;
vertical-align: middle;
margin-left: 6px;
}
.woocow-quota-bar div {
height: 100%;
background: #27ae60;
border-radius: 3px;
}
/* ── Customer autocomplete ───────────────────────────────── */
.woocow-autocomplete {
position: absolute;
background: #fff;
border: 1px solid #ccc;
border-radius: 4px;
max-height: 220px;
overflow-y: auto;
z-index: 9999;
min-width: 320px;
box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.woocow-ac-item {
padding: 8px 12px;
cursor: pointer;
font-size: 13px;
}
.woocow-ac-item:hover { background: #f0f7ff; }
.woocow-selected-badge {
display: inline-block;
margin-left: 10px;
padding: 3px 10px;
background: #e8f4fd;
border-radius: 12px;
font-size: 12px;
color: #0073aa;
font-weight: 600;
}
/* ── Modal (admin) ───────────────────────────────────────── */
.woocow-modal {
position: fixed;
inset: 0;
background: rgba(0,0,0,.5);
z-index: 100000;
display: flex;
align-items: center;
justify-content: center;
}
.woocow-modal-box {
background: #fff;
border-radius: 8px;
padding: 28px 32px;
min-width: 420px;
max-width: 560px;
width: 90%;
box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.woocow-modal-box h3 { margin-top: 0; }
.woocow-modal-actions {
display: flex;
gap: 10px;
align-items: center;
margin-top: 20px;
}
/* ── Flex inline ─────────────────────────────────────────── */
.woocow-flex-inline { display: flex; align-items: center; gap: 6px; }
.woocow-at, .woocow-arrow { font-weight: 700; color: #555; }
.woocow-domain-label { font-weight: 600; color: #333; }
/* ── Inline test result ──────────────────────────────────── */
.wc-inline-test { font-size: 12px; }
/* =============================================================
My Account Email Hosting
============================================================= */
.woocow-account { max-width: 900px; }
/* Domain panel */
.woocow-domain-panel {
border: 1px solid #e0e0e0;
border-radius: 8px;
margin-bottom: 24px;
overflow: hidden;
background: #fff;
}
.woocow-domain-header {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 20px;
background: #f7f8fa;
border-bottom: 1px solid #e0e0e0;
flex-wrap: wrap;
}
.woocow-domain-name {
font-size: 17px;
font-weight: 700;
color: #1a1a2e;
flex: 1;
min-width: 140px;
}
.woocow-domain-server {
font-size: 12px;
color: #888;
margin-right: auto;
}
.woocow-mailboxes-wrap { padding: 16px 20px; }
/* Mailbox row */
.woocow-mailbox-row {
border: 1px solid #ececec;
border-radius: 6px;
padding: 14px 16px;
margin-bottom: 12px;
background: #fafafa;
transition: box-shadow .2s;
}
.woocow-mailbox-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.woocow-mbox-main {
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
margin-bottom: 10px;
}
.woocow-mbox-address { display: flex; align-items: center; gap: 8px; }
.woocow-mbox-icon { font-size: 18px; }
.woocow-mbox-name { font-size: 13px; color: #777; }
.woocow-quota-wrap { display: flex; align-items: center; gap: 8px; }
.woocow-quota-bar-outer {
width: 120px;
height: 8px;
background: #e8e8e8;
border-radius: 4px;
overflow: hidden;
}
.woocow-quota-bar-inner { height: 100%; border-radius: 4px; transition: width .4s; }
.woocow-quota-text { font-size: 12px; color: #666; white-space: nowrap; }
.woocow-mbox-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
/* Alias section */
.woocow-aliases-wrap {
margin-top: 12px;
padding-top: 12px;
border-top: 1px dashed #e0e0e0;
}
.woocow-alias-list {
list-style: none;
margin: 0 0 10px;
padding: 0;
}
.woocow-alias-list li {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 0;
border-bottom: 1px solid #f0f0f0;
font-size: 13px;
}
.woocow-alias-list li:last-child { border-bottom: none; }
.woocow-alias-addr { font-weight: 600; }
.woocow-alias-goto { color: #666; }
.woocow-alias-fields {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
margin-bottom: 8px;
padding: 12px;
background: #f0f7ff;
border-radius: 6px;
}
/* Create mailbox form */
.woocow-create-mbox-form {
margin-top: 16px;
padding: 20px;
background: #f7f9fc;
border: 1px dashed #bbd;
border-radius: 8px;
}
.woocow-create-mbox-form h4 { margin: 0 0 14px; }
.woocow-field-row { margin-bottom: 10px; }
/* Buttons */
.woocow-btn {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 7px 14px;
border-radius: 5px;
border: none;
font-size: 13px;
font-weight: 600;
cursor: pointer;
text-decoration: none;
transition: opacity .15s, background .15s;
white-space: nowrap;
line-height: 1;
}
.woocow-btn:hover { opacity: .88; }
.woocow-btn-primary { background: #2271b1; color: #fff; }
.woocow-btn-outline { background: transparent; border: 1.5px solid #2271b1; color: #2271b1; }
.woocow-btn-ghost { background: transparent; border: 1.5px solid #bbb; color: #555; }
.woocow-btn-danger { background: #c0392b; color: #fff; }
.woocow-btn-sm { padding: 5px 10px; font-size: 12px; }
.woocow-btn-xs { padding: 3px 7px; font-size: 11px; }
/* Inputs */
.woocow-input { padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; width: 100%; max-width: 280px; box-sizing: border-box; }
.woocow-input-sm { width: 80px; padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }
/* Modal (account) */
#woocow-pw-modal {
position: fixed;
inset: 0;
background: rgba(0,0,0,.55);
z-index: 99999;
display: flex;
align-items: center;
justify-content: center;
}
#woocow-pw-modal .woocow-modal-box {
background: #fff;
border-radius: 10px;
padding: 32px;
min-width: 340px;
max-width: 460px;
width: 92%;
box-shadow: 0 8px 40px rgba(0,0,0,.22);
}
#woocow-pw-modal h3 { margin: 0 0 4px; }
.woocow-modal-subtitle { color: #555; font-size: 14px; margin: 0 0 20px; }
/* Misc */
.woocow-loading { color: #888; font-style: italic; }
.woocow-muted { color: #aaa; font-size: 13px; }
.woocow-error { color: #c0392b; }
/* ── Icon buttons (admin) ────────────────────────────────────── */
.button.woocow-icon-btn {
width: 30px !important;
min-width: 0 !important;
padding: 0 !important;
display: inline-flex !important;
align-items: center;
justify-content: center;
}
.button.woocow-icon-btn .dashicons {
font-size: 15px;
width: 15px;
height: 28px;
line-height: 28px;
}
/* ── DNS records table ───────────────────────────────────────── */
.woocow-dns-table { margin-top: 8px; }
.woocow-dns-host code { font-size: 11px; word-break: break-all; }
.woocow-dns-val { max-width: 340px; }
.woocow-dns-value {
display: block;
font-size: 11px;
word-break: break-all;
white-space: pre-wrap;
background: #f6f8fa;
padding: 4px 6px;
border-radius: 3px;
max-height: 60px;
overflow-y: auto;
}
/* ── Log viewer ──────────────────────────────────────────────── */
.woocow-log-toolbar {
display: flex;
gap: 12px;
align-items: center;
margin-bottom: 8px;
}
.woocow-log-pre {
background: #1e1e2e;
color: #cdd6f4;
padding: 16px;
border-radius: 6px;
font-size: 12px;
line-height: 1.6;
max-height: 500px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-all;
}
/* ── Quarantine (account) ────────────────────────────────────── */
.woocow-quarantine-wrap {
padding: 16px 20px;
border-top: 1px solid #e0e0e0;
background: #fffbf0;
}
.woocow-quarantine-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
margin-bottom: 10px;
}
.woocow-quarantine-table th,
.woocow-quarantine-table td {
padding: 7px 10px;
border-bottom: 1px solid #eee;
text-align: left;
vertical-align: middle;
}
.woocow-quarantine-table th { font-weight: 700; background: #f5f5f5; }
.woocow-quarantine-table tr:hover td { background: #fafafa; }
.woocow-score-badge {
display: inline-block;
padding: 2px 7px;
border-radius: 10px;
font-size: 11px;
font-weight: 700;
color: #fff;
}
/* ── Spam filter panel ───────────────────────────────────────── */
.woocow-spam-panel { font-size: 13px; }
.woocow-spam-panel input[type=range] { vertical-align: middle; }
.wc-spam-val { font-weight: 700; min-width: 30px; display: inline-block; }
@media (max-width: 600px) {
.woocow-domain-header,
.woocow-mbox-main,
.woocow-mbox-actions { flex-direction: column; align-items: flex-start; }
.woocow-quota-bar-outer { width: 80px; }
.woocow-alias-fields { flex-direction: column; }
.woocow-input { max-width: 100%; }
.woocow-quarantine-table { font-size: 11px; }
.woocow-quarantine-table th, .woocow-quarantine-table td { padding: 5px 6px; }
}