Switch file manager listing to use panel API endpoint
This commit is contained in:
parent
e87c5f6657
commit
c80c8564b8
8 changed files with 156 additions and 8 deletions
|
@ -1,7 +1,5 @@
|
|||
import http from '../http';
|
||||
import {filter, isObject} from 'lodash';
|
||||
// @ts-ignore
|
||||
import route from '../../../../../vendor/tightenco/ziggy/src/js/route';
|
||||
import {DirectoryContentObject, DirectoryContents} from "./types";
|
||||
|
||||
/**
|
||||
|
@ -9,7 +7,9 @@ import {DirectoryContentObject, DirectoryContents} from "./types";
|
|||
*/
|
||||
export function getDirectoryContents(server: string, directory: string): Promise<DirectoryContents> {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(route('server.files', {server, directory}))
|
||||
http.get(`/api/client/servers/${server}/files/list`, {
|
||||
params: {directory}
|
||||
})
|
||||
.then((response) => {
|
||||
return resolve({
|
||||
files: filter(response.data.contents, function (o: DirectoryContentObject) {
|
||||
|
|
|
@ -8,7 +8,7 @@ export type DirectoryContentObject = {
|
|||
name: string,
|
||||
created: string,
|
||||
modified: string,
|
||||
mode: number,
|
||||
mode: string,
|
||||
size: number,
|
||||
directory: boolean,
|
||||
file: boolean,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue