collabcentral/html/monitorJobs.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

126 lines
No EOL
3.6 KiB
HTML

<html>
<head>
<title>CollabCentral</title>
<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;
}
#table {
width: 80%;
}
td {
white-space: pre-wrap !important;
word-wrap:break-word;
}
.header {
display: block;
background-color: tan;
width: 80%;
height: auto;
text-align: center;
}
.name {
display: block;
text-align: right;
align-content: right;
}
#appInfo {
display: flex;
text-align: center;
align-content: center;
}
.hidden {
display: none;
}
</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>
<link id="appName" rel="icon" type="image/x-icon" style="border-radius: 50%;" href="favicon.ico">
<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=''>Send Message</a></div>
<div id="name" style="text-align: right;"></div>
</div>
<div id="unauthorizedPanel" class="hidden" style="padding: 2em; max-width: 600px; margin: 2em auto; text-align: center; border: 1px solid #ddd; border-radius: 8px;">
<h2>You don't have access to this bot</h2>
<p>Your account isn't on the authorized list for this bot. If you believe this is a mistake, contact the bot's administrator.</p>
</div>
<div id="jobsPanel" class="hidden">
<h3>Running Jobs</h3>
<div class="table"></div>
<table id="runningJobs" class="table">
<thead>
<tr>
<th>Submitter</th>
<th>App</th>
<th>Start Time</th>
<th>Total Recipients</th>
<th>Completed Recipients</th>
</tr>
</thead>
</table>
<h3>Scheduled Jobs</h3>
<table id="scheduledJobs">
<thead>
<tr>
<th>Submitter</th>
<th>App</th>
<th>Message</th>
<th>Recipients</th>
<th>Scheduled for</th>
</tr>
</thead>
</table>
<h3>Completed Jobs</h3>
<table id="completedJobs">
<thead>
<tr>
<th>jobId</th>
<th>Submitter</th>
<th>App</th>
<th>Message</th>
<th>Start Time</th>
<th>End Time</th>
<th>Total Time</th>
<th>Webex Time</th>
<th>Average Message Time</th>
<th>Messages Delivered</th>
<th>Total Messages</th>
<th>Success Rate</th>
</tr>
</thead>
</table>
</div>
<script src="monitorJobs.js"></script>
</body>
</html>