From ae62196dffc3e0d185ee005841d6c09587cbec8e Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 9 Nov 2025 20:52:39 +0100 Subject: [PATCH] Update AppImage --- AppImage/components/settings.tsx | 75 ++++++++++++++++++---- AppImage/scripts/build_appimage.sh | 1 + AppImage/scripts/flask_proxmenux_routes.py | 75 ++++++++++++++++++++++ AppImage/scripts/flask_server.py | 2 + 4 files changed, 140 insertions(+), 13 deletions(-) create mode 100644 AppImage/scripts/flask_proxmenux_routes.py diff --git a/AppImage/components/settings.tsx b/AppImage/components/settings.tsx index d098851..3cc86ce 100644 --- a/AppImage/components/settings.tsx +++ b/AppImage/components/settings.tsx @@ -5,10 +5,16 @@ import { Button } from "./ui/button" import { Input } from "./ui/input" import { Label } from "./ui/label" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card" -import { Shield, Lock, User, AlertCircle, CheckCircle, Info, LogOut } from "lucide-react" +import { Shield, Lock, User, AlertCircle, CheckCircle, Info, LogOut, Wrench, Package } from "lucide-react" import { getApiUrl } from "../lib/api-config" import { TwoFactorSetup } from "./two-factor-setup" +interface ProxMenuxTool { + key: string + name: string + enabled: boolean +} + export function Settings() { const [authEnabled, setAuthEnabled] = useState(false) const [totpEnabled, setTotpEnabled] = useState(false) @@ -32,8 +38,12 @@ export function Settings() { const [show2FADisable, setShow2FADisable] = useState(false) const [disable2FAPassword, setDisable2FAPassword] = useState("") + const [proxmenuxTools, setProxmenuxTools] = useState([]) + const [loadingTools, setLoadingTools] = useState(true) + useEffect(() => { checkAuthStatus() + loadProxmenuxTools() }, []) const checkAuthStatus = async () => { @@ -47,6 +57,21 @@ export function Settings() { } } + const loadProxmenuxTools = async () => { + try { + const response = await fetch(getApiUrl("/api/proxmenux/installed-tools")) + const data = await response.json() + + if (data.success) { + setProxmenuxTools(data.installed_tools || []) + } + } catch (err) { + console.error("Failed to load ProxMenux tools:", err) + } finally { + setLoadingTools(false) + } + } + const handleEnableAuth = async () => { setError("") setSuccess("") @@ -541,21 +566,45 @@ export function Settings() { - {/* About Section */} + {/* ProxMenux Optimizations */} - About - ProxMenux Monitor information +
+ + ProxMenux Optimizations +
+ System optimizations and utilities installed via ProxMenux
- -
- Version - 1.0.1 -
-
- Build - Debian Package -
+ + {loadingTools ? ( +
+
+
+ ) : proxmenuxTools.length === 0 ? ( +
+ +

No ProxMenux optimizations installed yet

+

Run ProxMenux to configure system optimizations

+
+ ) : ( +
+
+ Installed Tools + {proxmenuxTools.length} active +
+
+ {proxmenuxTools.map((tool) => ( +
+
+ {tool.name} +
+ ))} +
+
+ )} diff --git a/AppImage/scripts/build_appimage.sh b/AppImage/scripts/build_appimage.sh index 66199cc..76d2045 100644 --- a/AppImage/scripts/build_appimage.sh +++ b/AppImage/scripts/build_appimage.sh @@ -83,6 +83,7 @@ cp "$SCRIPT_DIR/auth_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ cp "$SCRIPT_DIR/health_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ health_monitor.py not found" cp "$SCRIPT_DIR/health_persistence.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ health_persistence.py not found" cp "$SCRIPT_DIR/flask_health_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_health_routes.py not found" +cp "$SCRIPT_DIR/flask_proxmenux_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_proxmenux_routes.py not found" echo "📋 Adding translation support..." cat > "$APP_DIR/usr/bin/translate_cli.py" << 'PYEOF' diff --git a/AppImage/scripts/flask_proxmenux_routes.py b/AppImage/scripts/flask_proxmenux_routes.py new file mode 100644 index 0000000..6e48e3f --- /dev/null +++ b/AppImage/scripts/flask_proxmenux_routes.py @@ -0,0 +1,75 @@ +from flask import Blueprint, jsonify +import json +import os + +proxmenux_bp = Blueprint('proxmenux', __name__) + +# Tool descriptions mapping +TOOL_DESCRIPTIONS = { + 'lvm_repair': 'LVM PV Headers Repair', + 'repo_cleanup': 'Repository Cleanup', + 'subscription_banner': 'Subscription Banner Removal', + 'time_sync': 'Time Synchronization', + 'apt_languages': 'APT Language Skip', + 'journald': 'Journald Optimization', + 'logrotate': 'Logrotate Optimization', + 'system_limits': 'System Limits Increase', + 'entropy': 'Entropy Generation (haveged)', + 'memory_settings': 'Memory Settings Optimization', + 'kernel_panic': 'Kernel Panic Configuration', + 'apt_ipv4': 'APT IPv4 Force', + 'kexec': 'kexec for quick reboots', + 'network_optimization': 'Network Optimizations', + 'bashrc_custom': 'Bashrc Customization', + 'figurine': 'Figurine', + 'fastfetch': 'Fastfetch', + 'log2ram': 'Log2ram (SSD Protection)', + 'amd_fixes': 'AMD CPU (Ryzen/EPYC) fixes', + 'persistent_network': 'Setting persistent network interfaces' +} + +@proxmenux_bp.route('/api/proxmenux/installed-tools', methods=['GET']) +def get_installed_tools(): + """Get list of installed ProxMenux tools/optimizations""" + installed_tools_path = '/usr/local/share/proxmenux/installed_tools.json' + + try: + if not os.path.exists(installed_tools_path): + return jsonify({ + 'success': True, + 'installed_tools': [], + 'message': 'No ProxMenux optimizations installed yet' + }) + + with open(installed_tools_path, 'r') as f: + data = json.load(f) + + # Convert to list format with descriptions + tools = [] + for tool_key, enabled in data.items(): + if enabled: # Only include enabled tools + tools.append({ + 'key': tool_key, + 'name': TOOL_DESCRIPTIONS.get(tool_key, tool_key.replace('_', ' ').title()), + 'enabled': enabled + }) + + # Sort alphabetically by name + tools.sort(key=lambda x: x['name']) + + return jsonify({ + 'success': True, + 'installed_tools': tools, + 'total_count': len(tools) + }) + + except json.JSONDecodeError: + return jsonify({ + 'success': False, + 'error': 'Invalid JSON format in installed_tools.json' + }), 500 + except Exception as e: + return jsonify({ + 'success': False, + 'error': str(e) + }), 500 diff --git a/AppImage/scripts/flask_server.py b/AppImage/scripts/flask_server.py index 11d6383..7742e21 100644 --- a/AppImage/scripts/flask_server.py +++ b/AppImage/scripts/flask_server.py @@ -34,12 +34,14 @@ from flask_health_routes import health_bp sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from flask_auth_routes import auth_bp +from flask_proxmenux_routes import proxmenux_bp app = Flask(__name__) CORS(app) # Enable CORS for Next.js frontend app.register_blueprint(auth_bp) app.register_blueprint(health_bp) +app.register_blueprint(proxmenux_bp)