aionix 1.0.10 โ 1.1.0
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/aionix.cmd +0 -1
- package/bin/index.js +130 -68
- package/bin/install.js +110 -50
- package/client/index.html +1248 -1575
- package/lib/index.js +13 -0
- package/package.json +3 -4
- package/server/app.js +34 -22
- package/server/routes/ai.js +102 -0
- package/db/habits.db +0 -1
- package/db/quiz.db +0 -5
- package/db/snippets.db +0 -0
package/bin/aionix.cmd
CHANGED
package/bin/index.js
CHANGED
|
@@ -1,91 +1,153 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const chalk = require('chalk');
|
|
5
|
-
const
|
|
5
|
+
const net = require('net');
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const os = require('os');
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
12
|
-
|
|
13
|
-
console.log(chalk.cyan.bold(`
|
|
14
|
-
+==============================+
|
|
15
|
-
| ๐ AIONIX |
|
|
16
|
-
| Offline Developer Toolkit |
|
|
17
|
-
+==============================+
|
|
18
|
-
`));
|
|
19
|
-
|
|
20
|
-
console.log(chalk.green('โ
AIONIX successfully installed!\n'));
|
|
10
|
+
const CONFIG_FILE = path.join(os.homedir(), '.aionix', 'config.json');
|
|
21
11
|
|
|
22
|
-
let config = {};
|
|
12
|
+
let config = { name: 'Developer', port: 3000, autoOpen: true };
|
|
23
13
|
try {
|
|
24
14
|
if (fs.existsSync(CONFIG_FILE)) {
|
|
25
15
|
config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
26
16
|
}
|
|
27
17
|
} catch(e) {}
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
20
|
+
// NEON ASCII BANNER
|
|
21
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
22
|
+
function showBanner() {
|
|
23
|
+
console.clear();
|
|
24
|
+
console.log(chalk.hex('#00ff9f').bold(`
|
|
25
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
26
|
+
โ โ
|
|
27
|
+
โ โโโโโโโ โโโ โโโโโโโ โโโโ โโโโโโโโโ โโโ โ
|
|
28
|
+
โ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
|
|
29
|
+
โ โโโโโโโโโโโโโโ โโโโโโโโโ โโโโโโ โโโโโโ โ
|
|
30
|
+
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโ โ
|
|
31
|
+
โ โโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโ โ
|
|
32
|
+
โ โโโ โโโโโโ โโโโโโโ โโโ โโโโโโโโโโโ โโโ โ
|
|
33
|
+
โ โ
|
|
34
|
+
โ OFFLINE DEVELOPER TOOLKIT โ
|
|
35
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
36
|
+
|
|
37
|
+
console.log(chalk.hex('#00ff9f')(` โ${'โ'.repeat(50)}โ`));
|
|
38
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#ffffff')(` ๐พ Welcome back, `) + chalk.hex('#ffff00').bold(`${config.name}`.padEnd(29)) + chalk.hex('#00ff9f')(`โ`));
|
|
39
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#888888')(` v1.2.0 ยท AI Chat ยท Image Gen ยท Tools `) + chalk.hex('#00ff9f')(` โ`));
|
|
40
|
+
console.log(chalk.hex('#00ff9f')(` โ${'โ'.repeat(50)}โ`));
|
|
41
|
+
console.log();
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
45
|
+
// ASCII LOADING BAR
|
|
46
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
47
|
+
function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
|
|
48
|
+
|
|
49
|
+
async function loadingBar(label, duration = 800) {
|
|
50
|
+
const width = 30;
|
|
51
|
+
process.stdout.write(` ${chalk.hex('#888888')(label.padEnd(20))} [`);
|
|
52
|
+
for (let i = 0; i <= width; i++) {
|
|
53
|
+
const filled = chalk.hex('#00ff9f')('โ'.repeat(i));
|
|
54
|
+
const empty = chalk.hex('#333333')('โ'.repeat(width - i));
|
|
55
|
+
const pct = Math.round((i / width) * 100);
|
|
56
|
+
process.stdout.write(`\r ${chalk.hex('#888888')(label.padEnd(20))} [${filled}${empty}] ${chalk.hex('#ffff00')(pct + '%')}`);
|
|
57
|
+
await sleep(duration / width);
|
|
58
|
+
}
|
|
59
|
+
process.stdout.write(`\r ${chalk.hex('#00ff9f')(label.padEnd(20))} [${'โ'.repeat(width)}] ${chalk.hex('#00ff9f')('DONE โ')}\n`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
63
|
+
// SPINNER
|
|
64
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
65
|
+
function spinner(label) {
|
|
66
|
+
const frames = ['โ ','โ ','โ น','โ ธ','โ ผ','โ ด','โ ฆ','โ ง','โ ','โ '];
|
|
67
|
+
let i = 0;
|
|
68
|
+
const id = setInterval(() => {
|
|
69
|
+
process.stdout.write(`\r ${chalk.hex('#00ff9f')(frames[i])} ${chalk.hex('#888888')(label)}`);
|
|
70
|
+
i = (i + 1) % frames.length;
|
|
71
|
+
}, 80);
|
|
72
|
+
return () => {
|
|
73
|
+
clearInterval(id);
|
|
74
|
+
process.stdout.write(`\r ${chalk.hex('#00ff9f')('โ')} ${chalk.hex('#ffffff')(label)}\n`);
|
|
53
75
|
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
79
|
+
// PORT CHECK
|
|
80
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
81
|
+
async function checkPort(port) {
|
|
82
|
+
return new Promise((resolve) => {
|
|
83
|
+
const s = net.createServer();
|
|
84
|
+
s.listen(port, () => { s.close(() => resolve(false)); });
|
|
85
|
+
s.on('error', () => resolve(true));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
54
88
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
console.log(chalk.
|
|
59
|
-
console.log(chalk.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
89
|
+
async function showPortTable(preferredPort) {
|
|
90
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
91
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#ffff00').bold(` ๐ก PORT STATUS MONITOR `) + chalk.hex('#00ff9f')(`โ`));
|
|
92
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโค`));
|
|
93
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#888888')(` PORT `) + chalk.hex('#00ff9f')(`โ`) + chalk.hex('#888888')(` STATUS `) + chalk.hex('#00ff9f')(`โ`));
|
|
94
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโค`));
|
|
95
|
+
|
|
96
|
+
const ports = [preferredPort, preferredPort+1, preferredPort+2, preferredPort+3];
|
|
97
|
+
for (const p of ports) {
|
|
98
|
+
const inUse = await checkPort(p);
|
|
99
|
+
const portStr = String(p).padEnd(6);
|
|
100
|
+
const status = inUse
|
|
101
|
+
? chalk.hex('#ff4444')('โ IN USE ')
|
|
102
|
+
: chalk.hex('#00ff9f')('โ FREE ');
|
|
103
|
+
const star = p === preferredPort ? chalk.hex('#ffff00')(' โ') : ' ';
|
|
104
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + ` ${chalk.hex('#ffffff')(portStr)}` + chalk.hex('#00ff9f')(`โ`) + ` ${status}` + chalk.hex('#00ff9f')(`โ`) + star);
|
|
70
105
|
}
|
|
106
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ`));
|
|
107
|
+
console.log();
|
|
108
|
+
}
|
|
71
109
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
require('../server/app');
|
|
83
|
-
} else {
|
|
84
|
-
console.log(chalk.cyan('\n๐ Run anytime:'), chalk.white.bold('aionix'));
|
|
85
|
-
console.log(chalk.cyan('โ๏ธ Edit config:'), chalk.white.bold('aionix --config\n'));
|
|
86
|
-
process.exit(0);
|
|
87
|
-
}
|
|
110
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
111
|
+
// --config FLAG
|
|
112
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
113
|
+
if (process.argv.includes('--config')) {
|
|
114
|
+
showBanner();
|
|
115
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
116
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#ffff00').bold(` โ๏ธ CURRENT CONFIG `) + chalk.hex('#00ff9f')(`โ`));
|
|
117
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค`));
|
|
118
|
+
Object.entries(config).forEach(([k, v]) => {
|
|
119
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + ` ${chalk.hex('#888888')(k.padEnd(15))} ${chalk.hex('#ffffff')(String(v).padEnd(20))}` + chalk.hex('#00ff9f')(`โ`));
|
|
88
120
|
});
|
|
121
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
122
|
+
console.log(chalk.hex('#888888')(`\n ๐ ${CONFIG_FILE}\n`));
|
|
123
|
+
process.exit(0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
127
|
+
// MAIN
|
|
128
|
+
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
129
|
+
async function main() {
|
|
130
|
+
showBanner();
|
|
131
|
+
|
|
132
|
+
await loadingBar('Initializing', 400);
|
|
133
|
+
await loadingBar('Loading modules', 300);
|
|
134
|
+
await loadingBar('Checking system', 300);
|
|
135
|
+
console.log();
|
|
136
|
+
|
|
137
|
+
await showPortTable(config.port || 3000);
|
|
138
|
+
|
|
139
|
+
const stopSpin = spinner('Starting AIONIX server...');
|
|
140
|
+
await sleep(600);
|
|
141
|
+
stopSpin();
|
|
142
|
+
|
|
143
|
+
process.env.AIONIX_PORT = config.port || 3000;
|
|
144
|
+
process.env.AIONIX_AUTO_OPEN = config.autoOpen !== false ? 'true' : 'false';
|
|
145
|
+
process.env.AIONIX_NAME = config.name || 'Developer';
|
|
146
|
+
|
|
147
|
+
require('../server/app');
|
|
89
148
|
}
|
|
90
149
|
|
|
91
|
-
|
|
150
|
+
main().catch(e => {
|
|
151
|
+
console.error(chalk.hex('#ff4444')('\n โ Error: ' + e.message));
|
|
152
|
+
process.exit(1);
|
|
153
|
+
});
|
package/bin/install.js
CHANGED
|
@@ -1,89 +1,149 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const chalk = require('chalk');
|
|
5
5
|
const readline = require('readline');
|
|
6
6
|
const fs = require('fs');
|
|
7
|
-
const os = require('os');
|
|
8
7
|
const path = require('path');
|
|
8
|
+
const os = require('os');
|
|
9
9
|
|
|
10
10
|
const CONFIG_DIR = path.join(os.homedir(), '.aionix');
|
|
11
11
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
|
|
14
|
+
|
|
15
|
+
async function typewrite(text, delay = 18) {
|
|
16
|
+
for (const ch of text) {
|
|
17
|
+
process.stdout.write(ch);
|
|
18
|
+
await sleep(delay);
|
|
19
|
+
}
|
|
20
|
+
process.stdout.write('\n');
|
|
21
|
+
}
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
async function showBanner() {
|
|
24
|
+
console.clear();
|
|
25
|
+
const lines = [
|
|
26
|
+
``,
|
|
27
|
+
` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`,
|
|
28
|
+
` โ โโโโโโโ โโโ โโโโโโโ โโโโ โโโโโโโโโ โโโ โ`,
|
|
29
|
+
` โ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ`,
|
|
30
|
+
` โ โโโโโโโโโโโโโโ โโโโโโโโโ โโโโโโ โโโโโโ โ`,
|
|
31
|
+
` โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโ โ`,
|
|
32
|
+
` โ โโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโ โ`,
|
|
33
|
+
` โ โโโ โโโโโโ โโโโโโโ โโโ โโโโโโโโโโโ โโโ โ`,
|
|
34
|
+
` โ โ`,
|
|
35
|
+
` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`,
|
|
36
|
+
``,
|
|
37
|
+
];
|
|
38
|
+
for (const line of lines) {
|
|
39
|
+
console.log(chalk.hex('#00ff9f').bold(line));
|
|
40
|
+
await sleep(40);
|
|
41
|
+
}
|
|
42
|
+
await typewrite(chalk.hex('#ffff00').bold(` ๐ WELCOME TO AIONIX INSTALLER`), 12);
|
|
43
|
+
console.log();
|
|
44
|
+
}
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
async function animatedLine(char = 'โ', width = 52, color = '#00ff9f') {
|
|
47
|
+
process.stdout.write(` `);
|
|
48
|
+
for (let i = 0; i < width; i++) {
|
|
49
|
+
process.stdout.write(chalk.hex(color)(char));
|
|
50
|
+
await sleep(8);
|
|
26
51
|
}
|
|
27
|
-
|
|
52
|
+
process.stdout.write('\n');
|
|
53
|
+
}
|
|
28
54
|
|
|
29
|
-
|
|
30
|
-
function question(q) {
|
|
55
|
+
function question(rl, q) {
|
|
31
56
|
return new Promise(resolve => rl.question(q, resolve));
|
|
32
57
|
}
|
|
33
58
|
|
|
34
59
|
async function setup() {
|
|
35
|
-
|
|
60
|
+
await showBanner();
|
|
61
|
+
await animatedLine('โ');
|
|
62
|
+
|
|
63
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
64
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#ffffff').bold(` โ๏ธ FIRST TIME SETUP `) + chalk.hex('#00ff9f')(`โ`));
|
|
65
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#888888')(` Configure your personal AIONIX environment `) + chalk.hex('#00ff9f')(`โ`));
|
|
66
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
67
|
+
console.log();
|
|
36
68
|
|
|
37
|
-
const
|
|
38
|
-
const port = await question(chalk.white('๐ Preferred port (default 3000): '));
|
|
39
|
-
const alias = await question(chalk.white('โก Custom command alias (default: aionix): '));
|
|
40
|
-
const autoOpen = await question(chalk.white('๐ Auto open browser? (y/n, default y): '));
|
|
69
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
41
70
|
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
71
|
+
const name = await question(rl, chalk.hex('#00ff9f')(` โ `) + chalk.hex('#ffff00')(`๐ค Your name `) + chalk.hex('#888888')(`โบ `));
|
|
72
|
+
const port = await question(rl, chalk.hex('#00ff9f')(` โ `) + chalk.hex('#ffff00')(`๐ Port `) + chalk.hex('#888888')(`โบ [3000] `));
|
|
73
|
+
const alias = await question(rl, chalk.hex('#00ff9f')(` โ `) + chalk.hex('#ffff00')(`โก Custom alias `) + chalk.hex('#888888')(`โบ [aionix] `));
|
|
74
|
+
const autoOpen = await question(rl, chalk.hex('#00ff9f')(` โ `) + chalk.hex('#ffff00')(`๐ Auto-open browser `) + chalk.hex('#888888')(`โบ [Y/n] `));
|
|
75
|
+
rl.close();
|
|
76
|
+
|
|
77
|
+
const finalName = name.trim() || 'Developer';
|
|
78
|
+
const finalPort = parseInt(port.trim()) || 3000;
|
|
79
|
+
const finalAlias = alias.trim() || 'aionix';
|
|
45
80
|
const finalAutoOpen = autoOpen.trim().toLowerCase() !== 'n';
|
|
46
81
|
|
|
47
|
-
config = {
|
|
82
|
+
const config = {
|
|
48
83
|
name: finalName,
|
|
49
|
-
port:
|
|
84
|
+
port: finalPort,
|
|
50
85
|
alias: finalAlias,
|
|
51
86
|
autoOpen: finalAutoOpen,
|
|
52
|
-
installedAt: new Date().toISOString()
|
|
87
|
+
installedAt: new Date().toISOString(),
|
|
88
|
+
version: '1.2.0'
|
|
53
89
|
};
|
|
54
90
|
|
|
55
91
|
if (!fs.existsSync(CONFIG_DIR)) fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
56
92
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
57
93
|
|
|
58
|
-
console.log(
|
|
59
|
-
|
|
94
|
+
console.log();
|
|
95
|
+
await animatedLine('โ');
|
|
96
|
+
|
|
97
|
+
console.log(chalk.hex('#00ff9f').bold(`\n โ Config saved โ ${CONFIG_FILE}\n`));
|
|
98
|
+
|
|
99
|
+
// Show saved config table
|
|
100
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
101
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + chalk.hex('#ffff00').bold(` SETTING `) + chalk.hex('#00ff9f')(`โ`) + chalk.hex('#ffff00').bold(` VALUE `) + chalk.hex('#00ff9f')(`โ`));
|
|
102
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค`));
|
|
103
|
+
const rows = [
|
|
104
|
+
['Name', finalName],
|
|
105
|
+
['Port', finalPort],
|
|
106
|
+
['Alias', finalAlias],
|
|
107
|
+
['Auto-open', finalAutoOpen ? 'Yes' : 'No'],
|
|
108
|
+
];
|
|
109
|
+
rows.forEach(([k, v]) => {
|
|
110
|
+
console.log(chalk.hex('#00ff9f')(` โ`) + ` ${chalk.hex('#888888')(k.padEnd(15))}` + chalk.hex('#00ff9f')(`โ`) + ` ${chalk.hex('#ffffff')(String(v).padEnd(29))}` + chalk.hex('#00ff9f')(`โ`));
|
|
111
|
+
});
|
|
112
|
+
console.log(chalk.hex('#00ff9f')(` โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
60
113
|
|
|
61
114
|
if (finalAlias !== 'aionix') {
|
|
62
|
-
console.log(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
115
|
+
console.log();
|
|
116
|
+
console.log(chalk.hex('#ffff00')(` ๐ก To use "${finalAlias}" command:`));
|
|
117
|
+
const isWin = process.platform === 'win32';
|
|
118
|
+
if (isWin) {
|
|
119
|
+
console.log(chalk.hex('#00ff9f')(` doskey ${finalAlias}=aionix`));
|
|
66
120
|
} else {
|
|
67
|
-
console.log(chalk.
|
|
121
|
+
console.log(chalk.hex('#00ff9f')(` echo "alias ${finalAlias}='aionix'" >> ~/.bashrc && source ~/.bashrc`));
|
|
68
122
|
}
|
|
69
123
|
}
|
|
70
124
|
|
|
71
|
-
|
|
72
|
-
|
|
125
|
+
console.log();
|
|
73
126
|
const rl2 = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
74
|
-
rl2.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
const launch = await question(rl2, chalk.hex('#00ff9f')(` โ `) + chalk.hex('#ffff00')(`๐ Launch AIONIX now?`) + chalk.hex('#888888')(` โบ [Y/n] `));
|
|
128
|
+
rl2.close();
|
|
129
|
+
|
|
130
|
+
if (launch.trim().toLowerCase() !== 'n') {
|
|
131
|
+
console.log();
|
|
132
|
+
process.env.AIONIX_PORT = finalPort;
|
|
133
|
+
process.env.AIONIX_AUTO_OPEN = finalAutoOpen ? 'true' : 'false';
|
|
134
|
+
process.env.AIONIX_NAME = finalName;
|
|
135
|
+
require('../server/app');
|
|
136
|
+
} else {
|
|
137
|
+
console.log();
|
|
138
|
+
console.log(chalk.hex('#00ff9f').bold(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`));
|
|
139
|
+
console.log(chalk.hex('#00ff9f').bold(` โ`) + chalk.hex('#ffffff')(` Run anytime: `) + chalk.hex('#ffff00').bold(`aionix `) + chalk.hex('#00ff9f').bold(`โ`));
|
|
140
|
+
console.log(chalk.hex('#00ff9f').bold(` โ`) + chalk.hex('#ffffff')(` Edit config: `) + chalk.hex('#ffff00').bold(`aionix --config `) + chalk.hex('#00ff9f').bold(`โ`));
|
|
141
|
+
console.log(chalk.hex('#00ff9f').bold(` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ\n`));
|
|
142
|
+
process.exit(0);
|
|
143
|
+
}
|
|
87
144
|
}
|
|
88
145
|
|
|
89
|
-
setup().catch(e => {
|
|
146
|
+
setup().catch(e => {
|
|
147
|
+
console.error(chalk.hex('#ff4444')('\n โ Setup failed: ' + e.message));
|
|
148
|
+
process.exit(1);
|
|
149
|
+
});
|