From f621ba772bf6640ec8fe51f98db9719cf3b25939 Mon Sep 17 00:00:00 2001 From: Martin Tazl Date: Wed, 1 Jul 2026 08:06:50 +0000 Subject: [PATCH] Ignore backup files --- .gitignore | 4 +- admin_simple.html.bak | 694 --------- app.py.backup | 241 --- article-data.json.bak | 1373 ------------------ static/service-worker.js.backup | 226 --- templates/roll_calculator.html.backup | 1933 ------------------------- 6 files changed, 2 insertions(+), 4469 deletions(-) delete mode 100644 admin_simple.html.bak delete mode 100644 app.py.backup delete mode 100644 article-data.json.bak delete mode 100644 static/service-worker.js.backup delete mode 100644 templates/roll_calculator.html.backup diff --git a/.gitignore b/.gitignore index e8e9e4b..97a8dec 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,5 @@ instance/ node_modules/ # Backup files -.bak -.backup +*.bak +*.backup diff --git a/admin_simple.html.bak b/admin_simple.html.bak deleted file mode 100644 index 92762d0..0000000 --- a/admin_simple.html.bak +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - Roll Calculator Admin - Einfach - - - - - -
-
-

๐Ÿ” Roll Calculator Admin

-

Geben Sie das Admin-Passwort ein

- - -

Standard: admin123

