collabcentral/html/jobDetail.html
Joseph B. McQueen e604c7e9c9 Initial commit: multi-bot CollabCentral
Extends the single-Novi codebase into a multi-bot mass-messenger where
each bot has its own token, avatar, label, and per-user authorization.

- Secrets moved out of config.json: per-bot tokens in gitignored
  config/botTokens.json (with enabled flag), service-account OAuth in
  gitignored config/token.json (rewritten by refresh cron), integration
  and Google keys in .env.
- Single Webex integration handles OAuth for all bots via a per-app
  redirect URI derived from OAUTH_CALLBACK_URL_TEMPLATE.
- New requireBot middleware and getBotConfig helper reject requests for
  unknown or disabled bots at the /CollabCentral/:app boundary.
- New /info endpoint plus dynamic frontend loading (sendMessage,
  monitorJobs) so pages self-describe per bot, including bot avatar
  fetched from Webex /people/me at startup.
- Job draft state keyed by cookieId + appName so each bot has its own
  building queue; job list/detail endpoints filter by appName so users
  only see jobs from bots they are authorized on.
- New jobDetail page for a readable per-job view; completed jobs are
  retained for 30 days by the cleanup cron.
- Completion adaptive cards use per-bot avatar and label.
- Miscellaneous fixes: off-by-two in the send loop, removed three dead
  send/process variants, added defensive init for jobs.* on load,
  dropped the deprecated crypto npm shim, and cleaned up stray logger
  labels and typos.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 17:53:07 -04:00

165 lines
4.6 KiB
HTML

<html>
<head>
<title>CollabCentral</title>
<link id="appName" rel="icon" type="image/x-icon" style="border-radius: 50%;" href="favicon.ico">
<style>
* { box-sizing: border-box; }
body {
background-color: #FFFFFF;
color: #2F3941;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
padding: 10px;
}
.header {
display: block;
background-color: tan;
width: 90%;
height: auto;
text-align: center;
margin: 0 auto;
}
#appInfo {
display: flex;
text-align: center;
align-content: center;
}
.name {
display: block;
text-align: right;
}
.container {
max-width: 1100px;
margin: 1em auto;
padding: 0 1em;
}
h2.jobTitle {
margin: 0.5em 0 0.2em;
}
.subtitle {
color: #6c757d;
margin: 0 0 1em;
}
.summary-grid {
display: grid;
grid-template-columns: max-content 1fr;
gap: 0.45em 1.5em;
margin: 1em 0 1.5em;
padding: 1em 1.2em;
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
}
.summary-grid dt {
font-weight: 600;
color: #555;
}
.summary-grid dd { margin: 0; }
.section-title {
font-size: 1.05em;
font-weight: 700;
margin: 1.5em 0 0.4em;
color: #2F3941;
}
.message-preview {
border: 1px solid #ddd;
border-radius: 6px;
padding: 1em 1.2em;
background: #fafafa;
margin: 0.4em 0 1em;
}
.message-preview img { max-width: 100%; height: auto; }
.pill {
display: inline-block;
padding: 0.15em 0.7em;
border-radius: 999px;
font-size: 0.85em;
font-weight: 600;
}
.pill.ok { background: #d4edda; color: #155724; }
.pill.err { background: #f8d7da; color: #721c24; }
.pill.pending { background: #fff3cd; color: #856404; }
td { white-space: pre-wrap !important; word-wrap: break-word; }
.hidden { display: none; }
.panel-empty {
padding: 2em;
max-width: 600px;
margin: 2em auto;
text-align: center;
border: 1px solid #ddd;
border-radius: 8px;
}
</style>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.css" />
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.js"></script>
</head>
<body>
<div class="header">
<div id="appInfo">
<img id="appIcon" style="border-radius: 50%; padding: 10pt;">
<div id="appLabel" style="font-size: 40pt;margin: auto;"></div>
</div>
<div style="text-align: center;"><a id="jobLink" href=''>Back to Jobs</a></div>
<div id="name" style="text-align: right;"></div>
</div>
<div id="unauthorizedPanel" class="panel-empty hidden">
<h2>You don't have access to this bot</h2>
<p>Your account isn't on the authorized list. Contact the bot's administrator.</p>
</div>
<div id="notFoundPanel" class="panel-empty hidden">
<h2>Job not found</h2>
<p>The job you're looking for doesn't exist, has been purged, or belongs to a different bot.</p>
</div>
<div id="detailPanel" class="container hidden">
<h2 class="jobTitle" id="jobTitle"></h2>
<p class="subtitle" id="subtitle"></p>
<dl class="summary-grid" id="summaryGrid"></dl>
<div class="section-title">Message</div>
<div class="message-preview" id="messagePreview"></div>
<div class="section-title">Recipients (<span id="recipientCount">0</span>)</div>
<table id="recipients" style="width: 100%;">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Status</th>
<th>Send Time</th>
<th>Error</th>
</tr>
</thead>
</table>
</div>
<script src="jobDetail.js"></script>
</body>
</html>