-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dd32fe
commit 2990ae5
Showing
14 changed files
with
222 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { PropsWithChildren, Suspense } from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
import LocationBreadcrumb from '@/components/navigation/breadcrumbs'; | ||
import { Card } from '@/components/common/cards'; | ||
import { SpinnerWithText } from '@/components/common/spinner'; | ||
import { DetailedErrorBoundary } from '@/components/common/error'; | ||
import MainArea from '../MainArea'; | ||
|
||
const FilesLayout = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<MainArea> | ||
<LocationBreadcrumb /> | ||
<Card> | ||
<Suspense fallback={<SpinnerWithText text='Loading ...' />}> | ||
<DetailedErrorBoundary errorTitle='Unable to load files page'> | ||
{children || <Outlet />} | ||
</DetailedErrorBoundary> | ||
</Suspense> | ||
</Card> | ||
</MainArea> | ||
); | ||
}; | ||
|
||
export default FilesLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { SpinnerWithText } from '@/components/common/spinner'; | ||
import { Suspense, useState } from 'react'; | ||
import { FileAPITable, getTableColumn, SearchBox } from '../components/FileAPITable'; | ||
|
||
export default function FilesPage() { | ||
const [queryParams, setQueryParams] = useState<Record<string, string>>({}); | ||
|
||
return ( | ||
<> | ||
<SearchBox | ||
placeholder='Object key search (support wildcard)' | ||
onSearch={(s) => { | ||
setQueryParams((p) => ({ ...p, key: s })); | ||
}} | ||
/> | ||
|
||
{/* Only show the table if the key filter exist! */} | ||
{!!queryParams?.key && ( | ||
<Suspense fallback={<SpinnerWithText className='mt-4' text='Fetching related files ...' />}> | ||
<FileAPITable | ||
additionalQueryParam={queryParams} | ||
tableColumn={getTableColumn({ isHideKeyPrefix: false })} | ||
/> | ||
</Suspense> | ||
)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { lazy } from 'react'; | ||
import { RouteObject } from 'react-router-dom'; | ||
import FilesLayout from '@/components/layouts/files/FilesLayout'; | ||
|
||
const FilesPage = lazy(() => import('@/modules/files/pages/files')); | ||
|
||
export const Router: RouteObject = { | ||
path: 'files', | ||
element: ( | ||
<FilesLayout> | ||
<FilesPage /> | ||
</FilesLayout> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.