Massprice/static/css/style.css
Barely Removable bec399dd11
All checks were successful
Deploy / deploy (push) Successful in 38s
Replace credential auto-login with a Chrome-remote-debugging session capture flow
Live testing against the real site found MassPrice's login is behind
hCaptcha, which silently blocks fully automated username/password
login outright (the form never submits) — no selector fix could work
around this. Also fixed the broken _is_logged_out() heuristic: an
unauthenticated visit to /Rule/List redirects to the public marketing
homepage, not a /login URL, so run_rule/list_rules were silently
scraping the wrong page instead of erroring.

New flow: a Session page lets the user start a headless-but-CDP-exposed
Chromium instance, log in themselves via chrome://inspect (solving the
captcha as a real click), then capture that browser's cookies into the
same auth_state.json scheduled runs already use. Required a socat proxy
in the container image, since Chromium's debug port binds loopback-only
regardless of --remote-debugging-address (confirmed by live testing),
unreachable through Docker's port mapping without it. All Playwright
objects for this now live on one dedicated thread (automation.py's
_debug_worker), since the sync API isn't safe to call across the
arbitrary threads gunicorn's gthread workers hand out per request.

Dashboard now shows a banner when the latest run failed specifically
due to a missing/expired session, rather than just looking like an
empty rule list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6TgffxTvYhqxykAbVQg2v
2026-08-31 19:55:08 -07:00

186 lines
6.1 KiB
CSS

:root {
--bg: #12161c;
--panel: #1b212b;
--panel-alt: #232a35;
--border: #2b3340;
--text: #e6e9ef;
--text-dim: #9aa4b2;
--accent: #3b82f6;
--accent-dim: #1e3a5f;
--success: #34d399;
--failure: #f87171;
--radius: 8px;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-size: 15px;
}
h1 { font-size: 1.4rem; margin: 0; }
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 24px;
border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.1rem; }
.brand span { color: var(--text-dim); font-weight: 400; }
nav a {
color: var(--text-dim);
text-decoration: none;
margin-left: 20px;
font-size: 0.9rem;
}
nav a:hover, nav a.active { color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
footer {
text-align: center;
color: var(--text-dim);
font-size: 0.75rem;
padding: 24px;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
flex-wrap: wrap;
gap: 12px;
}
.page-header-meta { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--text-dim); }
.small { font-size: 0.78rem; }
.btn {
background: var(--panel-alt);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 8px 14px;
cursor: pointer;
font-size: 0.85rem;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-small { padding: 6px 10px; font-size: 0.8rem; }
.rule-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 16px;
}
.rule-card {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 18px;
display: flex;
flex-direction: column;
gap: 12px;
}
.rule-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rule-card-header h2 { font-size: 1.05rem; margin: 0; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
position: absolute; inset: 0; background: var(--panel-alt);
border: 1px solid var(--border); border-radius: 22px; cursor: pointer; transition: .15s;
}
.slider::before {
content: ""; position: absolute; height: 16px; width: 16px; left: 2px; top: 2px;
background: var(--text-dim); border-radius: 50%; transition: .15s;
}
.switch input:checked + .slider { background: var(--accent-dim); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--accent); }
.rule-last-run { font-size: 0.82rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.status-success { background: var(--success); }
.status-dot.status-failure { background: var(--failure); }
.status-row-failure td { color: #f2a3a3; }
.schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.schedule-chip {
display: flex; align-items: center; gap: 10px;
background: var(--panel-alt); border: 1px solid var(--border); border-radius: 6px;
padding: 6px 10px; font-size: 0.82rem;
}
.chip-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.chip-days { color: var(--text-dim); flex: 1; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.72rem; }
.chip-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.chip-remove:hover { color: var(--failure); }
.schedule-add { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--border); padding-top: 12px; }
.schedule-add-row { display: flex; gap: 8px; }
.new-time {
background: var(--panel-alt); border: 1px solid var(--border); color: var(--text);
border-radius: 6px; padding: 6px 8px; font-size: 0.85rem; flex: 1;
}
.day-toggles { display: flex; gap: 4px; flex-wrap: wrap; }
.day-toggle {
background: var(--panel-alt); border: 1px solid var(--border); color: var(--text-dim);
border-radius: 6px; padding: 4px 8px; font-size: 0.72rem; cursor: pointer; text-transform: uppercase;
}
.day-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.rule-actions { display: flex; justify-content: flex-end; }
.login-card {
max-width: 320px; margin: 80px auto; background: var(--panel);
border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
display: flex; flex-direction: column; gap: 12px;
}
.login-card input {
background: var(--panel-alt); border: 1px solid var(--border); color: var(--text);
border-radius: 6px; padding: 10px; font-size: 1rem;
}
.error { color: var(--failure); font-size: 0.85rem; }
.empty-state { color: var(--text-dim); }
.banner {
border-radius: var(--radius);
padding: 12px 16px;
margin-bottom: 20px;
font-size: 0.88rem;
}
.banner-warn {
background: rgba(248, 113, 113, 0.12);
border: 1px solid var(--failure);
color: #f2c2c2;
}
.banner a { color: var(--text); }
.panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 16px;
}
.panel h2 { font-size: 1rem; margin: 0 0 12px; }
.panel-narrow { max-width: 560px; }
.session-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.session-steps code { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.session-actions { display: flex; gap: 8px; margin-top: 16px; }
.activity-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.activity-table th, .activity-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.activity-table th { color: var(--text-dim); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; }