-
-
- - - - - - - - diff --git a/app.py.backup b/app.py.backup deleted file mode 100644 index ad5cb6c..0000000 --- a/app.py.backup +++ /dev/null @@ -1,241 +0,0 @@ -""" -Naue Roll Calculator - Beta -Flask app with HTTP Basic Authentication -""" - -from flask import Flask, render_template, request, send_file, send_from_directory, jsonify -from flask_httpauth import HTTPBasicAuth -from functools import wraps -import os -from datetime import datetime -import json - -app = Flask(__name__) -auth = HTTPBasicAuth() - -# ============================================================================ -# CONFIGURATION -# ============================================================================ - -# Benutzer fรผr Beta-Phase (in Produktion aus env-Variablen laden!) -BETA_USERS = { - "beta": "rollcalc_beta_2026", # ร„ndere das Passwort! - "naue": "naue_access_2026", # Zweiter User optional - "cniehues": "beta_test_2026", # Christian Niehues EDD - "lvollmert": "Geheim!", # Lars Vollmert EDD - "mtazl": "rollcalc", # Martin Tazl EDD - "controlling": "beta2026" # Lars Krรผckemeier und Lea-Marie -} - -# Optional: Admin-Features (z.B. Logs, Stats) -ADMIN_USERS = { - "admin": "admin_secure_pwd_2026" -} - -# Logging fรผr Auditing -LOG_FILE = "access_log.json" - -# ============================================================================ -# AUTHENTICATION -# ============================================================================ - -@auth.verify_password -def verify_password(username, password): - """Verify HTTP Basic Auth credentials""" - all_users = {**BETA_USERS, **ADMIN_USERS} - if username in all_users and all_users[username] == password: - return username - return None - -def log_access(username, endpoint, method, status=200): - """Log all access attempts for audit trail""" - log_entry = { - "timestamp": datetime.now().isoformat(), - "username": username, - "endpoint": endpoint, - "method": method, - "status": status - } - try: - logs = [] - if os.path.exists(LOG_FILE): - with open(LOG_FILE, "r") as f: - logs = json.load(f) - logs.append(log_entry) - with open(LOG_FILE, "w") as f: - json.dump(logs, f, indent=2) - except Exception as e: - print(f"[Logging Error] {e}") - -# ============================================================================ -# ROUTES -# ============================================================================ - -@app.route("/", methods=["GET"]) -@auth.login_required -def index(): - """Main calculator page - requires authentication""" - log_access(auth.current_user(), "/", "GET") - return render_template("roll_calculator.html") - -@app.route("/static/", methods=["GET"]) -@auth.login_required -def serve_static(filename): - """Serve static files (CSS, JS, JSON) - protected""" - log_access(auth.current_user(), f"/static/{filename}", "GET") - return send_from_directory("static", filename) - -@app.route("/api/health", methods=["GET"]) -@auth.login_required -def health_check(): - """Simple health check endpoint""" - return jsonify({"status": "ok", "version": "1.0.0-beta"}), 200 - -@app.route("/api/user", methods=["GET"]) -@auth.login_required -def get_user(): - """Get current authenticated user info""" - user = auth.current_user() - is_admin = user in ADMIN_USERS - return jsonify({ - "username": user, - "authenticated": True, - "is_admin": is_admin, - "timestamp": datetime.now().isoformat() - }), 200 - -# Admin-only endpoint (optional) -@app.route("/admin/logs", methods=["GET"]) -@auth.login_required -def get_logs(): - """View access logs - admin only""" - user = auth.current_user() - if user not in ADMIN_USERS: - log_access(user, "/admin/logs", "GET", 403) - return jsonify({"error": "Unauthorized"}), 403 - - log_access(user, "/admin/logs", "GET") - logs = [] - if os.path.exists(LOG_FILE): - with open(LOG_FILE, "r") as f: - logs = json.load(f) - return jsonify({"logs": logs}), 200 - -# ============================================================================ -# ERROR HANDLERS -# ============================================================================ - -@app.errorhandler(401) -def unauthorized(e): - """Handle 401 Unauthorized - browser will prompt for credentials""" - return jsonify({"error": "Unauthorized - please provide valid credentials"}), 401 - -@app.errorhandler(404) -def not_found(e): - """Handle 404 Not Found""" - return jsonify({"error": "Not found"}), 404 - -@app.errorhandler(500) -def internal_error(e): - """Handle 500 Internal Server Error""" - return jsonify({"error": "Internal server error"}), 500 - -# ============================================================================ -# ADMIN ROUTES -# ============================================================================ - -@app.route("/admin", methods=["GET"]) -@auth.login_required -def admin_dashboard(): - """Admin Dashboard - nur fรผr Admin-Benutzer""" - user = auth.current_user() - if user not in ADMIN_USERS: - log_access(user, "/admin", "GET", 403) - return jsonify({"error": "Unauthorized - Admin access required"}), 403 - - log_access(user, "/admin", "GET") - return render_template("admin.html") - - -@app.route("/api/admin/stats", methods=["GET"]) -@auth.login_required -def get_admin_stats(): - """Statistiken fรผr Admin Dashboard""" - user = auth.current_user() - if user not in ADMIN_USERS: - log_access(user, "/api/admin/stats", "GET", 403) - return jsonify({"error": "Unauthorized"}), 403 - - log_access(user, "/api/admin/stats", "GET") - - logs = [] - if os.path.exists(LOG_FILE): - try: - with open(LOG_FILE, "r") as f: - logs = json.load(f) - except json.JSONDecodeError: - logs = [] - - total_requests = len(logs) - unique_users = len(set(log.get("username", "unknown") for log in logs)) - failed_logins = len([l for l in logs if l.get("status") == 401]) - - return jsonify({ - "total_requests": total_requests, - "unique_users": unique_users, - "failed_logins": failed_logins, - "timestamp": datetime.now().isoformat() - }), 200 - - -@app.route("/api/admin/logs", methods=["GET"]) -@auth.login_required -def get_admin_logs(): - """Access Logs fรผr Admin Dashboard""" - user = auth.current_user() - if user not in ADMIN_USERS: - log_access(user, "/api/admin/logs", "GET", 403) - return jsonify({"error": "Unauthorized"}), 403 - - log_access(user, "/api/admin/logs", "GET") - - logs = [] - if os.path.exists(LOG_FILE): - try: - with open(LOG_FILE, "r") as f: - logs = json.load(f) - except json.JSONDecodeError: - logs = [] - - logs_sorted = sorted(logs, key=lambda x: x.get("timestamp", ""), reverse=True) - return jsonify({"logs": logs_sorted[-500:]}), 200 - -# ============================================================================ -# STARTUP -# ============================================================================ - -if __name__ == "__main__": - # Erstelle templates-Verzeichnis falls nicht vorhanden - os.makedirs("templates", exist_ok=True) - os.makedirs("static", exist_ok=True) - - print(""" - โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— - โ•‘ Naue Roll Calculator - Beta โ•‘ - โ•‘ HTTP Basic Auth Enabled โ•‘ - โ•‘ โ•‘ - โ•‘ Test credentials: โ•‘ - โ•‘ User: beta / Password: rollcalc_beta_2026 โ•‘ - โ•‘ User: admin / Password: admin_secure_pwd_2026 โ•‘ - โ•‘ โ•‘ - โ•‘ Starten auf: http://localhost:5000 โ•‘ - โ•‘ โš ๏ธ ร„NDERE DIE PASSWร–RTER VOR PRODUKTIVBEREITSTELLUNG! โ•‘ - โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• - """) - - app.run( - host="0.0.0.0", - port=5000, - debug=False, # In Produktion: False - use_reloader=True - ) diff --git a/article-data.json.bak b/article-data.json.bak deleted file mode 100644 index 6c27bc8..0000000 --- a/article-data.json.bak +++ /dev/null @@ -1,1373 +0,0 @@ -[ - { - "nr": "114030", - "name": "Bfix BZ 13-B, 4,95 x <20 m", - "thickness": 15.616 - }, - { - "nr": "139705", - "name": "Bentofix B 4000 (akt. Na-bent.), 5,00 x 30 m", - "thickness": 8.233 - }, - { - "nr": "146900", - "name": "Stex R 1801, 5,80 x 50 m", - "thickness": 10.867 - }, - { - "nr": "146910", - "name": "Stex R 1801, 6,00 x 50 m", - "thickness": 11.249 - }, - { - "nr": "152200", - "name": "Stex R 1001-B2, 2,10 m Breite", - "thickness": 8.015 - }, - { - "nr": "152210", - "name": "Stex R 1001-B2 MW 2,10 m Breite", - "thickness": 8.2 - }, - { - "nr": "154600", - "name": "Stex R 2001 G5, 5,10 x 50 m", - "thickness": 10.628 - }, - { - "nr": "171002", - "name": "Stex R 2501, 6,00 x 40 m", - "thickness": 16.987 - }, - { - "nr": "171405", - "name": "Bfix NSP 5300 ร–N, 5,00 x 40 m", - "thickness": 6.693 - }, - { - "nr": "173000", - "name": "Bfix X2 BFG 5300 L, 4,85x40 m", - "thickness": 6.186 - }, - { - "nr": "173020", - "name": "Bfix X2 BFG 5300(L) 2,42x15 m", - "thickness": 6.59 - }, - { - "nr": "173062", - "name": "Bfix X2 BFG 5300 (L) 1,20 x 36m (2 Ro. auf 1 Kern)", - "thickness": 6.549 - }, - { - "nr": "178905", - "name": "Bfix NSP 3300, 5,00 x 50 m", - "thickness": 5.2 - }, - { - "nr": "180005", - "name": "Bfix NSP 4000, 5,00 x 50 m", - "thickness": 6.175 - }, - { - "nr": "180105", - "name": "Bfix NSP 4300, 5,00 x 50 m", - "thickness": 6.076 - }, - { - "nr": "180205", - "name": "Bfix NSP 4900, 5,00 x 40 m", - "thickness": 6.447 - }, - { - "nr": "180305", - "name": "Bfix NSP 5300, 5,00 x 40 m", - "thickness": 6.918 - }, - { - "nr": "180405", - "name": "Bfix NSP 5600, 5,00 x 40 m", - "thickness": 7.12 - }, - { - "nr": "181000", - "name": "Stex R 3001 G5, 5,10 x 25 m", - "thickness": 16.264 - }, - { - "nr": "182612", - "name": "BfixX2NSP4900(Coa.u)mK,4,85x40", - "thickness": 6.2 - }, - { - "nr": "182615", - "name": "BfixX2NSP4900(Coa.o)mK,4,85x40", - "thickness": 6.34 - }, - { - "nr": "183800", - "name": "Stex R 2501 G5, 5,10 x 50 m", - "thickness": 13.463 - }, - { - "nr": "184206", - "name": "Stex R 2771 Z, 6,00 x 40 m", - "thickness": 15.922 - }, - { - "nr": "185900", - "name": "Stex R 501 (Betonvlies) 5,00 x 100 m", - "thickness": 3.51 - }, - { - "nr": "190005", - "name": "Bfix NSP 6000, 5,00 x 40 m", - "thickness": 7.296 - }, - { - "nr": "190006", - "name": "Bfix NSP 6000 (France <5% CaCO3), 5,00 x 40 m", - "thickness": 6.81 - }, - { - "nr": "190201", - "name": "Bfix X2 NSP4000, m.K. 4,85x50m", - "thickness": 6.05 - }, - { - "nr": "190420", - "name": "Bfix X5F NSP 4200, m.K., 4,85 x 40 m", - "thickness": 6.85 - }, - { - "nr": "193002", - "name": "Stex RZ 891, 6,00 x 70 m", - "thickness": 7.016 - }, - { - "nr": "193102", - "name": "Stex RZ 2221, 6,00 x 40 m", - "thickness": 12.186 - }, - { - "nr": "194605", - "name": "Bfix NSP 6600 a , 5,00 x 30 m", - "thickness": 7.117 - }, - { - "nr": "198400", - "name": "Stex RZ 3501, 5,80 x 25 m", - "thickness": 19.401 - }, - { - "nr": "199706", - "name": "Bfix X5F NSP4900 m.K. 4,85x35m", - "thickness": 6.8 - }, - { - "nr": "199815", - "name": "Bfix X10F NSP4900 m.K.4,85x30m", - "thickness": 7.46 - }, - { - "nr": "201601", - "name": "Bfix X6F NSP5300ร–N,m.K.4,85x35", - "thickness": 7.84 - }, - { - "nr": "203300", - "name": "Bfix X5F BFG 5300, 4,85x40 m", - "thickness": 7.059 - }, - { - "nr": "205600", - "name": "Bfix X2 NSP 6000, 4,85 x 40 m", - "thickness": 7.124 - }, - { - "nr": "206900", - "name": "Bfix NSP4900(g.GRI/GCL3)/5x40m", - "thickness": 6.067 - }, - { - "nr": "208100", - "name": "Stex 151 GRK 3 C, 6,00 x 100 m", - "thickness": 0.944 - }, - { - "nr": "208102", - "name": "Stex 151 GRK3 C, 2,00 x 100 m", - "thickness": 0.937 - }, - { - "nr": "208104", - "name": "Stex 151 GRK3 C, 4,00 x 100 m", - "thickness": 0.932 - }, - { - "nr": "208200", - "name": "Stex 201 GRK 3 C, 6,00 x 100 m", - "thickness": 1.134 - }, - { - "nr": "208202", - "name": "Stex 201 GRK3 C, 2,00 x 100 m", - "thickness": 1.103 - }, - { - "nr": "208204", - "name": "Stex 201 GRK3 C, 4,00 x 100 m", - "thickness": 1.086 - }, - { - "nr": "208250", - "name": "Stex 251 GRK 4 C, 6,00 x 100 m", - "thickness": 1.384 - }, - { - "nr": "208300", - "name": "Stex 301 GRK 5 C, 6,00 x 100 m", - "thickness": 1.616 - }, - { - "nr": "208400", - "name": "Stex 401 GRK 5 C, 6,00 x 100 m", - "thickness": 1.998 - }, - { - "nr": "208501", - "name": "Bfix X10F NSP5300ร–N,m.K4,85x35", - "thickness": 8.5 - }, - { - "nr": "209350", - "name": "Stex R 351 C, 5,90 x 130 m", - "thickness": 1.731 - }, - { - "nr": "209900", - "name": "Bfix NSP 5400 DB, 5,00 x 40 m", - "thickness": 7.2 - }, - { - "nr": "210200", - "name": "aduxa 130 (131) GRK2 C, 6x100m", - "thickness": 0.881 - }, - { - "nr": "210210", - "name": "aduxa 130 (131) GRK2 C, 1x100m", - "thickness": 0.822 - }, - { - "nr": "210220", - "name": "aduxa 130 (131) GRK2 C, 2x100m", - "thickness": 0.828 - }, - { - "nr": "210240", - "name": "aduxa 130 (131) GRK2 C, 4x100m", - "thickness": 0.817 - }, - { - "nr": "210300", - "name": "aduxa 150 (151) GRK3 C, 6x100m", - "thickness": 0.94 - }, - { - "nr": "210320", - "name": "aduxa 150 (151) GRK3 C, 2x100m", - "thickness": 0.929 - }, - { - "nr": "210340", - "name": "aduxa 150 (151) GRK3 C, 4x100m", - "thickness": 0.927 - }, - { - "nr": "210400", - "name": "aduxa 200 (201) GRK3 C, 6x100m", - "thickness": 1.127 - }, - { - "nr": "210420", - "name": "aduxa 200 (201) GRK3 C, 2x100m", - "thickness": 1.089 - }, - { - "nr": "210440", - "name": "aduxa 200 (201) GRK3 C, 4x100m", - "thickness": 1.078 - }, - { - "nr": "210500", - "name": "aduxa 250 (251) GRK4 C, 6x100m", - "thickness": 1.386 - }, - { - "nr": "210520", - "name": "aduxa 250 (251) GRK4 C, 2x100m", - "thickness": 1.371 - }, - { - "nr": "210540", - "name": "aduxa 250 (251) GRK4 C, 4x100m", - "thickness": 1.36 - }, - { - "nr": "210600", - "name": "aduxa 300 (301) GRK5 C, 6x100m", - "thickness": 1.615 - }, - { - "nr": "210620", - "name": "aduxa 300 (301) GRK5 C, 2x100m", - "thickness": 1.625 - }, - { - "nr": "210640", - "name": "aduxa 300 (301) GRK5 C, 4x100m", - "thickness": 1.57 - }, - { - "nr": "211100", - "name": "Stex 151 GRK 3, 6,00 x 100 m", - "thickness": 2.419 - }, - { - "nr": "211104", - "name": "Stex 151 GRK 3, 4,00 x 100 m", - "thickness": 2.359 - }, - { - "nr": "211900", - "name": "Bfix NSP 5000 a, 5,00 x 40 m", - "thickness": 6.343 - }, - { - "nr": "212250", - "name": "Stex 251 GRK 4, 6,00 x 100 m", - "thickness": 3.037 - }, - { - "nr": "212255", - "name": "Stex 251 GRK 4, 5,90 x 100 m", - "thickness": 2.893 - }, - { - "nr": "212256", - "name": "Stex 251 GRK 4, 4,50 x 50 m", - "thickness": 2.944 - }, - { - "nr": "212300", - "name": "Stex R 301, 6,00 x 100 m", - "thickness": 3.333 - }, - { - "nr": "212400", - "name": "Stex R 401 C, 5,90 x 120 m", - "thickness": 1.875 - }, - { - "nr": "212500", - "name": "Stex R 501 C, 5,90 x 100 m", - "thickness": 2.3 - }, - { - "nr": "212900", - "name": "Stex R 901 DB, 4,50 x 30 m", - "thickness": 6.728 - }, - { - "nr": "212937", - "name": "Stex R 901 DB, 3,50 x 20 m", - "thickness": 6.228 - }, - { - "nr": "213100", - "name": "Stex R 1001, 6,00 x 50 m", - "thickness": 7.025 - }, - { - "nr": "213400", - "name": "Stex R 401, 6,00 x 90 m", - "thickness": 3.919 - }, - { - "nr": "213407", - "name": "Stex R 401, 5,90 x 85 m", - "thickness": 3.87 - }, - { - "nr": "213500", - "name": "Stex R 501, 6,00 x 50 m", - "thickness": 4.285 - }, - { - "nr": "213600", - "name": "Stex R 601, 6,00 x 50 m", - "thickness": 5.152 - }, - { - "nr": "213601", - "name": "Stex R 601, 5,90 x 50 m", - "thickness": 4.973 - }, - { - "nr": "213700", - "name": "Stex R 701, 6,00 x 50 m", - "thickness": 5.556 - }, - { - "nr": "213800", - "name": "Stex R 801, 6,00 x 50 m", - "thickness": 6.36 - }, - { - "nr": "213808", - "name": "Stex R 801, 5,80 x 50 m", - "thickness": 6.504 - }, - { - "nr": "213810", - "name": "Stex R 801 (moosbraun) 6,00 x 50 m", - "thickness": 5.775 - }, - { - "nr": "214200", - "name": "Stex R 1201 (Turkey), 5,80x55m", - "thickness": 8.487 - }, - { - "nr": "214206", - "name": "Stex R 1201, 6,00 x 60 m", - "thickness": 8.209 - }, - { - "nr": "214502", - "name": "Stex R501(Betonvlies)5,45x100m", - "thickness": 3.506 - }, - { - "nr": "214503", - "name": "Stex R501(Betonvlies)6,00x100m", - "thickness": 3.47 - }, - { - "nr": "214504", - "name": "Stex R501(Betonvlies)5,25x100m", - "thickness": 3.365 - }, - { - "nr": "214506", - "name": "Stex R501(Betonvlies)6,20x100m", - "thickness": 3.405 - }, - { - "nr": "214507", - "name": "Stex R501(Betonvlies)5,20x100m", - "thickness": 3.229 - }, - { - "nr": "214508", - "name": "Stex R501(Betonvlies)4,20x100m", - "thickness": 3.239 - }, - { - "nr": "214509", - "name": "Stex R501(Betonvlies)5,50x100m", - "thickness": 3.197 - }, - { - "nr": "214512", - "name": "Stex R 501 (Betonvlies) 4,85 x 100 m", - "thickness": 3.539 - }, - { - "nr": "214513", - "name": "Stex R501(Betonvlies)3,85x100m", - "thickness": 3.282 - }, - { - "nr": "214700", - "name": "Stex H 751 (Tfix 751), 6,00 x 50 m", - "thickness": 6.722 - }, - { - "nr": "215500", - "name": "Stex H 501 (Tfix 501), 6,00 x 50 m", - "thickness": 4.996 - }, - { - "nr": "217300", - "name": "Stex RZ 331 (neu), 6,00 x 100 m", - "thickness": 3.516 - }, - { - "nr": "217400", - "name": "Stex RZ 441 (neu), 6,00 x 100 m", - "thickness": 4.173 - }, - { - "nr": "217500", - "name": "Stex RZ 551 (neu), 6,00 x 50 m", - "thickness": 4.726 - }, - { - "nr": "217700", - "name": "Stex R 1701, 6,00 x 50 m", - "thickness": 10.018 - }, - { - "nr": "218300", - "name": "Stex AS 301, 6,00 x 90 m", - "thickness": 3.145 - }, - { - "nr": "218400", - "name": "Stex AS 401, 6,00 x 90 m", - "thickness": 3.679 - }, - { - "nr": "218500", - "name": "Stex AS 501, 6,00 x 75 m", - "thickness": 4.252 - }, - { - "nr": "218505", - "name": "Stex AS 501, 5,50 x 100 m", - "thickness": 4.171 - }, - { - "nr": "218600", - "name": "Stex AS 601, 6,00 x 60 m", - "thickness": 5.042 - }, - { - "nr": "218606", - "name": "Stex AS 601, 5,90 x 50 m", - "thickness": 4.964 - }, - { - "nr": "218800", - "name": "Stex AS 801, 6,00 x 50 m", - "thickness": 5.982 - }, - { - "nr": "219100", - "name": "Stex AS 1001, 6,00 x 40 m", - "thickness": 6.771 - }, - { - "nr": "219210", - "name": "Stex R 301 AS 6,00 x 100 m", - "thickness": 3.529 - }, - { - "nr": "219211", - "name": "Stex R 401 AS 6,00 x 90 m", - "thickness": 4.337 - }, - { - "nr": "219212", - "name": "Stex R 501 AS 6,00 x 75 m", - "thickness": 4.664 - }, - { - "nr": "219213", - "name": "Stex R 601 AS 6,00 x 60 m", - "thickness": 5.235 - }, - { - "nr": "219214", - "name": "Stex R 701 AS 6,00 x 50 m", - "thickness": 5.903 - }, - { - "nr": "219215", - "name": "Stex R 801 AS 6,00 x 50 m", - "thickness": 6.384 - }, - { - "nr": "219216", - "name": "Stex R 1001 AS 6,00 x 40 m", - "thickness": 7.276 - }, - { - "nr": "219217", - "name": "Stex R 1201 AS 6,00 x 35 m", - "thickness": 8.076 - }, - { - "nr": "220500", - "name": "Stex HB 501 (Tfix B 501), 4,80 x 30 m", - "thickness": 10.88 - }, - { - "nr": "220502", - "name": "Stex HB 501 (Alte Bez.Tfix B501) 4,80 x Sonderlg.", - "thickness": 10.7 - }, - { - "nr": "220700", - "name": "Stex HB 751, 4,80 x 25 m", - "thickness": 12.78 - }, - { - "nr": "220740", - "name": "Stex HB 751, 4,00 x 25 m", - "thickness": 12.175 - }, - { - "nr": "221330", - "name": "Stex HT 3 (150 g), 5,80 x 270 m", - "thickness": 0.91 - }, - { - "nr": "221400", - "name": "Stex HT 4 (165 g), 5,80 x 250 m", - "thickness": 1.039 - }, - { - "nr": "221500", - "name": "Stex HT 5 (200 g), 5,80 x 225 m", - "thickness": 1.138 - }, - { - "nr": "221600", - "name": "Stex HT 6 (250 g), 5,80 x 200 m", - "thickness": 1.307 - }, - { - "nr": "221601", - "name": "Stex HT 6 (250 g) 6,00 x 200 m", - "thickness": 1.321 - }, - { - "nr": "221700", - "name": "Stex HT 7 (300 g), 5,80 x 180 m", - "thickness": 1.53 - }, - { - "nr": "221701", - "name": "Stex HT 7 (300 g) 6,00 x 180 m", - "thickness": 1.53 - }, - { - "nr": "223900", - "name": "Stex H 251 Z 6,00 x 100 m", - "thickness": 3.32 - }, - { - "nr": "225400", - "name": "Stex H 331 Z, 6,00 x 100 m", - "thickness": 3.681 - }, - { - "nr": "226100", - "name": "Stex Genap HT 6 (250 g), 5,00 x 350 m", - "thickness": 1.307 - }, - { - "nr": "226700", - "name": "Stex 151 GRK3 C (Fa. Blanke), 2,10 x 450 m", - "thickness": 0.959 - }, - { - "nr": "226800", - "name": "Stex RZ 3001, 6,00 x 25 m", - "thickness": 17.843 - }, - { - "nr": "227800", - "name": "Bfix Green A 5500 G1, 4,85 x 30 m", - "thickness": 10.933 - }, - { - "nr": "227900", - "name": "Stex R 671, 6,00 x 50 m", - "thickness": 5.477 - }, - { - "nr": "228200", - "name": "Stex R 1501 SL (K7), 5,80 x 50 m", - "thickness": 9.548 - }, - { - "nr": "228300", - "name": "Stex RZ 2501, 6,00 x 40 m", - "thickness": 16.017 - }, - { - "nr": "228500", - "name": "Stex R 501 Z, 5,90 x 60 m", - "thickness": 4.758 - }, - { - "nr": "228600", - "name": "Bfix BZ 13-B(Julianakanal)รœberlapp. links 4,95x25m", - "thickness": 19.196 - }, - { - "nr": "228610", - "name": "Bfix BZ 13-B(Julianakanal)รœberlapp. links 4,95x18m", - "thickness": 19.337 - }, - { - "nr": "228700", - "name": "Bfix BZ 13-B(Julianakanal)รœberlapp.rechts 4,95x25m", - "thickness": 18.943 - }, - { - "nr": "228710", - "name": "Bfix BZ 13-B(Julianakanal)รœberlapp.rechts 4,95x18m", - "thickness": 19.226 - }, - { - "nr": "228900", - "name": "Bfix BFG 5000 (Julianakanal), 5,00 x 40 m", - "thickness": 6.96 - }, - { - "nr": "228920", - "name": "Bfix BFG 5000 (Julianakanal), 2,50 x 40 m", - "thickness": 7.22 - }, - { - "nr": "229200", - "name": "Stex RZ 1111, 6,00 x 50 m", - "thickness": 7.821 - }, - { - "nr": "229400", - "name": "Bfix Green NSP 510G3, 4,85 x 40 m", - "thickness": 7 - }, - { - "nr": "229700", - "name": "Stex R 401 d, 6,00 x 90 m", - "thickness": 3.909 - }, - { - "nr": "229800", - "name": "Stex HB 751 (groรŸer Stahlkern), 4,80 x 26,0 m", - "thickness": 13.05 - }, - { - "nr": "300054", - "name": "NGP 50G1, 4,00 x 50 m", - "thickness": 3.833 - }, - { - "nr": "300234", - "name": "Stex Green 30G1 GRK 2, 4,00 x 75", - "thickness": 3.185 - }, - { - "nr": "300240", - "name": "Stex Green 40G1 GRK 3, 6,00 x 75 m", - "thickness": 3.232 - }, - { - "nr": "300244", - "name": "Stex Green 40G1 GRK 3, 4,00 x 75 m", - "thickness": 3.881 - }, - { - "nr": "300264", - "name": "Stex Green 60G1 GRK 4, 4,00 x 75", - "thickness": 6.017 - }, - { - "nr": "300294", - "name": "Stex Green 90G1 GRK 5, 4,00 x 50 m", - "thickness": 5.649 - }, - { - "nr": "300450", - "name": "NGP (Naue GlacierProtect) 50G1-G3 C, 4,00 x 50 m", - "thickness": 1.978 - }, - { - "nr": "300470", - "name": "Stex Green 120 G3 (moosbraun) 6,00 x 50 m", - "thickness": 6.911 - }, - { - "nr": "553085", - "name": "Bfix BFG 5000, 5,00 x 40 m", - "thickness": 7.084 - }, - { - "nr": "553095", - "name": "Bfix BFG 5000, 2,50 x 15 m", - "thickness": 6.8 - }, - { - "nr": "553108", - "name": "Bfix BFG 5000, 1,20 x 36 m (2 Ro. auf 1 Kern)", - "thickness": 6.973 - }, - { - "nr": "56400", - "name": "Stex R 1501, 5,80 x 50 m", - "thickness": 10.151 - }, - { - "nr": "6001014", - "name": "Carbofol PEHD 507 2,5 5,10 G/G", - "thickness": 2.646 - }, - { - "nr": "6001312", - "name": "HDPE 612 2,0 5,0 g/g DIBT", - "thickness": 1.944 - }, - { - "nr": "6001313", - "name": "HDPE 612 2,5 5,0 g/g DIBT", - "thickness": 2.506 - }, - { - "nr": "6001315", - "name": "HDPE 612 3,0 5,0 g/g DIBT", - "thickness": 2.963 - }, - { - "nr": "6001316", - "name": "HDPE 612 2,0 7,50 g/g DIBt", - "thickness": 1.96 - }, - { - "nr": "6002010", - "name": "HDPE 406 1,0 5,00 G/G OIT", - "thickness": 0.955 - }, - { - "nr": "6002011", - "name": "HDPE 406 1,5 5,10 s/s", - "thickness": 1.443 - }, - { - "nr": "6002013", - "name": "HDPE 406 2,0 5,10 s/s", - "thickness": 1.929 - }, - { - "nr": "6002015", - "name": "Carbofol HDPE 406 3,0 5,10 s/s", - "thickness": 3.004 - }, - { - "nr": "6005351", - "name": "HDPE 612 2,0 5,10 F/F DIBt", - "thickness": 0.0 - }, - { - "nr": "6005352", - "name": "HDPE 612 2,5 5,10 F/F DIBt", - "thickness": 0.0 - }, - { - "nr": "6007033", - "name": "Carbofol PEHD 507 2,5 MF/MF", - "thickness": 0.0 - }, - { - "nr": "6008812", - "name": "HDPE 406 1,0 5,10 F/F GM13", - "thickness": 0.0 - }, - { - "nr": "6008843", - "name": "HDPE 406 1,5 5,10 F/F GM13", - "thickness": 0.0 - }, - { - "nr": "6008852", - "name": "PEHD 406 2,0 5,10 F/F DB", - "thickness": 0.0 - }, - { - "nr": "6008854", - "name": "HDPE 406 2,0 5,10 F/F GM13", - "thickness": 0.0 - }, - { - "nr": "6009014", - "name": "Carbofol PEHD 510 2,5 5,10 G/G BAM", - "thickness": 2.628 - }, - { - "nr": "6009033", - "name": "PEHD 510 2,5 5,10 MF/MF BAM", - "thickness": 0.0 - }, - { - "nr": "6101255", - "name": "TUN 2,0 5,0", - "thickness": 2.158 - }, - { - "nr": "6101257", - "name": "CARBOFOL TUNNEL 2.0 SVN", - "thickness": 2.341 - }, - { - "nr": "6101258", - "name": "TUN 2.0 P 5,0", - "thickness": 2.078 - }, - { - "nr": "6101265", - "name": "TUN 3,0 2,50 G/G", - "thickness": 3.144 - }, - { - "nr": "6101280", - "name": "CARBOFOL TUNNEL 3.0 F", - "thickness": 3.171 - }, - { - "nr": "6101300", - "name": "Carbofol HDPE 406 1,4 s/s TUN", - "thickness": 1.428 - }, - { - "nr": "6101302", - "name": "Carbofol HDPE 406 1,5 s/s TUN", - "thickness": 1.536 - }, - { - "nr": "610310", - "name": "Carbofol HDPE 406 1,5 F/s TUN", - "thickness": 1.511 - }, - { - "nr": "6110210", - "name": "PEHD 406 1,0 7,5 G/G OIT", - "thickness": 0.97 - }, - { - "nr": "6110213", - "name": "HDPE 406 1,0 7,5 s/s GM13", - "thickness": 1.019 - }, - { - "nr": "6110220", - "name": "PEHD 406 1,5 7,5 G/G OIT", - "thickness": 1.496 - }, - { - "nr": "6110223", - "name": "HDPE 406 1,5 7,5 s/s GM13", - "thickness": 1.512 - }, - { - "nr": "6110225", - "name": "HDPE 406 1,5 7,5 BF/TF GM13", - "thickness": 0.0 - }, - { - "nr": "6110226", - "name": "HDPE 406 1,5 7,5 BF/TF GM13 MT", - "thickness": 0.0 - }, - { - "nr": "6110227", - "name": "HDPE 406 1,5 7,5 BF/TF GM13 MA", - "thickness": 0.0 - }, - { - "nr": "6110230", - "name": "PEHD 406 2,0 7,5 G/G OIT", - "thickness": 1.931 - }, - { - "nr": "6110232", - "name": "HDPE 406 2,0 7,5 s/s RT", - "thickness": 1.827 - }, - { - "nr": "6110233", - "name": "HDPE 406 2,0 7,5 s/s GM13", - "thickness": 2.019 - }, - { - "nr": "6110235", - "name": "HDPE 406 2,0 7,5 BF/TF GM13", - "thickness": 2.079 - }, - { - "nr": "6110239", - "name": "HDPE 406 2,0 7,5 s/s KIWA", - "thickness": 2.017 - }, - { - "nr": "6110240", - "name": "PEHD 406 2,5 7,5 G/G OIT", - "thickness": 2.406 - }, - { - "nr": "6110245", - "name": "HDPE 406 2,5 7,5 BF/TF GM13", - "thickness": 0.0 - }, - { - "nr": "6110251", - "name": "HDPE 406 2,0 7,5 s/s MT", - "thickness": 2.03 - }, - { - "nr": "6110258", - "name": "Carbofol HDPE 407 1,5 7,5 s/s AS", - "thickness": 1.532 - }, - { - "nr": "6110262", - "name": "HDPE 406 2,0 7,5 BF/TF KIWA", - "thickness": 0.0 - }, - { - "nr": "6110264", - "name": "HDPE 406 2,0 7,5 BF/s", - "thickness": 0.0 - }, - { - "nr": "6110268", - "name": "Carbofol HDPE 407 2,0 7,5 s/s AS", - "thickness": 2.034 - }, - { - "nr": "6110293", - "name": "HDPE 406 2,0 7,5 BF/s MA (ASTM)", - "thickness": 0.0 - }, - { - "nr": "6110737", - "name": "CARBOFOL HDPE 406 1,0 s/s (r-30%)", - "thickness": 0.965 - }, - { - "nr": "72602", - "name": "Stex RZ 1331, 6,00 x 50 m", - "thickness": 9.527 - }, - { - "nr": "8180005", - "name": "Bfix NSP 4000, 5,00 x 50 m", - "thickness": 6.275 - }, - { - "nr": "8180105", - "name": "Bfix NSP 4300, 5,00 x 50 m", - "thickness": 6.322 - }, - { - "nr": "8180205", - "name": "Bfix NSP 4900, 5,00 x 40 m", - "thickness": 6.975 - }, - { - "nr": "8180305", - "name": "Bfix NSP 5300, 5,00 x 40 m", - "thickness": 7.261 - }, - { - "nr": "8182605", - "name": "Bfix X2 NSP 4900(with edge i./coat.bottom)4,85x40m", - "thickness": 6.697 - }, - { - "nr": "8182615", - "name": "Bfix X2 NSP 4900(with edge i./coat.on top)4,85x40m", - "thickness": 6.65 - }, - { - "nr": "8190200", - "name": "Bfix X2 NSP 4000 (with edge i./coat.bott.)4,85x50m", - "thickness": 5.811 - }, - { - "nr": "8190210", - "name": "Bfix X2 NSP 4000(with edge i./coat.on top)4,85x50m", - "thickness": 5.861 - }, - { - "nr": "8205705", - "name": "Bfix X2 NSP 3300, 4,85 x 50 m", - "thickness": 5.73 - }, - { - "nr": "8206600", - "name": "Bfix X5F NSP 4900, 4,85 x 35 m", - "thickness": 7.699 - }, - { - "nr": "8206601", - "name": "Bfix X5F NSP 4900, 4,85 x 35 m", - "thickness": 7.985 - }, - { - "nr": "8206720", - "name": "Bfix X10F NSP 4900 (top coating), 4,70 x 30 m", - "thickness": 8.38 - }, - { - "nr": "8207100", - "name": "Bfix B 5100 c, 5,00 x 40 m", - "thickness": 8.165 - }, - { - "nr": "8208320", - "name": "Bfix X2 NSP4900(5300)2,42x25,5", - "thickness": 6.573 - }, - { - "nr": "8208701", - "name": "Bfix B 5200 a (GRI GCL3), 5,00 x >30 m", - "thickness": 8.353 - }, - { - "nr": "8208702", - "name": "Bfix B 5200 a (GRI GCL3) 5.00 x 70 m", - "thickness": 8.575 - }, - { - "nr": "8208703", - "name": "Bfix B 5500 a 5,00 x 40 m", - "thickness": 8.153 - }, - { - "nr": "8208800", - "name": "Bfix NSP 5000 a, 5,00 x 40 m", - "thickness": 7.25 - }, - { - "nr": "8208920", - "name": "Bfix B 5600 k, 5,00 x 30 m", - "thickness": 8.5 - }, - { - "nr": "8209100", - "name": "Bfix B 5000 d, 5,00 x 35 m", - "thickness": 8.755 - }, - { - "nr": "8209500", - "name": "Bfix NSP 4000 (BentoLinerยฎ GCL 4000N) 5.00 x 50 m", - "thickness": 6.445 - }, - { - "nr": "8209600", - "name": "Bfix X5F NSP 4900 a (top coating), 4,85 x 35 m", - "thickness": 7.32 - }, - { - "nr": "8209700", - "name": "Bfix B 5300 e, 5,00 x 30 m", - "thickness": 9.394 - }, - { - "nr": "8209800", - "name": "Bfix NSP 4300 A, 5.00 x 50 m", - "thickness": 6.949 - }, - { - "nr": "8209900", - "name": "Bfix B 5600, 5,00 x 30 m", - "thickness": 8.446 - }, - { - "nr": "8300132", - "name": "Stex MR 131 C, 2.90 x 100 m", - "thickness": 1.434 - }, - { - "nr": "8300200", - "name": "Stex R 201, 5,80 x 100 m", - "thickness": 3.115 - }, - { - "nr": "8300310", - "name": "Stex R 311, 5,80 x 100 m", - "thickness": 3.055 - }, - { - "nr": "8300600", - "name": "Stex R 601, 5,80 x 50 m", - "thickness": 4.92 - }, - { - "nr": "8300750", - "name": "Stex H 751, 5,80 x 50 m", - "thickness": 6.363 - }, - { - "nr": "8300800", - "name": "Stex R 801, 5,80 x 45 m", - "thickness": 6.305 - }, - { - "nr": "8300801", - "name": "Stex R 801 5.80 x 50 m", - "thickness": 6.454 - }, - { - "nr": "8301000", - "name": "Stex R 1001, 5,80 x 40 m", - "thickness": 6.701 - }, - { - "nr": "8301200", - "name": "Stex R 1201, 5,80 x 30 m", - "thickness": 8.117 - }, - { - "nr": "8301400", - "name": "Stex R 401, 5,80 x 70 m", - "thickness": 3.865 - }, - { - "nr": "8301500", - "name": "Stex R 501, 5,80 x 55 m", - "thickness": 4.462 - }, - { - "nr": "8301501", - "name": "Stex H 501, 5,80 x 50 m", - "thickness": 5.016 - }, - { - "nr": "8301700", - "name": "Stex MR 1701, 5,80 x 25 m", - "thickness": 10.648 - }, - { - "nr": "8301800", - "name": "Stex RS 801 a, 5,80 x 45 m", - "thickness": 6.712 - }, - { - "nr": "8302500", - "name": "Stex MR 501, 5,80 x 60 m", - "thickness": 4.493 - }, - { - "nr": "8302600", - "name": "Stex MR 601, 5,80 x 50 m", - "thickness": 5.028 - }, - { - "nr": "8305200", - "name": "Stex RS 1201, 5,80 x 40 m", - "thickness": 7.625 - }, - { - "nr": "8305420", - "name": "Stex MR 281, 5,80 x 120 m", - "thickness": 2.905 - }, - { - "nr": "8305430", - "name": "Stex MR 401, 5,80 x 85 m", - "thickness": 3.66 - }, - { - "nr": "8305540", - "name": "Stex MR 401-EH, 5.80 x 65 m", - "thickness": 4.023 - }, - { - "nr": "8305600", - "name": "Stex MR 181 C, 5,80 x 260 m", - "thickness": 1.067 - }, - { - "nr": "8305620", - "name": "Stex MR 281 C, 5,80 x 170 m", - "thickness": 1.79 - }, - { - "nr": "8305640", - "name": "Stex MR 131 C, 5.80 x 390 m", - "thickness": 0.882 - }, - { - "nr": "8305650", - "name": "Stex MR 151 C, 5.80 x 270 m", - "thickness": 1.025 - }, - { - "nr": "8305651", - "name": "Stex MR 151 C 5.80 x 100 m", - "thickness": 1.041 - }, - { - "nr": "8305660", - "name": "Stex MR 201 C, 5.80 x 210 m", - "thickness": 1.256 - }, - { - "nr": "8305670", - "name": "Stex MR 251 C, 5.80 x 180 m", - "thickness": 1.588 - }, - { - "nr": "8305680", - "name": "Stex MR 301 C, 5.80 x 140 m", - "thickness": 1.865 - }, - { - "nr": "8305690", - "name": "Stex MR 201, 5.80 x 165 m", - "thickness": 2.458 - }, - { - "nr": "8305710", - "name": "Stex MR 301, 5.80 x 100 m", - "thickness": 3.01 - }, - { - "nr": "8305730", - "name": "Stex Green 30G1, 5.80 x 85 m", - "thickness": 3.185 - }, - { - "nr": "8305760", - "name": "Stex Green 60G1, 5.80 x 65 m", - "thickness": 4.604 - }, - { - "nr": "8306020", - "name": "Stex MR 1901, 5.80 x 40 m", - "thickness": 10.773 - }, - { - "nr": "8306030", - "name": "Stex MR 201 C a 5,80 x 140 m", - "thickness": 2.103 - }, - { - "nr": "8306050", - "name": "Stex MR 551 5,80 x 55 m", - "thickness": 4.392 - }, - { - "nr": "84106", - "name": "Stex R 2001, 6,00 x 40 m", - "thickness": 10.943 - }, - { - "nr": "8553109", - "name": "Bfix BFG 5000, 2,50 x 25,5 m", - "thickness": 7.482 - }, - { - "nr": "00001", - "name": "Test", - "thickness": 5.5, - "area_weight": 5100 - } -] \ No newline at end of file diff --git a/static/service-worker.js.backup b/static/service-worker.js.backup deleted file mode 100644 index 97e6e6b..0000000 --- a/static/service-worker.js.backup +++ /dev/null @@ -1,226 +0,0 @@ -/** - * SERVICE WORKER FOR NAUE ROLL CALCULATOR - * ======================================== - * Caching strategy: - * 1. CACHE_FIRST for static assets (CSS, JS, images) - * 2. NETWORK_FIRST for API/data (with fallback to cache) - * 3. STALE_WHILE_REVALIDATE for article data - */ - -const CACHE_NAME = 'rollcalc-v14-' + new Date().getTime(); -const STATIC_CACHE = 'rollcalc-static-v14'; -const DATA_CACHE = 'rollcalc-data-v14'; - -// Assets to cache on install -const STATIC_ASSETS = [ - '/', - '/index.html', - '/static/article-data.json', - '/static/config.json' -]; - -// =================================================================== -// INSTALL EVENT - Cache static assets -// =================================================================== -self.addEventListener('install', event => { - console.log('[ServiceWorker] Installing...'); - - event.waitUntil( - caches.open(STATIC_CACHE) - .then(cache => { - console.log('[ServiceWorker] Caching static assets'); - return cache.addAll(STATIC_ASSETS).catch(err => { - console.warn('[ServiceWorker] Some assets failed to cache:', err); - // Don't fail installation if some assets can't be cached - return Promise.resolve(); - }); - }) - .then(() => self.skipWaiting()) - ); -}); - -// =================================================================== -// ACTIVATE EVENT - Clean up old caches -// =================================================================== -self.addEventListener('activate', event => { - console.log('[ServiceWorker] Activating...'); - - event.waitUntil( - caches.keys().then(cacheNames => { - return Promise.all( - cacheNames.map(cacheName => { - if (cacheName !== STATIC_CACHE && - cacheName !== DATA_CACHE && - cacheName !== CACHE_NAME) { - console.log('[ServiceWorker] Deleting old cache:', cacheName); - return caches.delete(cacheName); - } - }) - ); - }).then(() => self.clients.claim()) - ); -}); - -// =================================================================== -// FETCH EVENT - Intelligent caching strategy -// =================================================================== -self.addEventListener('fetch', event => { - const { request } = event; - const url = new URL(request.url); - - // Skip cross-origin requests - if (url.origin !== location.origin) { - return; - } - - // --------------------------------------------------------------- - // 1. JSON DATA (article-data.json, config.json) - // STALE_WHILE_REVALIDATE: Use cache first, update in background - // --------------------------------------------------------------- - if (url.pathname.includes('.json')) { - event.respondWith( - caches.open(DATA_CACHE).then(cache => { - return cache.match(request).then(response => { - const fetchPromise = fetch(request).then(networkResponse => { - // Update cache with fresh version - if (networkResponse && networkResponse.status === 200) { - cache.put(request, networkResponse.clone()); - } - return networkResponse; - }).catch(() => { - // Network failed, return cached version - return response || cacheNotFound('JSON data not found'); - }); - - // Return cached response immediately, update in background - return response || fetchPromise; - }); - }) - ); - return; - } - - // --------------------------------------------------------------- - // 2. HTML PAGES - // NETWORK_FIRST: Try network, fall back to cache - // --------------------------------------------------------------- - if (request.method === 'GET' && - (url.pathname === '/' || url.pathname.endsWith('.html'))) { - event.respondWith( - fetch(request) - .then(response => { - if (response && response.status === 200) { - const cache_copy = response.clone(); - caches.open(STATIC_CACHE).then(cache => { - cache.put(request, cache_copy); - }); - } - return response; - }) - .catch(() => { - return caches.match(request) - .then(response => response || cacheNotFound('Page not found')); - }) - ); - return; - } - - // --------------------------------------------------------------- - // 3. STATIC ASSETS (CSS, JS, images) - // CACHE_FIRST: Use cache if available, fall back to network - // --------------------------------------------------------------- - if (request.method === 'GET') { - event.respondWith( - caches.open(STATIC_CACHE).then(cache => { - return cache.match(request).then(response => { - if (response) { - return response; - } - - return fetch(request).then(networkResponse => { - // Only cache successful responses - if (networkResponse && networkResponse.status === 200) { - cache.put(request, networkResponse.clone()); - } - return networkResponse; - }).catch(() => { - // Return offline placeholder - if (request.destination === 'image') { - return createPlaceholderImage(); - } - return cacheNotFound('Asset not found'); - }); - }); - }) - ); - return; - } - - // --------------------------------------------------------------- - // 4. POST/PUT/DELETE (API calls) - // NETWORK_ONLY: Do not cache, but handle errors gracefully - // --------------------------------------------------------------- - if (['POST', 'PUT', 'DELETE'].includes(request.method)) { - event.respondWith( - fetch(request) - .catch(() => { - return new Response( - JSON.stringify({ - error: 'You are offline. API calls are not available.', - status: 'offline' - }), - { - status: 503, - statusText: 'Service Unavailable', - headers: new Headers({ - 'Content-Type': 'application/json' - }) - } - ); - }) - ); - return; - } -}); - -// =================================================================== -// HELPER FUNCTIONS -// =================================================================== - -function cacheNotFound(message) { - return new Response( - ` -

