devcode-canavar-pro 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/devcode.js +44 -19
- package/lib/Dashboard.js +12 -2
- package/lib/Server.js +1 -1
- package/package.json +1 -1
package/bin/devcode.js
CHANGED
|
@@ -1,43 +1,68 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* DevCode
|
|
5
|
-
* Usage: npx devcode or npm start
|
|
4
|
+
* DevCode MONSTER: PRO CLI Launcher
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
|
-
const DevCode = require('../
|
|
7
|
+
const DevCode = require('../index'); // index.js'ten Server ve Core'u alıyoruz
|
|
9
8
|
const path = require('path');
|
|
10
9
|
|
|
11
|
-
const
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const command = args[0] || 'shell';
|
|
12
12
|
|
|
13
13
|
process.on('uncaughtException', (err) => {
|
|
14
|
-
console.error('\n❌
|
|
14
|
+
console.error('\n❌ Hata:', err.message);
|
|
15
15
|
process.exit(1);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
console.error('\n❌ İşlenmemiş Reddetme (Promise):', reason);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
async function launch() {
|
|
23
|
-
console.log(`
|
|
18
|
+
console.log(`
|
|
24
19
|
\x1b[36m██████╗ ███████╗██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
25
20
|
██╔══██╗██╔════╝██║ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝
|
|
26
21
|
██║ ██║█████╗ ██║ ██║██║ ██║ ██║██║ ██║█████╗
|
|
27
22
|
██║ ██║██╔══╝ ╚██╗ ██╔╝██║ ██║ ██║██║ ██║██╔══╝
|
|
28
23
|
██████╔╝███████╗ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗
|
|
29
24
|
╚═════╝ ╚══════╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\x1b[0m
|
|
30
|
-
\x1b[32m---
|
|
25
|
+
\x1b[32m--- ELITE MONSTER PRO v3.3.2 ---\x1b[0m
|
|
31
26
|
`);
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
function getParam(name) {
|
|
29
|
+
const idx = args.indexOf(`--${name}`);
|
|
30
|
+
return idx > -1 ? args[idx + 1] : null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const db = new DevCode.Core();
|
|
34
|
+
const server = new DevCode.Server(db);
|
|
35
|
+
|
|
36
|
+
async function start() {
|
|
37
|
+
switch (command) {
|
|
38
|
+
case 'server':
|
|
39
|
+
const port = getParam('port') || 4242;
|
|
40
|
+
const secret = getParam('secret');
|
|
41
|
+
const dPort = getParam('dashboard-port') || 3000;
|
|
42
|
+
|
|
43
|
+
console.log(`🚀 \x1b[1mVeri Merkezi Başlatılıyor...\x1b[0m`);
|
|
44
|
+
server.startServer(port);
|
|
45
|
+
if (secret) server.secret = secret;
|
|
46
|
+
|
|
47
|
+
console.log(`📡 \x1b[1mYönetim Paneli Açılıyor...\x1b[0m Port: ${dPort}`);
|
|
48
|
+
db.startDashboard(dPort);
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
case 'dashboard':
|
|
52
|
+
dPort = getParam('port') || 3000;
|
|
53
|
+
console.log(`📡 \x1b[1mGörsel Panel Hazırlanıyor...\x1b[0m Port: ${dPort}`);
|
|
54
|
+
db.startDashboard(dPort);
|
|
55
|
+
break;
|
|
35
56
|
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
case 'shell':
|
|
58
|
+
default:
|
|
59
|
+
console.log(`🐚 \x1b[1mİnteraktif Shell Başlatılıyor...\x1b[0m`);
|
|
60
|
+
db.startShell();
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
38
63
|
}
|
|
39
64
|
|
|
40
|
-
|
|
41
|
-
console.error('
|
|
65
|
+
start().catch(err => {
|
|
66
|
+
console.error('Başlatma Hatası:', err);
|
|
42
67
|
process.exit(1);
|
|
43
68
|
});
|
package/lib/Dashboard.js
CHANGED
|
@@ -108,8 +108,18 @@ class Dashboard {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
this.server.
|
|
112
|
-
|
|
111
|
+
this.server.on('error', (err) => {
|
|
112
|
+
if (err.code === 'EADDRINUSE') {
|
|
113
|
+
console.log(`\x1b[33m[DevCode Dashboard]\x1b[0m Port ${this.port} dolu, ${this.port + 1} deneniyor...`);
|
|
114
|
+
this.port++;
|
|
115
|
+
this.server.listen(this.port, '0.0.0.0');
|
|
116
|
+
} else {
|
|
117
|
+
console.error(`\x1b[31m[DevCode Dashboard] Sunucu Hatası:\x1b[0m`, err);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
this.server.listen(this.port, '0.0.0.0', () => {
|
|
122
|
+
console.log(`\x1b[32m[DevCode Dashboard]\x1b[0m Panel aktif → \x1b[36mhttp://0.0.0.0:${this.port}\x1b[0m`);
|
|
113
123
|
});
|
|
114
124
|
}
|
|
115
125
|
|
package/lib/Server.js
CHANGED
|
@@ -104,7 +104,7 @@ class Server {
|
|
|
104
104
|
// Özel route: GET /ping — bağlantı testi
|
|
105
105
|
if (parts[0] === 'ping') {
|
|
106
106
|
res.writeHead(200);
|
|
107
|
-
return res.end(JSON.stringify({ ok: true, message: 'pong', version: '
|
|
107
|
+
return res.end(JSON.stringify({ ok: true, message: 'pong', version: '3.3.0' }));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// Özel route: GET /databases — veritabanı listesi
|
package/package.json
CHANGED