From 0ca71b2a5054f3bec8a22cd7d5d828660c1ed4a6 Mon Sep 17 00:00:00 2001 From: lantxx Date: Sun, 3 May 2026 16:08:19 +0800 Subject: [PATCH 1/5] update local data --- _worker.js | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 3 deletions(-) diff --git a/_worker.js b/_worker.js index cf72fc9..0572bad 100644 --- a/_worker.js +++ b/_worker.js @@ -92,9 +92,9 @@ function inputHtml() { @@ -124,7 +157,63 @@ input:focus {border-color:#3b82f6;} + @@ -314,7 +404,7 @@ input[type="range"]::-webkit-slider-thumb { - +
@@ -442,9 +532,29 @@ async function loadInfo(){ } } +function saveToHistory(fileName, fileSize) { + let list = []; + try { list = JSON.parse(localStorage.getItem('edgecache_history') || '[]'); } + catch {} + list.unshift({ + encodedKey: "${encodedKey}", + fileName: fileName, + fileSize: fileSize, + shareUrl: shareUrl, + uploadTime: Date.now() + }); + if (list.length > 20) list = list.slice(0, 20); + localStorage.setItem('edgecache_history', JSON.stringify(list)); +} + +let lastUploadedName = ''; +let lastUploadedSize = 0; + document.getElementById('file').addEventListener('change', async (e) => { const f = e.target.files[0]; if(!f) return; + lastUploadedName = f.name; + lastUploadedSize = f.size; const fd = new FormData(); fd.append('file', f); fd.append('ttl', currentTtl); @@ -455,6 +565,7 @@ document.getElementById('file').addEventListener('change', async (e) => { document.getElementById('status').innerText = text; }else{ document.getElementById('status').innerText = ''; + saveToHistory(lastUploadedName, lastUploadedSize); loadInfo(); } }); From 75df5ca069f5995c9ef624b53068930ff533a97a Mon Sep 17 00:00:00 2001 From: lantxx Date: Sun, 3 May 2026 16:21:35 +0800 Subject: [PATCH 2/5] =?UTF-8?q?update=20=E9=89=B4=E6=9D=83=E5=90=8D/?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=EF=BC=8C=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_worker.js b/_worker.js index 0572bad..e0384b0 100644 --- a/_worker.js +++ b/_worker.js @@ -189,7 +189,7 @@ function renderHistory() { container.innerHTML = list.map((item, i) => '
' + '
' + - '
' + escHtml(item.fileName) + '
' + + '
' + escHtml(item.rawKey) + '/' + escHtml(item.fileName) + '
' + '
' + fmtSize(item.fileSize) + ' · ' + fmtDate(item.uploadTime) + '
' + '
' + '' + @@ -538,6 +538,7 @@ function saveToHistory(fileName, fileSize) { catch {} list.unshift({ encodedKey: "${encodedKey}", + rawKey: "${rawKey}", fileName: fileName, fileSize: fileSize, shareUrl: shareUrl, From 97628706ce8c0ba6b9a4e77649c0555470dcafb2 Mon Sep 17 00:00:00 2001 From: lantxx Date: Sun, 3 May 2026 16:49:14 +0800 Subject: [PATCH 3/5] update style --- _worker.js | 470 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 273 insertions(+), 197 deletions(-) diff --git a/_worker.js b/_worker.js index e0384b0..5583d86 100644 --- a/_worker.js +++ b/_worker.js @@ -89,74 +89,145 @@ function inputHtml() { EdgeCache + + + +
+ + EdgeCache +
+

进入专属文件空间

输入自定义标识, 用于鉴权

+ +