info summary

Changed files
+15 -8
atproto-notifications
src
pages
server
+9 -7
atproto-notifications/src/pages/Admin.tsx
··· 127 credentials 128 ok={accounts => accounts.length > 0 ? ( 129 <ul> 130 - {accounts.map(({ did, first_seen, role }) => ( 131 - <li key={did}> 132 - <Account did={did} firstSeen={first_seen} role={role} /> 133 </li> 134 ))} 135 </ul> ··· 141 ); 142 } 143 144 - function Account({ did, firstSeen, role }) { 145 return ( 146 <p> 147 <Handle did={did} /> 148 - {', '} 149 - "{role}" 150 {', '} 151 - <ReactTimeAgo date={new Date(firstSeen)} locale="en-US" /> 152 </p> 153 ); 154 }
··· 127 credentials 128 ok={accounts => accounts.length > 0 ? ( 129 <ul> 130 + {accounts.map(info => ( 131 + <li key={info.did}> 132 + <Account {...info} /> 133 </li> 134 ))} 135 </ul> ··· 141 ); 142 } 143 144 + function Account({ did, first_seen, role, active_subs, total_pushes, last_push }) { 145 return ( 146 <p> 147 <Handle did={did} /> 148 + {' '} 149 + ({active_subs} subs, {total_pushes} pushes, latest <ReactTimeAgo date={new Date(last_push)} locale="en-US" />) 150 + <br/> 151 + joined <ReactTimeAgo date={new Date(first_seen)} locale="en-US" /> 152 {', '} 153 + role: <code>{role}</code> 154 </p> 155 ); 156 }
+6 -1
server/db.js
··· 131 this.#stmt_admin_secret_accounts = db.prepare( 132 `select did, 133 unixepoch(first_seen) * 1000 as 'first_seen', 134 - role 135 from accounts 136 where secret_password = ? 137 order by first_seen desc`); 138 139 this.#transactionally = t => db.transaction(t).immediate();
··· 131 this.#stmt_admin_secret_accounts = db.prepare( 132 `select did, 133 unixepoch(first_seen) * 1000 as 'first_seen', 134 + role, 135 + count(*) as 'active_subs', 136 + sum(p.total_pushes) as 'total_pushes', 137 + unixepoch(max(p.last_push)) * 1000 as 'last_push' 138 from accounts 139 + join push_subs p on (p.account_did = did) 140 where secret_password = ? 141 + group by did 142 order by first_seen desc`); 143 144 this.#transactionally = t => db.transaction(t).immediate();