|
|
|
|
@ -12,6 +12,9 @@ import traceback
|
|
|
|
|
# Load environment variables from .env file
|
|
|
|
|
load_dotenv()
|
|
|
|
|
|
|
|
|
|
# Base URL configuration from environment variable, default to empty string if not set
|
|
|
|
|
BASE_URL = os.getenv("BASE_URL", "")
|
|
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
# Database configuration from environment variables
|
|
|
|
|
@ -200,7 +203,7 @@ def analyze_data(df, part_info_df):
|
|
|
|
|
@app.route('/')
|
|
|
|
|
def index():
|
|
|
|
|
"""Render the main monitoring dashboard"""
|
|
|
|
|
return render_template('index.html')
|
|
|
|
|
return render_template('index.html', base_url=BASE_URL)
|
|
|
|
|
|
|
|
|
|
def fetch_part_history(part_id, days=14):
|
|
|
|
|
"""Fetch historical data for a specific part_id for the last 'days' days"""
|
|
|
|
|
|