Refactor main.py to implement Flask app, SQLAlchemy models for Bot and BotLog, and health check functionality. Update pyproject.toml with new dependencies and add new HTML templates for the user interface. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e72fc1b7-94bd-4d6c-801f-cbac2fae245c Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 5f598d52-420e-4e2c-88ea-a4c3e41fdcb6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/e72fc1b7-94bd-4d6c-801f-cbac2fae245c/jW8PJKQ Replit-Helium-Checkpoint-Created: true
54 lines
2.5 KiB
HTML
54 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Edit {{ bot.name }} - Bot Master{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>Edit Bot</h1>
|
|
</div>
|
|
|
|
<div class="card" style="max-width: 600px;">
|
|
<form method="POST">
|
|
<div class="form-group">
|
|
<label for="name">Bot Name *</label>
|
|
<input type="text" id="name" name="name" class="form-control" required value="{{ bot.name }}">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="description">Description</label>
|
|
<textarea id="description" name="description" class="form-control">{{ bot.description or '' }}</textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="bot_type">Bot Type</label>
|
|
<select id="bot_type" name="bot_type" class="form-control">
|
|
<option value="discord" {% if bot.bot_type == 'discord' %}selected{% endif %}>Discord Bot</option>
|
|
<option value="telegram" {% if bot.bot_type == 'telegram' %}selected{% endif %}>Telegram Bot</option>
|
|
<option value="slack" {% if bot.bot_type == 'slack' %}selected{% endif %}>Slack Bot</option>
|
|
<option value="other" {% if bot.bot_type == 'other' %}selected{% endif %}>Other</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="health_endpoint">Health Check Endpoint</label>
|
|
<input type="url" id="health_endpoint" name="health_endpoint" class="form-control" value="{{ bot.health_endpoint or '' }}" placeholder="https://your-bot.host.com:8044/health">
|
|
<small style="color: var(--text-secondary); display: block; margin-top: 0.5rem;">
|
|
The URL where your bot exposes its health/status endpoint
|
|
</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="admin_token">Admin Token</label>
|
|
<input type="password" id="admin_token" name="admin_token" class="form-control" placeholder="Leave blank to keep unchanged">
|
|
<small style="color: var(--text-secondary); display: block; margin-top: 0.5rem;">
|
|
Used for accessing protected bot management endpoints. Leave blank to keep current settings.
|
|
</small>
|
|
</div>
|
|
|
|
<div style="display: flex; gap: 1rem; margin-top: 2rem;">
|
|
<button type="submit" class="btn btn-primary">Save Changes</button>
|
|
<a href="/bots/{{ bot.id }}" class="btn btn-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|