mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 13:53:45 +02:00
Switch file manager listing to use panel API endpoint
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user