mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-01 23:56:18 +00:00
Update AppImage
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
output: 'standalone',
|
||||
output: 'export',
|
||||
trailingSlash: true,
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
|
@@ -7,7 +7,8 @@
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
"lint": "next lint",
|
||||
"export": "next build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hookform/resolvers": "^3.10.0",
|
||||
|
@@ -48,17 +48,16 @@ if [ ! -d "node_modules" ]; then
|
||||
npm install
|
||||
fi
|
||||
|
||||
# Build Next.js application
|
||||
echo "🏗️ Building Next.js application..."
|
||||
npm run build
|
||||
echo "🏗️ Building Next.js static export..."
|
||||
npm run export
|
||||
|
||||
# Verify build was successful
|
||||
if [ ! -d ".next" ]; then
|
||||
echo "❌ Error: Next.js build failed - .next directory not found"
|
||||
# Verify export was successful
|
||||
if [ ! -d "out" ]; then
|
||||
echo "❌ Error: Next.js export failed - out directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Next.js build completed successfully"
|
||||
echo "✅ Next.js static export completed successfully"
|
||||
|
||||
# Return to script directory
|
||||
cd "$SCRIPT_DIR"
|
||||
@@ -193,24 +192,15 @@ chmod +x "$APP_DIR/usr/bin/translate_cli.py"
|
||||
|
||||
# Copy Next.js build
|
||||
echo "📋 Copying web dashboard..."
|
||||
if [ -d "$APPIMAGE_ROOT/.next" ]; then
|
||||
if [ -d "$APPIMAGE_ROOT/out" ]; then
|
||||
mkdir -p "$APP_DIR/web"
|
||||
cp -r "$APPIMAGE_ROOT/.next" "$APP_DIR/web/"
|
||||
cp -r "$APPIMAGE_ROOT/out" "$APP_DIR/web/"
|
||||
cp -r "$APPIMAGE_ROOT/public" "$APP_DIR/web/"
|
||||
cp "$APPIMAGE_ROOT/package.json" "$APP_DIR/web/"
|
||||
|
||||
# Also try to create a static export if possible
|
||||
cd "$APPIMAGE_ROOT"
|
||||
if npm run export 2>/dev/null; then
|
||||
echo "✅ Next.js static export created"
|
||||
if [ -d "out" ]; then
|
||||
cp -r "out" "$APP_DIR/web/"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "✅ Next.js build copied successfully"
|
||||
echo "✅ Next.js static export copied successfully"
|
||||
else
|
||||
echo "❌ Error: Next.js build not found even after building"
|
||||
echo "❌ Error: Next.js export not found even after building"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@@ -23,13 +23,10 @@ CORS(app) # Enable CORS for Next.js frontend
|
||||
def serve_dashboard():
|
||||
"""Serve the main dashboard page from Next.js build"""
|
||||
try:
|
||||
next_dir = os.path.join(os.path.dirname(__file__), '..', 'web', '.next')
|
||||
|
||||
# Try to serve the Next.js built index page
|
||||
index_paths = [
|
||||
os.path.join(next_dir, 'server', 'app', 'page.html'),
|
||||
os.path.join(next_dir, 'server', 'pages', 'index.html'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'out', 'index.html'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', '.next', 'server', 'app', 'page.html'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', '.next', 'server', 'pages', 'index.html'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'dist', 'index.html')
|
||||
]
|
||||
|
||||
@@ -130,9 +127,15 @@ def serve_sw():
|
||||
def serve_next_static(filename):
|
||||
"""Serve Next.js static files"""
|
||||
try:
|
||||
next_static_dir = os.path.join(os.path.dirname(__file__), '..', 'web', '.next', 'static')
|
||||
if os.path.exists(os.path.join(next_static_dir, filename)):
|
||||
return send_from_directory(next_static_dir, filename)
|
||||
static_paths = [
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'out', '_next'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', '.next', 'static')
|
||||
]
|
||||
|
||||
for static_dir in static_paths:
|
||||
file_path = os.path.join(static_dir, filename)
|
||||
if os.path.exists(file_path):
|
||||
return send_file(file_path)
|
||||
return '', 404
|
||||
except Exception as e:
|
||||
print(f"Error serving Next.js static file {filename}: {e}")
|
||||
@@ -142,11 +145,10 @@ def serve_next_static(filename):
|
||||
def serve_static_files(filename):
|
||||
"""Serve static files (icons, etc.)"""
|
||||
try:
|
||||
# Try Next.js public directory first
|
||||
public_paths = [
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'out'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'public'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'public'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', 'out'),
|
||||
os.path.join(os.path.dirname(__file__), '..', 'web', '.next', 'static')
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user