mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Add support for file copy and deletion
This commit is contained in:
13
resources/assets/scripts/api/server/files/copyFile.ts
Normal file
13
resources/assets/scripts/api/server/files/copyFile.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import http from "@/api/http";
|
||||
|
||||
/**
|
||||
* Creates a copy of the given file or directory on the Daemon. Expects a fully resolved path
|
||||
* to be passed through for both data arguments.
|
||||
*/
|
||||
export function copyFile(server: string, location: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(`/api/client/servers/${server}/files/copy`, {location})
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user