diff --git a/lightrag/api/static/js/lightrag_api.js b/lightrag/api/static/js/lightrag_api.js
index 67e258b9..94e85eb6 100644
--- a/lightrag/api/static/js/lightrag_api.js
+++ b/lightrag/api/static/js/lightrag_api.js
@@ -58,6 +58,12 @@ const pages = {
Indexed Files
+
`,
@@ -225,7 +231,22 @@ const handlers = {
}
progress.classList.add('hidden');
});
-
+ rescanBtn.addEventListener('click', async () => {
+ let apiKey = localStorage.getItem('apiKey') || '';
+ const progress = document.getElementById('uploadProgress');
+ const progressBar = progress.querySelector('div');
+ const statusText = document.getElementById('uploadStatus');
+ progress.classList.remove('hidden');
+ try {
+ const scan_output = await fetch('/documents/scan', {
+ method: 'GET',
+ });
+ statusText.textContent = scan_output.data;
+ } catch (error) {
+ console.error('Upload error:', error);
+ }
+ progress.classList.add('hidden');
+ });
updateIndexedFiles();
},