Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
699cb4d
Merge branch 'main' of https://github.com/aaw3/NextFileManager into s…
liamstamper Oct 8, 2024
2ba4afa
m
liamstamper Oct 8, 2024
0b92d72
new sidebar sections
liamstamper Oct 8, 2024
a58e24c
refactored to handle section logic in homepage
liamstamper Oct 8, 2024
98e968a
idk
liamstamper Oct 8, 2024
6a41654
Merge branch 'fastapi' into sidebar
liamstamper Oct 9, 2024
9e0337b
image styles updated
liamstamper Oct 9, 2024
e81cd4a
Merge branch 'fastapi' into sidebar
liamstamper Oct 9, 2024
b41b96f
added axios
liamstamper Oct 9, 2024
94d3392
added axios connection and started api call
liamstamper Oct 9, 2024
f8ff611
Merge branch 'sidebar' of github.com:aaw3/NextFileManager into sidebar
aaw3 Oct 9, 2024
e69763b
update CORS protocol
aaw3 Oct 9, 2024
6bfcae4
fixed tailiwind error
liamstamper Oct 9, 2024
c1cc34a
updated api call
liamstamper Oct 9, 2024
0d6ae2e
updated name to fileName
liamstamper Oct 9, 2024
01e4015
working api call
liamstamper Oct 9, 2024
a6529f0
updated padding bottom
liamstamper Oct 9, 2024
7d910f0
removed weekday from accessed date
liamstamper Oct 9, 2024
42b811c
changed mime pop to mime_type to match data and made folder size = "-"
liamstamper Oct 9, 2024
f61ac12
added context menu
liamstamper Oct 9, 2024
de9488a
limited suggested files to 10
liamstamper Oct 9, 2024
3b832e9
Merge branch 'fastapi' into sidebar
aaw3 Oct 13, 2024
7197887
Merge fastapi in sidebar
aaw3 Oct 13, 2024
12979a9
fixed fetching uploads error
liamstamper Oct 13, 2024
b5e7295
deleted old imports and comments
liamstamper Oct 13, 2024
e690ccc
rename api call working
liamstamper Oct 14, 2024
b8ec187
added mimetype to props
liamstamper Oct 24, 2024
726671e
delete request working
liamstamper Nov 9, 2024
036eda9
updated rename to check if old path exists instead of if old director…
liamstamper Nov 9, 2024
1a9a1f2
Cleanup (#27)
liamstamper Nov 10, 2024
6b0f48c
Merge branch 'main' into sidebar
liamstamper Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from fastapi import FastAPI, HTTPException, Body, Query, Request, BackgroundTasks
from fastapi.responses import JSONResponse, Response, StreamingResponse
from fastapi import FastAPI, HTTPException, Body, Query
from fastapi.middleware.cors import CORSMiddleware
from typing import Annotated, Optional, List
from pydantic import BaseModel
from pathlib import Path
import shutil
Expand Down Expand Up @@ -284,11 +285,11 @@ async def rename_directory(paths: dict[str, str], verbose: Optional[bool] = Quer
successful_paths = {}
failed_paths = {}

for old_name, new_name in paths.items():
old_directory = secure_path(old_name)
new_directory = secure_path(new_name)
for old_name, new_name in files.items():
old_path = secure_path(old_name)
new_path = secure_path(new_name)

if not old_directory.exists() or not old_directory.is_dir():
if not old_path.exists() or not old_path.exists():
#raise HTTPException(status_code=404, detail="Directory not found")
failed_paths[old_name] = new_name
continue
Expand All @@ -298,7 +299,7 @@ async def rename_directory(paths: dict[str, str], verbose: Optional[bool] = Quer
continue

try:
old_directory.rename(new_directory)
old_path.rename(new_path)
except Exception as e:
#raise HTTPException(status_code=500, detail=str(e))
failed_paths[old_name] = new_name
Expand Down
100 changes: 100 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2"
Expand Down
12 changes: 6 additions & 6 deletions client/src/components/home/BreadCrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const BreadCrumb = () => {
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="m1 9 4-4-4-4"
/>
</svg>
Expand All @@ -55,9 +55,9 @@ const BreadCrumb = () => {
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="m1 9 4-4-4-4"
/>
</svg>
Expand Down
35 changes: 35 additions & 0 deletions client/src/components/home/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react";

interface ConfirmationModalProps {
message: string;
onConfirm: () => void;
onCancel: () => void;
}

const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ message, onConfirm, onCancel }) => {
return (
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50">
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 w-80 text-center">
<h2 className="text-lg text-gray-900 dark:text-white mb-4">
{message}
</h2>
<div className="flex justify-center space-x-4">
<button
onClick={onCancel}
className="px-4 py-2 bg-gray-300 dark:bg-gray-700 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-400 dark:hover:bg-gray-600 focus:outline-none"
>
Cancel
</button>
<button
onClick={onConfirm}
className="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 focus:outline-none"
>
Delete
</button>
</div>
</div>
</div>
);
};

export default ConfirmationModal;
Loading