diff --git a/AppImage/README.md b/AppImage/README.md index b9a3f52..7c4a831 100644 --- a/AppImage/README.md +++ b/AppImage/README.md @@ -20,40 +20,3 @@ A modern, responsive dashboard for monitoring Proxmox VE systems built with Next - **UI Components**: Radix UI primitives with shadcn/ui - **Backend**: Flask server for system data collection - **Packaging**: AppImage for easy distribution - -## Development - -\`\`\`bash -# Install dependencies -npm install - -# Start development server -npm run dev - -# Build for production -npm run build -\`\`\` - -## Building AppImage - -\`\`\`bash -# Make build script executable -chmod +x scripts/build_appimage.sh - -# Build AppImage -./scripts/build_appimage.sh -\`\`\` - -## Translation Support - -The project includes a translation system for multi-language support: - -\`\`\`bash -# Build translation AppImage -chmod +x scripts/build_translate_appimage.sh -./scripts/build_translate_appimage.sh -\`\`\` - -## License - -MIT License - see LICENSE file for details. diff --git a/AppImage/components/system-overview.tsx b/AppImage/components/system-overview.tsx index b4f85c6..ce53581 100644 --- a/AppImage/components/system-overview.tsx +++ b/AppImage/components/system-overview.tsx @@ -60,8 +60,8 @@ export function SystemOverview() { const fetchSystemData = async () => { try { - console.log("[v0] Fetching system data from API...") - const response = await fetch("/api/system", { + console.log("[v0] Fetching system data from Flask server...") + const response = await fetch("http://localhost:8008/api/system", { method: "GET", headers: { Accept: "application/json", @@ -124,8 +124,8 @@ export function SystemOverview() { const fetchVMData = async () => { try { - console.log("[v0] Fetching VM data from API...") - const response = await fetch("/api/vms", { + console.log("[v0] Fetching VM data from Flask server...") + const response = await fetch("http://localhost:8008/api/vms", { method: "GET", headers: { Accept: "application/json", diff --git a/AppImage/next.config.mjs b/AppImage/next.config.mjs index ac0b84b..87f06dd 100644 --- a/AppImage/next.config.mjs +++ b/AppImage/next.config.mjs @@ -25,18 +25,6 @@ const nextConfig = { } return config; }, - async headers() { - return [ - { - source: '/api/:path*', - headers: [ - { key: 'Access-Control-Allow-Origin', value: '*' }, - { key: 'Access-Control-Allow-Methods', value: 'GET, POST, PUT, DELETE, OPTIONS' }, - { key: 'Access-Control-Allow-Headers', value: 'Content-Type, Authorization' }, - ], - }, - ]; - }, }; export default nextConfig; diff --git a/AppImage/public/apple-touch-icon.png b/AppImage/public/apple-touch-icon.png new file mode 100644 index 0000000..fcdbf43 Binary files /dev/null and b/AppImage/public/apple-touch-icon.png differ diff --git a/AppImage/public/manifest.json b/AppImage/public/manifest.json index 77b3e63..e033acf 100644 --- a/AppImage/public/manifest.json +++ b/AppImage/public/manifest.json @@ -8,13 +8,8 @@ "theme_color": "#2b2f36", "icons": [ { - "src": "/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png", - "sizes": "512x512", + "src": "/images/proxmenux-logo.png", + "sizes": "256x256", "type": "image/png" } ] diff --git a/AppImage/scripts/build_appimage.sh b/AppImage/scripts/build_appimage.sh index 56e80bb..e65f6ce 100644 --- a/AppImage/scripts/build_appimage.sh +++ b/AppImage/scripts/build_appimage.sh @@ -35,6 +35,34 @@ mkdir -p "$APP_DIR/usr/share/applications" mkdir -p "$APP_DIR/usr/share/icons/hicolor/256x256/apps" mkdir -p "$APP_DIR/web" +echo "🔨 Building Next.js application..." +cd "$APPIMAGE_ROOT" +if [ ! -f "package.json" ]; then + echo "❌ Error: package.json not found in AppImage directory" + exit 1 +fi + +# Install dependencies if node_modules doesn't exist +if [ ! -d "node_modules" ]; then + echo "📦 Installing dependencies..." + npm install +fi + +# Build Next.js application +echo "🏗️ Building Next.js application..." +npm run build + +# Verify build was successful +if [ ! -d ".next" ]; then + echo "❌ Error: Next.js build failed - .next directory not found" + exit 1 +fi + +echo "✅ Next.js build completed successfully" + +# Return to script directory +cd "$SCRIPT_DIR" + # Copy Flask server echo "📋 Copying Flask server..." cp "$SCRIPT_DIR/flask_server.py" "$APP_DIR/usr/bin/" @@ -171,12 +199,8 @@ if [ -d "$APPIMAGE_ROOT/.next" ]; then cp "$APPIMAGE_ROOT/package.json" "$APP_DIR/web/" echo "✅ Next.js build copied successfully" else - echo "⚠️ Warning: Next.js build not found in AppImage directory. Run 'npm run build' in AppImage directory first." - echo "📋 Creating minimal web structure..." - mkdir -p "$APP_DIR/web/public/images" - if [ -f "$APPIMAGE_ROOT/public/images/proxmenux-logo.png" ]; then - cp "$APPIMAGE_ROOT/public/images/proxmenux-logo.png" "$APP_DIR/web/public/images/" - fi + echo "❌ Error: Next.js build not found even after building" + exit 1 fi # Create AppRun script