diff --git a/app/components/BreadCrumbs/index.tsx b/app/components/BreadCrumbs/index.tsx index aa633b4..bee0053 100644 --- a/app/components/BreadCrumbs/index.tsx +++ b/app/components/BreadCrumbs/index.tsx @@ -10,7 +10,11 @@ interface Props { const BreadCrumbs = ({ children }: Props) => { const { serverid, path } = useParams(); - return
{children}
; + return ( +
+ +
+ ); }; export default BreadCrumbs; diff --git a/app/components/FilesEditor/BreadCrumbs/index.tsx b/app/components/FilesEditor/BreadCrumbs/index.tsx index 5f2cc33..556043e 100644 --- a/app/components/FilesEditor/BreadCrumbs/index.tsx +++ b/app/components/FilesEditor/BreadCrumbs/index.tsx @@ -50,6 +50,7 @@ const index = ({ serverId, path, changeDirectory }: Props) => { ); })} +
  • { await setCredentials(); if (apiKey && serverId) { const pteroInstance = new Pterodactyl(serverId, apiKey); - if (!pathParam) { - pteroInstance.helpers.setWorkingDirectory(path); - } else { - pteroInstance.helpers.setWorkingDirectory(pathParam); + if (pathParam) { + setPath(pathParam); } + pteroInstance.helpers.setWorkingDirectory(path); setPtero(pteroInstance); await fetchFiles(pteroInstance); } @@ -153,15 +153,64 @@ const Index = () => { {serverId && (
    - + +
  • +
    + +
    + {serverId} +
  • +
  • + +
    + +
    + / +
    +
  • + {path + .split("/") + .filter((p) => p !== "") + .map((element, index) => { + const tmp_path = path + .split("/") + .slice(0, index + 2) + .join("/"); + return ( +
  • + +
    + +
    + {element} +
    +
  • + ); + })} +
  • + + + + + Add Document + +
  • + )} {serverId && + fileList && fileList.map((file: FileProps) => (
    {
    {file.attributes.is_file ? ( - + {file.attributes.name} - + ) : ( - changeDirectory(`${path}/${file.attributes.name}`) - } + href={`/files?serverid=${serverId}&path=${ + path != "/" ? path : "" + }/${file.attributes.name}`} > {file.attributes.name}