|
|
@@ -934,7 +934,17 @@ class WebServer: |
|
|
|
d = datetime.datetime.utcfromtimestamp(ts).replace(tzinfo = datetime.timezone.utc) |
|
|
|
date = f'{d:%Y-%m-%d }' if withDate else '' |
|
|
|
lineId = hashlib.md5(f'{ts} {command} {content}'.encode('utf-8')).hexdigest()[:8] |
|
|
|
ret.append(f'<tr id="l{lineId}" class="command_{html.escape(command)}"><td><a href="/{html.escape(path)}/{d:%Y-%m-%d}#l{lineId}">{date}{d:%H:%M:%S}</a></td><td>{html.escape(content)}</td></tr>') |
|
|
|
if command in ('NOTICE', 'PRIVMSG'): |
|
|
|
author, content = content.split(' ', 1) |
|
|
|
else: |
|
|
|
author = '' |
|
|
|
ret.append(''.join([ |
|
|
|
f'<tr id="l{lineId}" class="command_{html.escape(command)}">', |
|
|
|
f'<td><a href="/{html.escape(path)}/{d:%Y-%m-%d}#l{lineId}">{date}{d:%H:%M:%S}</a></td>', |
|
|
|
f'<td>{html.escape(author)}</td>', |
|
|
|
f'<td>{html.escape(content)}</td>', |
|
|
|
'</tr>' |
|
|
|
])) |
|
|
|
return '<table>\n' + '\n'.join(ret) + '\n</table>' if ret else '' |
|
|
|
|
|
|
|
async def get_log(self, request): |
|
|
|