Files
mc-webui/app/routes/views.py
T
MarekWo 83b51ab2b9 refactor(dm): Replace modal with full-page view and fix sent DM tracking
- Replace DM modal with full-page view at /dm route for better mobile UX
- Add workaround for meshcore-cli bug where SENT_MSG contains sender's
  name instead of recipient - now saving sent DMs to separate log file
- Fix DM button styling to match Reply button (btn-outline-secondary)
- Add dm.js for DM page functionality
- Add dm.html template with green navbar for visual distinction
- Update menu link to navigate to /dm instead of opening modal
- Remove unused DM modal functions from app.js
- Update documentation with new DM workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:27:02 +01:00

50 lines
1.0 KiB
Python

"""
HTML views for mc-webui
"""
import logging
from flask import Blueprint, render_template, request
from app.config import config
logger = logging.getLogger(__name__)
views_bp = Blueprint('views', __name__)
@views_bp.route('/')
def index():
"""
Main chat view - displays message list and send form.
"""
return render_template(
'index.html',
device_name=config.MC_DEVICE_NAME,
refresh_interval=config.MC_REFRESH_INTERVAL
)
@views_bp.route('/dm')
def direct_messages():
"""
Direct Messages view - full-page DM interface.
Query params:
conversation: Optional conversation ID to open initially
"""
initial_conversation = request.args.get('conversation', '')
return render_template(
'dm.html',
device_name=config.MC_DEVICE_NAME,
refresh_interval=config.MC_REFRESH_INTERVAL,
initial_conversation=initial_conversation
)
@views_bp.route('/health')
def health():
"""
Health check endpoint for monitoring.
"""
return 'OK', 200