mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 22:03:44 +02:00
Fix file and backup downloading to use URL returned by server
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import http from '@/api/http';
|
||||
|
||||
export default (uuid: string, backup: string): Promise<string> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(`/api/client/servers/${uuid}/backups/${backup}/download`)
|
||||
.then(({ data }) => resolve(data.attributes.url))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
9
resources/scripts/api/server/files/getFileDownloadUrl.ts
Normal file
9
resources/scripts/api/server/files/getFileDownloadUrl.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import http from '@/api/http';
|
||||
|
||||
export default (uuid: string, file: string): Promise<string> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(`/api/client/servers/${uuid}/files/download`, { params: { file } })
|
||||
.then(({ data }) => resolve(data.attributes.url))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user