🎂 前端更新:重建HTML文件导出模板

This commit is contained in:
YukiChiyoda 2024-01-15 21:58:12 +08:00
parent f5ca91cc31
commit aa6ee88d7b
6 changed files with 1488 additions and 980 deletions

View File

@ -16,19 +16,17 @@ from app.util.emoji import get_emoji_url
from app.util.image import get_image_path, get_image
from app.util.music import get_music_path
icon_files = {
'./icon/word.png': ['doc', 'docx'],
'./icon/excel.png': ['xls', 'xlsx'],
'./icon/csv.png': ['csv'],
'./icon/txt.png': ['txt'],
'./icon/zip.png': ['zip', '7z','rar'],
'./icon/zip.png': ['zip', '7z', 'rar'],
'./icon/ppt.png': ['ppt', 'pptx'],
'./icon/pdf.png': ['pdf'],
}
class HtmlExporter(ExporterBase):
def text(self, doc, message):
type_ = message[2]
@ -287,7 +285,9 @@ class HtmlExporter(ExporterBase):
content = f.read()
html_head, html_end = content.split('/*注意看这是分割线*/')
f = open(filename, 'w', encoding='utf-8')
f.write(html_head.replace("<title>Chat Records</title>", f"<title>{self.contact.remark}</title>"))
html_head = html_head.replace("<title>出错了</title>", f"<title>{self.contact.remark}</title>")
html_head = html_head.replace("<p id=\"title\">出错了</p>", f"<p id=\"title\">{self.contact.remark}</p>")
f.write(html_head)
self.rangeSignal.emit(len(messages))
for index, message in enumerate(messages):
type_ = message[2]
@ -333,7 +333,7 @@ class HtmlExporter(ExporterBase):
@return:
"""
self.num += 1
print('子线程完成',self.num,'/',self.total_num)
print('子线程完成', self.num, '/', self.total_num)
if self.num == self.total_num:
# 所有子线程都完成之后就发送完成信号
self.okSignal.emit(1)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!-- saved from url=(0211)https://lmq.music.163.com/c/year2018/EPoNy/?uid=2D7195A5E2F508DB0C6B44DAA020E46B&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=123603375&from=timeline&isappinstalled=0 -->
<html lang="en" class=" z-ios">
<html lang="zh-CN" class=" z-ios">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="format-detection" content="telephone=no">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!-- saved from url=(0167)http://m2.link/c/year2018/j3POd/?uid=53899B14C24F351212F4DC92673113FC&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=2227269 -->
<html lang="en" class=" z-ios">
<html lang="zh-CN" class=" z-ios">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">