DevNumb commited on
Commit
2732f53
Β·
verified Β·
1 Parent(s): 4a95c8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -457,14 +457,14 @@ HTML_DASHBOARD = """
457
  </div>
458
 
459
  <div class="card">
460
- <h2>πŸ“Š Input Parameters</h2>
461
  <div class="form-grid">
462
  <div class="form-group">
463
- <label>πŸ• Hour (0-23)</label>
464
  <input type="number" id="hour" min="0" max="23" value="14">
465
  </div>
466
  <div class="form-group">
467
- <label>πŸ“… Day of Week</label>
468
  <select id="dayofweek">
469
  <option value="0">Monday</option><option value="1">Tuesday</option>
470
  <option value="2" selected>Wednesday</option><option value="3">Thursday</option>
@@ -473,7 +473,7 @@ HTML_DASHBOARD = """
473
  </select>
474
  </div>
475
  <div class="form-group">
476
- <label>πŸ“… Month</label>
477
  <select id="month">
478
  <option value="1">January</option><option value="2">February</option>
479
  <option value="3">March</option><option value="4">April</option>
@@ -495,7 +495,7 @@ HTML_DASHBOARD = """
495
  <div id="results" style="display: none;"></div>
496
 
497
  <div class="footer">
498
- <p>Powered by Random Forest AI | Real-time optimization | York Chiller Certified</p>
499
  </div>
500
  </div>
501
 
@@ -507,14 +507,14 @@ HTML_DASHBOARD = """
507
  const data = await response.json();
508
  document.getElementById('statusDot').classList.add('online');
509
  document.getElementById('statusText').textContent = 'API Online';
510
- document.getElementById('modelBadge').innerHTML = `πŸ€– ${data.model_type || 'AI Model'} | Active`;
511
  } else {
512
  throw new Error('API not responding');
513
  }
514
  } catch (error) {
515
  document.getElementById('statusDot').classList.remove('online');
516
  document.getElementById('statusText').textContent = 'API Offline';
517
- document.getElementById('modelBadge').innerHTML = '⚠️ Fallback Mode';
518
  }
519
  }
520
 
@@ -577,7 +577,7 @@ HTML_DASHBOARD = """
577
  </div>
578
  <div><strong>Current:</strong> ${rec.current}</div>
579
  <div><strong>Recommended:</strong> ${rec.recommended}</div>
580
- <div class="recommendation-saving">πŸ’° Saving: ${rec.saving_kw} kW</div>
581
  </div>
582
  `;
583
  }
@@ -585,17 +585,17 @@ HTML_DASHBOARD = """
585
  resultsDiv.innerHTML = `
586
  <div class="card">
587
  <div class="prediction-box">
588
- <div>⚑ Predicted Power</div>
589
  <div class="value">${data.predicted_power_kw.toFixed(1)} <span style="font-size: 20px;">kW</span></div>
590
  </div>
591
  <div class="savings-box">
592
- <div>πŸ’° Total Potential Savings</div>
593
  <div class="value">${data.total_saving_kw.toFixed(1)} <span style="font-size: 16px;">kW</span></div>
594
  </div>
595
- <h2 style="margin-top: 20px;">🎯 Optimization Recommendations</h2>
596
  ${recommendationsHtml}
597
  <div style="margin-top: 20px; padding: 12px; background: #f0f2f5; border-radius: 8px; font-size: 12px;">
598
- πŸ€– Model: ${data.model_info.type} | ${data.model_info.loaded ? 'Active' : 'Fallback Mode'}
599
  </div>
600
  </div>
601
  `;
 
457
  </div>
458
 
459
  <div class="card">
460
+ <h2>Input Parameters</h2>
461
  <div class="form-grid">
462
  <div class="form-group">
463
+ <label> Hour (0-23)</label>
464
  <input type="number" id="hour" min="0" max="23" value="14">
465
  </div>
466
  <div class="form-group">
467
+ <label> Day of Week</label>
468
  <select id="dayofweek">
469
  <option value="0">Monday</option><option value="1">Tuesday</option>
470
  <option value="2" selected>Wednesday</option><option value="3">Thursday</option>
 
473
  </select>
474
  </div>
475
  <div class="form-group">
476
+ <label> Month</label>
477
  <select id="month">
478
  <option value="1">January</option><option value="2">February</option>
479
  <option value="3">March</option><option value="4">April</option>
 
495
  <div id="results" style="display: none;"></div>
496
 
497
  <div class="footer">
498
+ <p>Powered by Random Forest AI </p>
499
  </div>
500
  </div>
501
 
 
507
  const data = await response.json();
508
  document.getElementById('statusDot').classList.add('online');
509
  document.getElementById('statusText').textContent = 'API Online';
510
+ document.getElementById('modelBadge').innerHTML = ` ${data.model_type || 'AI Model'} | Active`;
511
  } else {
512
  throw new Error('API not responding');
513
  }
514
  } catch (error) {
515
  document.getElementById('statusDot').classList.remove('online');
516
  document.getElementById('statusText').textContent = 'API Offline';
517
+ document.getElementById('modelBadge').innerHTML = ' Fallback Mode';
518
  }
519
  }
520
 
 
577
  </div>
578
  <div><strong>Current:</strong> ${rec.current}</div>
579
  <div><strong>Recommended:</strong> ${rec.recommended}</div>
580
+ <div class="recommendation-saving"> Saving: ${rec.saving_kw} kW</div>
581
  </div>
582
  `;
583
  }
 
585
  resultsDiv.innerHTML = `
586
  <div class="card">
587
  <div class="prediction-box">
588
+ <div> Predicted Power</div>
589
  <div class="value">${data.predicted_power_kw.toFixed(1)} <span style="font-size: 20px;">kW</span></div>
590
  </div>
591
  <div class="savings-box">
592
+ <div> Total Potential Savings</div>
593
  <div class="value">${data.total_saving_kw.toFixed(1)} <span style="font-size: 16px;">kW</span></div>
594
  </div>
595
+ <h2 style="margin-top: 20px;"> Optimization Recommendations</h2>
596
  ${recommendationsHtml}
597
  <div style="margin-top: 20px; padding: 12px; background: #f0f2f5; border-radius: 8px; font-size: 12px;">
598
+ Model: ${data.model_info.type} | ${data.model_info.loaded ? 'Active' : 'Fallback Mode'}
599
  </div>
600
  </div>
601
  `;