Add support for renaming files on the fly in the file manager

This commit is contained in:
Dane Everitt 2019-02-18 20:41:58 -08:00
parent 52115b5c77
commit ff820f30ad
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 230 additions and 37 deletions

View file

@ -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;
}