增加聊天记录导出为html

This commit is contained in:
xaoyo committed 2023-11-16 18:55:45 +08:00
1 parent 447dec78c9
commit 21fe2bbcbd
6 files changed
+163 -15

No files matched your search

+5
View File
@@ -4,6 +4,11 @@
<meta charset="UTF-8">
<title>chat</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<style>
img {
max-width: 400px;
}
</style>
</head>
<body>
+8 -1
View File
@@ -79,7 +79,7 @@
</div>
<div class="col-3" style="display: flex; justify-content: flex-end;">
<button type="button" class="btn btn-primary">导出</button>
<button id="btn_export" type="button" class="btn btn-primary">导出</button>
</div>
</div>
@@ -184,6 +184,13 @@
request_function(requestUrl);
}
});
// 导出按钮点击事件
document.getElementById('btn_export').addEventListener('click', function () {
var requestUrl = '/export_chat_data?username=' + encodeURIComponent(globalUsername);
window.open(requestUrl);
});
</script>
</body>