From 7733cb37378363c4d23b4fc9537a6999b8127f20 Mon Sep 17 00:00:00 2001
From: Chris Wanstrath <2+defunkt@users.noreply.github.com>
Date: Thu, 19 Jun 2025 23:06:11 -0700
Subject: [PATCH] uploads
---
packages/attache/.gitignore | 3 +
packages/attache/src/server.tsx | 140 +++++++++++++++++++++++++++++++-
2 files changed, 141 insertions(+), 2 deletions(-)
diff --git a/packages/attache/.gitignore b/packages/attache/.gitignore
index a14702c..b3526ad 100644
--- a/packages/attache/.gitignore
+++ b/packages/attache/.gitignore
@@ -1,3 +1,6 @@
+# DATA!
+projects/
+
# dependencies (bun install)
node_modules
diff --git a/packages/attache/src/server.tsx b/packages/attache/src/server.tsx
index a1fff73..a107017 100644
--- a/packages/attache/src/server.tsx
+++ b/packages/attache/src/server.tsx
@@ -240,6 +240,15 @@ const Project = ({ project, files }: { project: Project, files: string[] }) => {
Files
+
{files.map(file => (
-
@@ -289,6 +298,27 @@ const Project = ({ project, files }: { project: Project, files: string[] }) => {
method: 'DELETE'
}).then(() => location.href = '/projects')
}
+
+ function showProgress(file) {
+ const progress = document.getElementById("upload-progress")
+ const filename = document.getElementById("upload-filename")
+ const percent = document.getElementById("upload-percent")
+ const bar = document.getElementById("upload-bar")
+
+ progress.classList.remove("hidden")
+ filename.textContent = file.name
+ percent.textContent = "0%"
+ bar.style.width = "0%"
+ }
+
+ function updateProgress(percent) {
+ document.getElementById("upload-percent").textContent = percent + "%"
+ document.getElementById("upload-bar").style.width = percent + "%"
+ }
+
+ function hideProgress() {
+ document.getElementById("upload-progress").classList.add("hidden")
+ }
`}
@@ -343,8 +373,30 @@ const Layout = ({ children, title }: { children: any, title: string }) => {
{title} - 💼 Attaché
+
-
+