chore empty bucket tip

This commit is contained in:
oiov
2025-07-17 10:15:23 +08:00
parent 8aa0609c95
commit 0a128254d3
4 changed files with 22 additions and 25 deletions
@@ -33,12 +33,6 @@ export async function GET(req: NextRequest) {
}))
.filter((c) => c.buckets.length > 0);
if (processedList.length === 0) {
return NextResponse.json("No buckets found", {
status: 404,
});
}
return NextResponse.json(processedList);
} catch (error) {
console.error("[Error]", error);
+2 -2
View File
@@ -357,10 +357,10 @@ export default function UserFileList({
<ClickableTooltip
className="cursor-pointer truncate"
content={
<>
<div className="p-2">
<p>{file.user.name}</p>
<p>{file.user.email}</p>
</>
</div>
}
>
{file.user.name ?? file.user.email}
+19 -16
View File
@@ -288,7 +288,7 @@ export default function UserFileManager({ user, action }: FileListProps) {
<SelectValue placeholder="Select a bucket" />
</SelectTrigger>
<SelectContent>
{s3Configs.map((provider) => (
{s3Configs.map((provider, index) => (
<SelectGroup>
<SelectLabel>{provider.provider_name}</SelectLabel>
{provider.buckets?.map((item) => (
@@ -299,7 +299,7 @@ export default function UserFileManager({ user, action }: FileListProps) {
{item.bucket}
</SelectItem>
))}
<SelectSeparator />
{index !== s3Configs.length - 1 && <SelectSeparator />}
</SelectGroup>
))}
</SelectContent>
@@ -415,25 +415,28 @@ export default function UserFileManager({ user, action }: FileListProps) {
</EmptyPlaceholder>
)}
{!isLoading && !error && !s3Configs && !currentBucketInfo && (
<EmptyPlaceholder className="col-span-full mt-8 shadow-none">
<EmptyPlaceholder.Icon name="storage" />
<EmptyPlaceholder.Title>
{t("No buckets found")}
</EmptyPlaceholder.Title>
<EmptyPlaceholder.Description>
{t(
"The administrator has not configured the storage bucket, no file can be uploaded",
)}
</EmptyPlaceholder.Description>
</EmptyPlaceholder>
)}
{!isLoading &&
!error &&
!s3Configs?.length &&
!currentBucketInfo.bucket && (
<EmptyPlaceholder className="col-span-full mt-8 shadow-none">
<EmptyPlaceholder.Icon name="storage" />
<EmptyPlaceholder.Title>
{t("No buckets found")}
</EmptyPlaceholder.Title>
<EmptyPlaceholder.Description>
{t(
"The administrator has not configured the storage bucket, no file can be uploaded",
)}
</EmptyPlaceholder.Description>
</EmptyPlaceholder>
)}
{!isLoading &&
!error &&
s3Configs &&
s3Configs.length > 0 &&
currentBucketInfo && (
currentBucketInfo.bucket && (
<UserFileList
user={user}
files={files}
+1 -1
View File
File diff suppressed because one or more lines are too long