ok
Browse files- public/js/main.js +1 -0
- routes/command.js +4 -4
public/js/main.js
CHANGED
@@ -82,6 +82,7 @@ async function loadCommandHistory() {
|
|
82 |
li.textContent = `${filterXSS(item.command)} (${new Date(item.timestamp).toLocaleString()})`;
|
83 |
li.className = 'cursor-pointer hover:text-blue-500';
|
84 |
li.onclick = () => {
|
|
|
85 |
commandInput.value = item.command;
|
86 |
};
|
87 |
history.appendChild(li);
|
|
|
82 |
li.textContent = `${filterXSS(item.command)} (${new Date(item.timestamp).toLocaleString()})`;
|
83 |
li.className = 'cursor-pointer hover:text-blue-500';
|
84 |
li.onclick = () => {
|
85 |
+
console.log(`Clicked on command: ${item.command}`); // ζ·»ε θ°θ―δΏ‘ζ―
|
86 |
commandInput.value = item.command;
|
87 |
};
|
88 |
history.appendChild(li);
|
routes/command.js
CHANGED
@@ -33,10 +33,10 @@ router.post('/execute', async (req, res) => {
|
|
33 |
const baseCommand = command.split(' ')[0];
|
34 |
|
35 |
// η½εεζ£ζ₯ηι¨ε
|
36 |
-
if (!allowedCommands.includes(baseCommand)) {
|
37 |
-
|
38 |
-
|
39 |
-
}
|
40 |
|
41 |
execFile(baseCommand, command.split(' ').slice(1), { timeout: 5000 }, async (error, stdout, stderr) => {
|
42 |
if (error) {
|
|
|
33 |
const baseCommand = command.split(' ')[0];
|
34 |
|
35 |
// η½εεζ£ζ₯ηι¨ε
|
36 |
+
// if (!allowedCommands.includes(baseCommand)) {
|
37 |
+
// logger.warn(`η¨ζ· ${req.user.username} ζͺζζηε½δ»€: ${command}`);
|
38 |
+
// return res.status(403).json({ error: 'ζͺζζε½δ»€' });
|
39 |
+
// }
|
40 |
|
41 |
execFile(baseCommand, command.split(' ').slice(1), { timeout: 5000 }, async (error, stdout, stderr) => {
|
42 |
if (error) {
|