You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
243 lines
7.0 KiB
243 lines
7.0 KiB
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1.0"
|
|
/>
|
|
<title>DeepSearcher - 智能搜索系统</title>
|
|
<link
|
|
rel="stylesheet"
|
|
href="../static/css/styles.css"
|
|
/>
|
|
<link
|
|
rel="stylesheet"
|
|
id="md-theme"
|
|
href="../static/themes/light.css"
|
|
/>
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>DeepSearcher 智能深度搜索系统</h1>
|
|
<p class="app-description">
|
|
基于大型语言模型和向量数据库的知识管理系统,支持私有数据搜索和在线内容整合,提供准确答案和综合报告。
|
|
</p>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="card">
|
|
<h2 class="card-title">文件加载</h2>
|
|
<div class="form-group">
|
|
<label for="filePaths">文件路径(多个路径用逗号分隔)</label>
|
|
<input
|
|
type="text"
|
|
id="filePaths"
|
|
placeholder="例如: /path/to/file1.pdf,/path/to/file2.txt"
|
|
/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="collectionName">集合名称(可选)</label>
|
|
<input
|
|
type="text"
|
|
id="collectionName"
|
|
placeholder="例如: my_collection"
|
|
/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="collectionDesc">集合描述(可选)</label>
|
|
<textarea
|
|
id="collectionDesc"
|
|
rows="2"
|
|
placeholder="例如: 这是一个测试集合"
|
|
></textarea>
|
|
</div>
|
|
<button id="loadFilesBtn">加载文件</button>
|
|
<div
|
|
id="loadStatus"
|
|
class="status"
|
|
></div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2 class="card-title">网站内容加载</h2>
|
|
<div class="form-group">
|
|
<label for="websiteUrls">网站URL(多个URL用逗号分隔)</label>
|
|
<input
|
|
type="text"
|
|
id="websiteUrls"
|
|
placeholder="例如: https://example.com/page1,https://example.com/page2"
|
|
/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="webCollectionName">集合名称(可选)</label>
|
|
<input
|
|
type="text"
|
|
id="webCollectionName"
|
|
placeholder="例如: web_collection"
|
|
/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="webCollectionDesc">集合描述(可选)</label>
|
|
<textarea
|
|
id="webCollectionDesc"
|
|
rows="2"
|
|
placeholder="例如: 来自网站的内容"
|
|
></textarea>
|
|
</div>
|
|
<button id="loadWebsiteBtn">加载网站内容</button>
|
|
<div
|
|
id="webLoadStatus"
|
|
class="status"
|
|
></div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2 class="card-title">智能查询</h2>
|
|
<div class="form-group">
|
|
<label for="queryText">请输入您的问题</label>
|
|
<textarea
|
|
id="queryText"
|
|
rows="3"
|
|
placeholder="例如: 请生成一份关于人工智能发展趋势的报告"
|
|
></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="maxIter">最大迭代次数 (1-10)</label>
|
|
<input
|
|
type="number"
|
|
id="maxIter"
|
|
min="1"
|
|
max="10"
|
|
value="3"
|
|
/>
|
|
</div>
|
|
<button id="queryBtn">执行查询</button>
|
|
<button
|
|
id="clearMessagesBtn"
|
|
style="margin-left: 10px; background-color: var(--text-secondary)"
|
|
>
|
|
清空消息
|
|
</button>
|
|
<div
|
|
id="queryStatus"
|
|
class="status"
|
|
></div>
|
|
|
|
<div
|
|
id="queryResult"
|
|
class="result-container"
|
|
>
|
|
<h3>查询结果:</h3>
|
|
<div
|
|
class="query-result markdown-body"
|
|
id="resultText"
|
|
></div>
|
|
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/light.css')"
|
|
>
|
|
light
|
|
</button>
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/github.css')"
|
|
>
|
|
GitHub
|
|
</button>
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/newsprint.css')"
|
|
>
|
|
Newsprint
|
|
</button>
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/pixyll.css')"
|
|
>
|
|
Pixyll
|
|
</button>
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/whitey.css')"
|
|
>
|
|
Whitey
|
|
</button>
|
|
|
|
<button
|
|
class="theme-button"
|
|
onclick="changeTheme('static/themes/latex.css')"
|
|
>
|
|
latex
|
|
</button>
|
|
|
|
<button
|
|
id="download-btn"
|
|
class="theme-button"
|
|
onclick="downloadPdf()"
|
|
>
|
|
下载
|
|
</button>
|
|
</div>
|
|
|
|
<div
|
|
id="processResult"
|
|
class="result-container"
|
|
>
|
|
<h3>处理过程:</h3>
|
|
<div
|
|
id="messageStream"
|
|
class="message-stream"
|
|
>
|
|
<div
|
|
class="message-container"
|
|
id="messageContainer"
|
|
></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer>
|
|
<p>DeepSearcher © 2025 | 智能深度搜索系统</p>
|
|
</footer>
|
|
</div>
|
|
|
|
<script src="../static/js/app.js"></script>
|
|
<script>
|
|
// fetch('../static/data/test.txt').then((res) => {
|
|
// res.text().then((text) => {
|
|
// console.log(text);
|
|
// document.getElementById('queryResult').innerHTML = marked.parse(text);
|
|
// });
|
|
// });
|
|
|
|
function changeTheme(url) {
|
|
document.getElementById('md-theme').setAttribute('href', url);
|
|
}
|
|
|
|
function downloadPdf() {
|
|
const element = document.getElementById('resultText');
|
|
|
|
const opt = {
|
|
margin: 12,
|
|
filename: '内容.pdf',
|
|
image: { type: 'jpeg', quality: 0.98 },
|
|
html2canvas: { scale: 2 }, // 提高清晰度
|
|
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
|
|
pagebreak: {
|
|
mode: ['css', 'legacy'],
|
|
avoid: '.page-break-avoid'
|
|
}
|
|
};
|
|
|
|
html2pdf().set(opt).from(element).save();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|