summaryrefslogtreecommitdiff
path: root/frontend/app/drive
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/drive')
-rw-r--r--frontend/app/drive/[...path]/page.tsx10
-rw-r--r--frontend/app/drive/page.tsx10
2 files changed, 19 insertions, 1 deletions
diff --git a/frontend/app/drive/[...path]/page.tsx b/frontend/app/drive/[...path]/page.tsx
index 75a1bb1..60c2cca 100644
--- a/frontend/app/drive/[...path]/page.tsx
+++ b/frontend/app/drive/[...path]/page.tsx
@@ -2,7 +2,8 @@ import { Drive_ls, Drive_basename, Drive_parent } from "@/lib/drive"
2import { formatSize } from "@/lib/utils" 2import { formatSize } from "@/lib/utils"
3import Link from "next/link" 3import Link from "next/link"
4import { cookies } from 'next/headers'; 4import { cookies } from 'next/headers';
5import { Auth_get_user } from "@/lib/auth"; 5import { Auth_get_user, Auth_user_can_upload } from "@/lib/auth";
6import FileUpload from "@/components/FileUpload"
6 7
7interface DrivePageProps { 8interface DrivePageProps {
8 params: Promise<{ 9 params: Promise<{
@@ -130,6 +131,13 @@ export default async function DrivePage({ params }: DrivePageProps) {
130 </table> 131 </table>
131 </div> 132 </div>
132 </div> 133 </div>
134
135 {/* File Upload Component */}
136 {Auth_user_can_upload(user) && (
137 <FileUpload
138 targetPath={fullPath}
139 />
140 )}
133 </div> 141 </div>
134 </div> 142 </div>
135 ) 143 )
diff --git a/frontend/app/drive/page.tsx b/frontend/app/drive/page.tsx
index 218774a..5970a6a 100644
--- a/frontend/app/drive/page.tsx
+++ b/frontend/app/drive/page.tsx
@@ -1,8 +1,11 @@
1import { Drive_ls, Drive_basename } from "@/lib/drive" 1import { Drive_ls, Drive_basename } from "@/lib/drive"
2import { formatSize } from "@/lib/utils" 2import { formatSize } from "@/lib/utils"
3import { Auth_get_user, Auth_user_can_upload } from "@/lib/auth"
3import Link from "next/link" 4import Link from "next/link"
5import FileUpload from "@/components/FileUpload"
4 6
5export default async function DrivePage() { 7export default async function DrivePage() {
8 const user = await Auth_get_user()
6 const entries = await Drive_ls("", false) 9 const entries = await Drive_ls("", false)
7 10
8 // Sort entries: directories first, then files, both alphabetically 11 // Sort entries: directories first, then files, both alphabetically
@@ -88,6 +91,13 @@ export default async function DrivePage() {
88 </table> 91 </table>
89 </div> 92 </div>
90 </div> 93 </div>
94
95 {/* File Upload Component */}
96 {Auth_user_can_upload(user) && (
97 <FileUpload
98 targetPath=""
99 />
100 )}
91 </div> 101 </div>
92 </div> 102 </div>
93 ) 103 )