diff --git a/README.md b/README.md index c8b5c4b..3f75faf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-

@akarui/aoi.panel

+

@aoijs/aoi.panel

![npm](https://img.shields.io/npm/dt/@akarui/aoi.panel?color=blue&label=NPM%20Downloads&logo=npm&logoColor=Green) ![GitHub](https://img.shields.io/github/license/AkaruiDevelopment/panel?color=blue&logo=github) @@ -19,19 +19,18 @@ - [Installation](#installation) - [Setup](#setup) -- [Adding Multiple Users](#adding-multiple-users) -- [Making Custom Pages](#making-custom-pages) ### Installation ```bash -npm i @akarui/aoi.panel +npm i @aoijs/aoi.panel ``` +![Login Page](./images/image.png) ### Setup ```javascript -const {Panel} = require("@akarui/aoi.panel") +const {Panel} = require("@aoijs/aoi.panel") const {AoiClient} = require("aoi.js"); const client = new AoiClient({ @@ -48,39 +47,57 @@ const client = new AoiClient({ } }); +// Ping Command +client.command({ + name: "ping", + code: `Pong! $pingms` +}); client.loadCommands("./commands/", true); + const panel = new Panel({ - port: 3000, - client: client + port:3000,//port + client:bot,//aoi.js client + accounts : "/panel.userconfig.js" //accounts file (for security reasons must be a separate file) }) -panel.loadAPI({ - auth: "Authentication-Key"//No spaces, keep it only alphanumeric. -}) +panel.loadPanel(); -panel.loadGUI({ - username: ["username 1"], - password: ["Password 1"], -}) ``` -### Adding Multiple Users - -```javascript -panel.loadGUI({ - username: ["username 1", "username 2", "username 3"], - password: ["Password 1", "Password 2", "Password 3"], -}) +#### Example userconfig file for panel: + +File: `panel.userconfig.js` +```js +module.exports = [ + { + username: "administratorAccount", + password: "adminpassword", + perms: ["admin"] + }, { + username: "user", + password: "user", + perms: [ "startup"] + } +] ``` +##### Panel Main Page +![Panel Main Page](./images/image2.png) +##### Panel Code Editor +![code editor](./images/image3.png) +##### Panel Terminal +![terminal](./images/image4.png) +##### Panel Code evaluate +![eval1](./images/image6.png) +![eval2](./images/image5.png) -### Making Custom Pages +### Making Custom Pages +Panel uses the express.js framework. So all resources of express can be used while making custom pages e.t.c. ```javascript const app = panel.app; app.get("/example", (req, res) => { res.send("This is an example page."); }) ``` -