seawolf2357 commited on
Commit
3541d20
ยท
verified ยท
1 Parent(s): 2dd1207

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +83 -14
app.py CHANGED
@@ -2672,26 +2672,95 @@ async def whisper_realtime_stream(session_id: str):
2672
  @app.get("/")
2673
  async def index():
2674
  """Serve the HTML page"""
2675
- try:
2676
- # ๊ฐ„๋‹จํ•œ ํ…Œ์ŠคํŠธ HTML ๋ฐ˜ํ™˜
2677
- return HTMLResponse(content="""
2678
- <!DOCTYPE html>
2679
- <html>
2680
  <head>
2681
- <title>Test</title>
 
 
 
 
 
 
 
 
2682
  </head>
2683
  <body>
2684
- <h1>์„œ๋ฒ„ ์ž‘๋™ ํ™•์ธ</h1>
2685
- <button onclick="alert('ํด๋ฆญ๋จ')">ํ…Œ์ŠคํŠธ</button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
  <script>
2687
- console.log('JavaScript ์‹คํ–‰๋จ');
2688
- document.body.style.backgroundColor = 'yellow';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2689
  </script>
2690
  </body>
2691
- </html>
2692
- """)
2693
- except Exception as e:
2694
- return JSONResponse({"error": str(e)}, status_code=500)
2695
 
2696
 
2697
  if __name__ == "__main__":
 
2672
  @app.get("/")
2673
  async def index():
2674
  """Serve the HTML page"""
2675
+ rtc_config = get_twilio_turn_credentials() if get_space() else None
2676
+
2677
+ # ๋””๋ฒ„๊น…์„ ์œ„ํ•œ ๊ฐ„๋‹จํ•œ HTML
2678
+ test_html = """<!DOCTYPE html>
2679
+ <html lang="ko">
2680
  <head>
2681
+ <meta charset="UTF-8">
2682
+ <title>MOUSE Extended</title>
2683
+ <style>
2684
+ body { background: #121212; color: white; font-family: Arial; }
2685
+ .tab-button { padding: 10px; margin: 5px; cursor: pointer; background: #333; border: none; color: white; }
2686
+ .tab-button.active { background: #666; }
2687
+ .tab-content { display: none; padding: 20px; }
2688
+ .tab-content.active { display: block; }
2689
+ </style>
2690
  </head>
2691
  <body>
2692
+ <h1>MOUSE Extended - Debug Version</h1>
2693
+
2694
+ <div>
2695
+ <button class="tab-button active" onclick="switchTab('tab1')">Tab 1</button>
2696
+ <button class="tab-button" onclick="switchTab('tab2')">Tab 2</button>
2697
+ <button class="tab-button" onclick="switchTab('tab3')">Tab 3</button>
2698
+ </div>
2699
+
2700
+ <div id="tab1" class="tab-content active">
2701
+ <h2>Voice Chat Tab</h2>
2702
+ <button onclick="testFunction()">Test Button</button>
2703
+ <div id="search-toggle" style="width:50px;height:30px;background:#666;cursor:pointer;">Search Toggle</div>
2704
+ </div>
2705
+
2706
+ <div id="tab2" class="tab-content">
2707
+ <h2>Tab 2 Content</h2>
2708
+ </div>
2709
+
2710
+ <div id="tab3" class="tab-content">
2711
+ <h2>Tab 3 Content</h2>
2712
+ </div>
2713
+
2714
  <script>
2715
+ console.log('Script started');
2716
+
2717
+ function switchTab(tabName) {
2718
+ console.log('Switching to:', tabName);
2719
+
2720
+ // Hide all tabs
2721
+ document.querySelectorAll('.tab-content').forEach(tab => {
2722
+ tab.style.display = 'none';
2723
+ tab.classList.remove('active');
2724
+ });
2725
+
2726
+ // Show selected tab
2727
+ const selectedTab = document.getElementById(tabName);
2728
+ if (selectedTab) {
2729
+ selectedTab.style.display = 'block';
2730
+ selectedTab.classList.add('active');
2731
+ }
2732
+
2733
+ // Update buttons
2734
+ document.querySelectorAll('.tab-button').forEach(btn => {
2735
+ btn.classList.remove('active');
2736
+ });
2737
+ event.target.classList.add('active');
2738
+ }
2739
+
2740
+ function testFunction() {
2741
+ alert('Test function works!');
2742
+ }
2743
+
2744
+ // Initialize after DOM loaded
2745
+ document.addEventListener('DOMContentLoaded', function() {
2746
+ console.log('DOM loaded');
2747
+
2748
+ // Search toggle test
2749
+ const searchToggle = document.getElementById('search-toggle');
2750
+ if (searchToggle) {
2751
+ searchToggle.onclick = function() {
2752
+ console.log('Search toggle clicked');
2753
+ this.style.background = this.style.background === 'red' ? '#666' : 'red';
2754
+ };
2755
+ }
2756
+ });
2757
+
2758
+ console.log('Script finished');
2759
  </script>
2760
  </body>
2761
+ </html>"""
2762
+
2763
+ return HTMLResponse(content=test_html)
 
2764
 
2765
 
2766
  if __name__ == "__main__":