npm

@min98/filemanager-react
TypeScript icon, indicating that this package has built-in type declarations

0.0.28 • Public • Published

Package File Manager

Frontend Package File Manager for

Documentation

Use

import { Client, FileManagerAPI, FileManager } from "@min98/filemanager-react";
const token = LocalStorage.getItem("access_token");
const lang = LocalStorage.getItem("lang");
const client = new Client(
    "http://127.0.0.1:8000/api/v1/fm",
    true,
    token,
    "en"
);
const API = new FileManagerAPI(client);
<FileManager API={API} lang={lang} />
  • can customize the file manager if you not use API follow interface
  • example default file manager for
import { Client } from "./Client";
import { AbstractFileManagerAPI } from "./AbstractFileManagerAPI ";
export class FileManagerAPI extends AbstractFileManagerAPI {
    public client: Client;
    constructor(client: Client) {
        super(client,);
        this.client = client;
    }
    /**
     * api disk
     */
    initialize = (disk: string, path: string = "") => {
        return this.client.createRequest("get", "initialize", {
            params: {
                disk,
                path
            }
        });
    };
    content = (disk: string, path: string = "") => {
        return this.client.createRequest("get", "content", {
            params: {
                disk,
                path
            }
        });
    };
    // Continue method follow AbstractFileManagerAPI
}

Package Sidebar

Install

npm i @min98/filemanager-react

Weekly Downloads

2

Version

0.0.28

License

ISC

Unpacked Size

289 kB

Total Files

6

Last publish

Collaborators

  • min98