Show file mode on file listing, add ability to change file mode
This commit is contained in:
parent
8611ebb2d6
commit
ed5613e207
9 changed files with 150 additions and 11 deletions
14
resources/scripts/api/server/files/chmodFiles.ts
Normal file
14
resources/scripts/api/server/files/chmodFiles.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import http from '@/api/http';
|
||||
|
||||
interface Data {
|
||||
file: string;
|
||||
mode: string;
|
||||
}
|
||||
|
||||
export default (uuid: string, directory: string, files: Data[]): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(`/api/client/servers/${uuid}/files/chmod`, { root: directory, files })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
|
@ -5,6 +5,7 @@ export interface FileObject {
|
|||
key: string;
|
||||
name: string;
|
||||
mode: string;
|
||||
modeBits: string,
|
||||
size: number;
|
||||
isFile: boolean;
|
||||
isSymlink: boolean;
|
||||
|
|
|
@ -16,6 +16,7 @@ export const rawDataToFileObject = (data: FractalResponseData): FileObject => ({
|
|||
key: `${data.attributes.is_file ? 'file' : 'dir'}_${data.attributes.name}`,
|
||||
name: data.attributes.name,
|
||||
mode: data.attributes.mode,
|
||||
modeBits: data.attributes.mode_bits,
|
||||
size: Number(data.attributes.size),
|
||||
isFile: data.attributes.is_file,
|
||||
isSymlink: data.attributes.is_symlink,
|
||||
|
|
Reference in a new issue