Bot commited on
Commit
e2bdb49
Β·
1 Parent(s): a8b35de

fix: adjust record button position and prevent backend termination from UI

Browse files
Files changed (3) hide show
  1. app.py +3 -5
  2. static/main.js +2 -0
  3. static/style.css +5 -10
app.py CHANGED
@@ -51,11 +51,9 @@ def update_theme():
51
 
52
  @app.route('/kill', methods=['POST'])
53
  def kill_server():
54
- """Kill the backend server gracefully."""
55
- print("Received kill request from client. Shutting down...")
56
- # Send SIGINT to own process to trigger graceful Werkzeug shutdown
57
- os.kill(os.getpid(), signal.SIGINT)
58
- return jsonify({'status': 'success', 'message': 'Server terminating'})
59
 
60
 
61
  def sigint_handler(sig, frame):
 
51
 
52
  @app.route('/kill', methods=['POST'])
53
  def kill_server():
54
+ """Disconnect client and kill UI without shutting down the backend server."""
55
+ print("Received kill request from client. Disconnecting client session...")
56
+ return jsonify({'status': 'success', 'message': 'Client session terminated. Server remains running.'})
 
 
57
 
58
 
59
  def sigint_handler(sig, frame):
static/main.js CHANGED
@@ -695,6 +695,8 @@ controlsContainer.appendChild(killBtn);
695
  // RECORDING LOGIC
696
  // ─────────────────────────────────────────────────────────────
697
  const recordBtn = document.getElementById('recordBtn');
 
 
698
  const statusPill = document.getElementById('recordingStatusPill');
699
  const statusText = document.getElementById('recordingStatusText');
700
  let mediaRecorder = null;
 
695
  // RECORDING LOGIC
696
  // ─────────────────────────────────────────────────────────────
697
  const recordBtn = document.getElementById('recordBtn');
698
+ controlsContainer.insertBefore(recordBtn, controlsContainer.firstChild);
699
+
700
  const statusPill = document.getElementById('recordingStatusPill');
701
  const statusText = document.getElementById('recordingStatusText');
702
  let mediaRecorder = null;
static/style.css CHANGED
@@ -400,24 +400,20 @@ html, body {
400
  }
401
 
402
  .record-btn {
403
- position: absolute;
404
- bottom: 24px;
405
- left: 50%;
406
- transform: translateX(-50%);
407
  background: rgba(255, 255, 255, 0.1);
408
  backdrop-filter: blur(14px);
409
  -webkit-backdrop-filter: blur(14px);
410
  border: 1px solid rgba(255, 255, 255, 0.2);
411
  border-radius: 30px;
412
- padding: 10px 20px;
413
  display: flex;
414
  align-items: center;
415
- gap: 10px;
416
- z-index: 100;
417
  cursor: pointer;
418
  transition: all 0.3s ease;
419
  color: #fff;
420
  font-family: inherit;
 
421
  font-weight: 600;
422
  }
423
 
@@ -455,9 +451,8 @@ html, body {
455
  font-size: 12px;
456
  }
457
  .record-btn {
458
- bottom: 12px;
459
- padding: 8px 16px;
460
- font-size: 12px;
461
  }
462
  .record-icon {
463
  width: 14px;
 
400
  }
401
 
402
  .record-btn {
 
 
 
 
403
  background: rgba(255, 255, 255, 0.1);
404
  backdrop-filter: blur(14px);
405
  -webkit-backdrop-filter: blur(14px);
406
  border: 1px solid rgba(255, 255, 255, 0.2);
407
  border-radius: 30px;
408
+ padding: 10px 18px;
409
  display: flex;
410
  align-items: center;
411
+ gap: 6px;
 
412
  cursor: pointer;
413
  transition: all 0.3s ease;
414
  color: #fff;
415
  font-family: inherit;
416
+ font-size: 13px;
417
  font-weight: 600;
418
  }
419
 
 
451
  font-size: 12px;
452
  }
453
  .record-btn {
454
+ padding: 8px 12px;
455
+ font-size: 11px;
 
456
  }
457
  .record-icon {
458
  width: 14px;