mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-23 16:53:45 +02:00
Add support for renaming files on the fly in the file manager
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios, {AxiosInstance} from 'axios';
|
||||
import axios, {AxiosInstance, AxiosRequestConfig} from 'axios';
|
||||
import {ServerApplicationCredentials} from "@/store/types";
|
||||
|
||||
// This token is set in the bootstrap.js file at the beginning of the request
|
||||
// and is carried through from there.
|
||||
@@ -25,3 +26,15 @@ if (typeof window.phpdebugbar !== 'undefined') {
|
||||
}
|
||||
|
||||
export default http;
|
||||
|
||||
/**
|
||||
* Creates a request object for the node that uses the server UUID and connection
|
||||
* credentials. Basically just a tiny wrapper to set this quickly.
|
||||
*/
|
||||
export function withCredentials(server: string, credentials: ServerApplicationCredentials): AxiosInstance {
|
||||
http.defaults.baseURL = credentials.node;
|
||||
http.defaults.headers['X-Access-Server'] = server;
|
||||
http.defaults.headers['X-Access-Token'] = credentials.key;
|
||||
|
||||
return http;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user