mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 22:03:44 +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) {
|
||||
|
||||
Reference in New Issue
Block a user