forked from retoor/devplacepy
- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications - Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py` - Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views - Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES` - Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
40 lines
2.0 KiB
HTML
40 lines
2.0 KiB
HTML
{% extends "admin_base.html" %}
|
|
{% block extra_head %}
|
|
{{ super() }}
|
|
<link rel="stylesheet" href="{{ static_url('/static/css/services.css') }}">
|
|
<link rel="stylesheet" href="{{ static_url('/static/css/ai_usage.css') }}">
|
|
{% endblock %}
|
|
{% block admin_content %}
|
|
<div class="admin-toolbar">
|
|
<h2>AI usage</h2>
|
|
<div class="ai-usage-controls">
|
|
<label for="ai-usage-window">Window
|
|
<select id="ai-usage-window">
|
|
<option value="1">1 hour</option>
|
|
<option value="24">24 hours</option>
|
|
<option value="48" selected>48 hours</option>
|
|
<option value="168">7 days</option>
|
|
<option value="0">All time</option>
|
|
</select>
|
|
</label>
|
|
<label><input type="checkbox" id="ai-usage-divided"> Show breakdowns</label>
|
|
<span class="ai-usage-generated" data-meta="generated" role="status" aria-live="polite" aria-label="Last generated">-</span>
|
|
<form method="POST" action="/admin/ai-quota/reset-guests" class="admin-inline-form" aria-label="Reset guest quotas">
|
|
<button type="submit" class="admin-btn admin-btn-sm" data-confirm-danger data-confirm="Reset guest AI quotas for all guests?"><span class="icon">🔄</span> Reset guest quotas</button>
|
|
</form>
|
|
<form method="POST" action="/admin/ai-quota/reset-all" class="admin-inline-form" aria-label="Reset all quotas">
|
|
<button type="submit" class="admin-btn admin-btn-sm" data-confirm-danger data-confirm="Reset AI quotas for every user and guest?"><span class="icon">🔄</span> Reset all quotas</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div id="ai-usage-root" class="ai-usage" role="region" aria-label="AI usage metrics" aria-live="polite">
|
|
<p class="admin-empty" data-empty>Loading metrics...</p>
|
|
</div>
|
|
{% endblock %}
|
|
{% block extra_js %}
|
|
<script type="module" src="{{ static_url('/static/js/AiUsageMonitor.js') }}"></script>
|
|
<script type="module">
|
|
new window.AiUsageMonitor().start();
|
|
</script>
|
|
{% endblock %}
|