Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bumblebee-3 authored Jun 14, 2024
1 parent 0d42d30 commit 2db1ac2
Showing 1 changed file with 40 additions and 23 deletions.
63 changes: 40 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</a>
</p>

<h1 align="center">@akarui/aoi.panel</h1>
<h1 align="center">@aoijs/aoi.panel</h1>

![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)
Expand All @@ -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({
Expand All @@ -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.");
})
```

0 comments on commit 2db1ac2

Please sign in to comment.