aigems commited on
Commit
518a557
Β·
1 Parent(s): b853198
Files changed (2) hide show
  1. public/js/main.js +1 -0
  2. 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
- 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) {
 
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) {