Files
client_panel/app/components/Pterodactyl/helpers.tsx
2024-08-31 23:41:42 +00:00

33 lines
850 B
TypeScript

export default function helpers(pterodactyl: any) {
return {
// helper what return auth header
async authHeader() {
return {
Authorization: `Bearer ${pterodactyl.api_key}`,
"Content-Type": "application/json",
Accept: "Application/vnd.pterodactyl.v1+json",
};
},
// setter for api key
async setApiKey(apiKey: string) {
return (pterodactyl.api_key = apiKey);
},
// setter for server id
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;
},
};
}