4
4
</a >
5
5
</p >
6
6
7
- <h1 align =" center " >@akarui /aoi.panel</h1 >
7
+ <h1 align =" center " >@aoijs /aoi.panel</h1 >
8
8
9
9
![ npm] ( https://img.shields.io/npm/dt/@akarui/aoi.panel?color=blue&label=NPM%20Downloads&logo=npm&logoColor=Green )
10
10
![ GitHub] ( https://img.shields.io/github/license/AkaruiDevelopment/panel?color=blue&logo=github )
19
19
20
20
- [ Installation] ( #installation )
21
21
- [ Setup] ( #setup )
22
- - [ Adding Multiple Users] ( #adding-multiple-users )
23
- - [ Making Custom Pages] ( #making-custom-pages )
24
22
25
23
### Installation
26
24
27
25
``` bash
28
- npm i @akarui /aoi.panel
26
+ npm i @aoijs /aoi.panel
29
27
```
30
28
29
+ ![ Login Page] ( ./images/image.png )
31
30
### Setup
32
31
33
32
``` javascript
34
- const {Panel } = require (" @akarui /aoi.panel" )
33
+ const {Panel } = require (" @aoijs /aoi.panel" )
35
34
const {AoiClient } = require (" aoi.js" );
36
35
37
36
const client = new AoiClient ({
@@ -48,39 +47,57 @@ const client = new AoiClient({
48
47
}
49
48
});
50
49
50
+ // Ping Command
51
+ client .command ({
52
+ name: " ping" ,
53
+ code: ` Pong! $pingms`
54
+ });
51
55
52
56
client .loadCommands (" ./commands/" , true );
53
57
58
+
54
59
const panel = new Panel ({
55
- port: 3000 ,
56
- client: client
60
+ port: 3000 ,// port
61
+ client: bot,// aoi.js client
62
+ accounts : " /panel.userconfig.js" // accounts file (for security reasons must be a separate file)
57
63
})
58
64
59
- panel .loadAPI ({
60
- auth: " Authentication-Key" // No spaces, keep it only alphanumeric.
61
- })
65
+ panel .loadPanel ();
62
66
63
- panel .loadGUI ({
64
- username: [" username 1" ],
65
- password: [" Password 1" ],
66
- })
67
67
```
68
68
69
- ### Adding Multiple Users
70
-
71
- ``` javascript
72
- panel .loadGUI ({
73
- username: [" username 1" , " username 2" , " username 3" ],
74
- password: [" Password 1" , " Password 2" , " Password 3" ],
75
- })
69
+ #### Example userconfig file for panel:
70
+
71
+ File: ` panel.userconfig.js `
72
+ ``` js
73
+ module .exports = [
74
+ {
75
+ username: " administratorAccount" ,
76
+ password: " adminpassword" ,
77
+ perms: [" admin" ]
78
+ }, {
79
+ username: " user" ,
80
+ password: " user" ,
81
+ perms: [ " startup" ]
82
+ }
83
+ ]
76
84
```
85
+ ##### Panel Main Page
86
+ ![ Panel Main Page] ( ./images/image2.png )
87
+ ##### Panel Code Editor
88
+ ![ code editor] ( ./images/image3.png )
89
+ ##### Panel Terminal
90
+ ![ terminal] ( ./images/image4.png )
91
+ ##### Panel Code evaluate
92
+ ![ eval1] ( ./images/image6.png )
93
+ ![ eval2] ( ./images/image5.png )
77
94
78
- ### Making Custom Pages
79
95
96
+ ### Making Custom Pages
97
+ Panel uses the express.js framework. So all resources of express can be used while making custom pages e.t.c.
80
98
``` javascript
81
99
const app = panel .app ;
82
100
app .get (" /example" , (req , res ) => {
83
101
res .send (" This is an example page." );
84
102
})
85
103
```
86
-
0 commit comments