commit node js
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import mariadb
|
||||
from datetime import datetime, timedelta
|
||||
from flask import Blueprint, render_template, redirect, url_for, request, flash, session, current_app, jsonify
|
||||
from flask import Blueprint, render_template, redirect, url_for, request, flash, session, current_app, jsonify, send_from_directory
|
||||
from .models import User
|
||||
from . import db
|
||||
from reportlab.lib.pagesizes import letter
|
||||
@@ -2106,6 +2106,30 @@ def download_print_service():
|
||||
print(f"DEBUG: Error downloading print service: {e}")
|
||||
return jsonify({'error': 'Failed to download print service'}), 500
|
||||
|
||||
@bp.route('/download/desktop-app')
|
||||
def download_desktop_app():
|
||||
"""Download the Quality Print Desktop v1.0.0 application"""
|
||||
try:
|
||||
# Path to the desktop app file
|
||||
downloads_path = os.path.join(current_app.root_path, 'static', 'downloads')
|
||||
filename = 'Quality_Print_Desktop_v1.0.0.zip'
|
||||
|
||||
# Check if the zip file exists
|
||||
full_path = os.path.join(downloads_path, filename)
|
||||
|
||||
if not os.path.exists(full_path):
|
||||
return jsonify({
|
||||
'error': 'Desktop app package not found',
|
||||
'message': 'Quality Print Desktop v1.0.0 is not available',
|
||||
'suggestion': 'Please contact the administrator'
|
||||
}), 404
|
||||
|
||||
return send_from_directory(downloads_path, filename, as_attachment=True)
|
||||
|
||||
except Exception as e:
|
||||
print(f"DEBUG: Error downloading desktop app: {e}")
|
||||
return jsonify({'error': 'Failed to download desktop app'}), 500
|
||||
|
||||
@bp.route('/get_order_data/<int:order_id>', methods=['GET'])
|
||||
def get_order_data(order_id):
|
||||
"""Get specific order data for preview"""
|
||||
|
||||
Reference in New Issue
Block a user