mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-15 00:26:23 +00:00
Update AppImage
This commit is contained in:
@@ -654,21 +654,33 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
|
|||||||
|
|
||||||
<div className="flex-1 overflow-y-auto space-y-2 pr-2 max-h-[50vh]">
|
<div className="flex-1 overflow-y-auto space-y-2 pr-2 max-h-[50vh]">
|
||||||
{searchResults.length > 0 ? (
|
{searchResults.length > 0 ? (
|
||||||
searchResults.map((result, index) => (
|
<>
|
||||||
<div
|
{searchResults.map((result, index) => (
|
||||||
key={index}
|
<div
|
||||||
onClick={() => sendToActiveTerminal(result.command)}
|
key={index}
|
||||||
className="p-4 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:bg-zinc-800 hover:border-blue-500 transition-colors group"
|
className="p-4 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:border-zinc-600 transition-colors"
|
||||||
>
|
>
|
||||||
<div className="flex items-start justify-between gap-2">
|
{result.description && (
|
||||||
<div className="flex-1 min-w-0">
|
<p className="text-xs text-zinc-400 mb-2 leading-relaxed"># {result.description}</p>
|
||||||
<code className="text-sm text-blue-400 font-mono break-all">{result.command}</code>
|
)}
|
||||||
{result.description && <p className="text-xs text-zinc-400 mt-1">{result.description}</p>}
|
<div
|
||||||
|
onClick={() => sendToActiveTerminal(result.command)}
|
||||||
|
className="flex items-start justify-between gap-2 cursor-pointer group hover:bg-zinc-800/50 rounded p-2 -m-2"
|
||||||
|
>
|
||||||
|
<code className="text-sm text-blue-400 font-mono break-all flex-1">{result.command}</code>
|
||||||
|
<Send className="h-4 w-4 text-zinc-600 group-hover:text-blue-400 flex-shrink-0 mt-0.5 transition-colors" />
|
||||||
</div>
|
</div>
|
||||||
<Send className="h-4 w-4 text-zinc-600 group-hover:text-blue-400 flex-shrink-0 mt-0.5" />
|
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Powered by cheat.sh */}
|
||||||
|
<div className="text-center py-2">
|
||||||
|
<p className="text-xs text-zinc-500">
|
||||||
|
<Lightbulb className="inline-block w-3 h-3 mr-1" />
|
||||||
|
Powered by cheat.sh
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
))
|
</>
|
||||||
) : filteredCommands.length > 0 && !useOnline ? (
|
) : filteredCommands.length > 0 && !useOnline ? (
|
||||||
filteredCommands.map((item, index) => (
|
filteredCommands.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -45,45 +45,37 @@ def search_command():
|
|||||||
response = requests.get(url, headers=headers, timeout=10)
|
response = requests.get(url, headers=headers, timeout=10)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
# Parsear el contenido para extraer ejemplos limpios
|
|
||||||
content = response.text
|
content = response.text
|
||||||
examples = []
|
examples = []
|
||||||
|
current_description = []
|
||||||
|
|
||||||
for line in content.split('\n'):
|
for line in content.split('\n'):
|
||||||
line = line.strip()
|
stripped = line.strip()
|
||||||
|
|
||||||
# Ignorar líneas vacías
|
# Ignorar líneas vacías
|
||||||
if not line:
|
if not stripped:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Si la línea es un comentario que contiene ":"
|
# Si es un comentario
|
||||||
# extraer el comando después de ":"
|
if stripped.startswith('#'):
|
||||||
if line.startswith('#') and ':' in line:
|
# Acumular descripciones
|
||||||
# Buscar el comando después del ":"
|
current_description.append(stripped[1:].strip())
|
||||||
parts = line.split(':', 1)
|
# Si no es comentario, es un comando
|
||||||
if len(parts) == 2:
|
elif stripped and not stripped.startswith('http'):
|
||||||
description = parts[0].replace('#', '').strip()
|
# Unir las descripciones acumuladas
|
||||||
command = parts[1].strip()
|
description = ' '.join(current_description) if current_description else ''
|
||||||
|
|
||||||
if command and not command.startswith('http'):
|
examples.append({
|
||||||
examples.append({
|
'description': description,
|
||||||
'description': description,
|
'command': stripped
|
||||||
'command': command
|
})
|
||||||
})
|
|
||||||
# Si la línea empieza con el nombre del comando (sin #)
|
# Resetear descripciones para el siguiente comando
|
||||||
elif not line.startswith('#'):
|
current_description = []
|
||||||
# Es probablemente un comando directo
|
|
||||||
# Solo agregar si no es una URL
|
|
||||||
if not line.startswith('http') and len(line) > 2:
|
|
||||||
examples.append({
|
|
||||||
'description': '',
|
|
||||||
'command': line
|
|
||||||
})
|
|
||||||
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'success': True,
|
'success': True,
|
||||||
'examples': examples,
|
'examples': examples
|
||||||
'raw_content': content
|
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
Reference in New Issue
Block a user