Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ifpen/chalk-it
Browse files Browse the repository at this point in the history
  • Loading branch information
bengaid committed Dec 12, 2024
2 parents ec7fd26 + 38ba01b commit dfba73e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
10 changes: 2 additions & 8 deletions back_end/common/template_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@


from flask import render_template_string
import re
import os
import json
from pathlib import Path

Expand Down Expand Up @@ -50,12 +48,8 @@ def render_template(cls, root_dir: str, xprjson_path: str, file_name: str) -> st

# Prepare the script with dynamic JSON data
script = f"""
<script type="text/javascript">
try {{
window.chalkitLoadDashboard({json.dumps(config_data)});
}} catch (error) {{
console.error('Error loading dashboard:', error);
}}
<script id="dashboard_data" type="application/json">
{json.dumps(config_data)}
</script>
"""

Expand Down
8 changes: 2 additions & 6 deletions back_end/render/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ class RenderApp:
def __init__(self) -> None:
"""Initialize the Flask app, configure paths, and set up routes."""
# Instance-specific attributes
self.XPRJSON_FILE_PATH = (
Path(__file__).resolve().parent.parent.parent / "untitled.xprjson"
)
self.XPRJSON_FILE_PATH = Path("dashboard.xprjson")
self.DEBUG = False
# Determine the base directory for HTML templates
self.BASE_DIR = (
Path(__file__).resolve().parent.parent.parent / "front-end" / "build"
)
self.BASE_DIR = Path(__file__).parent.parent.resolve()

# Flask app and blueprint setup
self.app: Flask = Flask(__name__)
Expand Down

0 comments on commit dfba73e

Please sign in to comment.