Offline

-

${message}

-

Roll Calculator is offline or the resource is not cached.

- `, - { - status: 404, - statusText: 'Not Found', - headers: new Headers({ - 'Content-Type': 'text/html' - }) - } - ); -} - -function createPlaceholderImage() { - const svg = ` - - - Image offline - - `; - - return new Response(svg, { - headers: { - 'Content-Type': 'image/svg+xml', - 'Cache-Control': 'public, max-age=86400' - } - }); -} - -// =================================================================== -// LOG SERVICE WORKER STATUS -// =================================================================== -console.log('[ServiceWorker] Naue Roll Calculator Service Worker loaded'); diff --git a/templates/roll_calculator.html.backup b/templates/roll_calculator.html.backup deleted file mode 100644 index 85e3eea..0000000 --- a/templates/roll_calculator.html.backup +++ /dev/null @@ -1,1933 +0,0 @@ - - - - - - - - - - Roll Diameter Calculator - - - - - -
-
-
⚠ BETA VERSION · INTERNAL USE ONLY
-

Roll Diameter Calculator – Naue GmbH & Co. KG

- -
-

🔒 Authorized Departments Only / Nur autorisierte Abteilungen

- This tool is exclusively intended for internal use by:
- Production Planning · Logistics · Product Management

- Dieses Tool ist ausschließlich für den internen Gebrauch in:
- Produktionsplanung · Logistik · Produktmanagement -
- -
-

🧪 Beta-Status

- This application is in Beta. Results should be verified before operational use.
- Diese Anwendung befindet sich im Beta-Stadium. Ergebnisse sind vor dem produktiven Einsatz zu überprüfen. -
- -
-

📊 Product Thickness Values

- Pre-filled product thickness values are derived from an automated data evaluation and serve as a starting point only. - They must be independently verified before use in any calculation.
- Die vorgeschlagenen Produktdicken stammen aus einer automatischen Datenauswertung und müssen vor Verwendung in Berechnungen eigenständig überprüft werden. -
- -
- - -
- -
- - -
-
-
- - -
-
-
- Naue - BETA - Internal -
-
Roll Diameter Calculator · Roll Diameter · Product Length · Roll Weight
-
-
- - -
- -
-
-

✎ Roll Diameter Calculator

-
-
- - -
- - -
- - -
- - -
-
- - -
-
- - -
-
- - -
- -
- - - - -
-
- - -
-
- - - - - - D - d - -
-
-
D = Roll outer diameter
-
d = Core outer diameter
-
t = Product thickness
-
L = Product length
-
-
- -
- - -

Input Parameters

- -
-
- -
- - mm -
-
- - - - - -
-
-
- - - -
-
- -
-
- -
- - ± - - mm -
-
-
- -
-
- -
- - m -
-
-
- -
- - mm -
-
-
- - -
-

Roll Weight (optional)

-
-
- -
- - m -
-
-
- -
- - g/m² -
-
-
- -
- - kg -
-
-
-
- - - -
-
-
-
-
- - -
- - - - -
- Geometry: π/4 × (D² − d²) = L × t  |  Weight: G [kg] = Area Weight [g/m²] × L [m] × Width [m] / 1000 -
- -
- - - -
- -

Known Reference Roll

- -
-
- - - -
-
- -
- - mm -
-
- - - - - -
-
-
- -
-
- -
- - mm -
-
-
- -
- - m -
-
-
- -
-

New Roll Length

- -
-
- -
- - m -
-
-
- -
- ± - - mm -
-
-
- - -
-

Roll Weight (optional)

-
-
- -
- - m -
-
-
- -
- - g/m² -
-
-
-
- -
- - -
- - - - -
- Geometry: D₁ = √(d² + L₁/L₀ × (D₀² − d²))  |  Weight: G [kg] = Area Weight × L₁ × Width / 1000 -
- -
- - -
-
- - -
- ⓘ Calculation Notes
- The calculated roll diameters assume a perfectly cylindrical roll with uniform, gap-free winding.

- The product thickness can vary during production within the permitted manufacturing tolerance. - The actual roll diameter may therefore differ from the calculated values.

- Use the ± Tolerance field next to the product thickness to estimate this effect – the result will then show the minimum, nominal and maximum roll diameter. -
- - -
- -
- ▼ -

🎯 Load Optimizer – Transport Capacity Calculator

- BETA -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -