added breadcrumbs
This commit is contained in:
@@ -12,7 +12,7 @@ export default function files(pterodactyl: any) {
|
||||
method: "PUT",
|
||||
headers: await pterodactyl.helpers.authHeader(),
|
||||
body: JSON.stringify({
|
||||
root: "/",
|
||||
root: pterodactyl.workingDirectory,
|
||||
files: [
|
||||
{
|
||||
from: from.attributes.name,
|
||||
@@ -34,7 +34,7 @@ export default function files(pterodactyl: any) {
|
||||
async fetchFiles() {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_URL}/api/client/servers/${pterodactyl.server_id}/files/list`,
|
||||
`${process.env.NEXT_PUBLIC_URL}/api/client/servers/${pterodactyl.server_id}/files/list?directory=${pterodactyl.workingDirectory}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: await pterodactyl.helpers.authHeader(),
|
||||
|
||||
@@ -18,5 +18,15 @@ export default function helpers(pterodactyl: any) {
|
||||
async setServerID(serverID: string) {
|
||||
return (pterodactyl.server_id = serverID);
|
||||
},
|
||||
|
||||
// setter for working directory
|
||||
async setWorkingDirectory(workingDirectory: string) {
|
||||
return (pterodactyl.workingDirectory = workingDirectory);
|
||||
},
|
||||
|
||||
// getter for working directory
|
||||
async getWorkingDirectory() {
|
||||
return pterodactyl.workingDirectory;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ class Pterodactyl {
|
||||
api_key: string;
|
||||
files: any;
|
||||
helpers: any;
|
||||
workingDirectory: string = "/";
|
||||
|
||||
constructor(server_id: string, api_key: string) {
|
||||
this.server_id = server_id;
|
||||
|
||||
Reference in New Issue
Block a user