Files
devplacepy/devplacepy/templates/containers_edit.html
T
retoor 741d7aade6
DevPlace CI / test (push) Failing after 2m7s
docs: add block/mute user relations, emoji-sync CLI, and uid indexes
- 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
2026-06-19 08:06:09 +00:00

61 lines
2.8 KiB
HTML

{% extends "admin_base.html" %}
{% block extra_head %}
{{ super() }}
<link rel="stylesheet" href="{{ static_url('/static/css/containers.css') }}">
{% endblock %}
{% block admin_content %}
<div class="admin-toolbar">
<h2>Edit {{ instance['name'] }}</h2>
<a class="admin-btn admin-btn-sm" href="/admin/containers/{{ instance['uid'] }}">&larr; Back to instance</a>
</div>
<form id="cm-edit-form" class="cm-form cm-card" data-uid="{{ instance['uid'] }}" role="group" aria-label="Edit {{ instance['name'] }}">
<label>Run as user (identity + API key only; container OS user is always pravda)
<input type="text" name="run_as_query" autocomplete="off" placeholder="Search a user (optional)" data-search="user"
value="{{ run_as_user['username'] if run_as_user else '' }}">
<input type="hidden" name="run_as_uid" value="{{ instance['run_as_uid'] or '' }}">
<ul class="cm-suggest" data-suggest="user" aria-live="polite" aria-label="User suggestions"></ul>
</label>
<label>Boot language
<select name="boot_language">
{% for lang in boot_languages %}
<option value="{{ lang }}" {% if (instance['boot_language'] or 'none') == lang %}selected{% endif %}>{{ lang }}</option>
{% endfor %}
</select>
</label>
<label data-boot="script">Boot script
<textarea name="boot_script" rows="10" spellcheck="false">{{ instance['boot_script'] or '' }}</textarea>
</label>
<label data-boot="command">Boot command (used when no boot script)
<input type="text" name="boot_command" maxlength="500" value="{{ instance['boot_command'] or '' }}">
</label>
<label>Restart policy
<select name="restart_policy">
{% for policy in restart_policies %}
<option value="{{ policy }}" {% if (instance['restart_policy'] or 'never') == policy %}selected{% endif %}>{{ policy }}</option>
{% endfor %}
</select>
</label>
<div class="cm-form-row">
<label>CPU limit
<input type="text" name="cpu_limit" maxlength="16" value="{{ instance['cpu_limit'] or '' }}">
</label>
<label>Memory limit
<input type="text" name="mem_limit" maxlength="16" value="{{ instance['mem_limit'] or '' }}">
</label>
</div>
<label class="cm-check"><input type="checkbox" name="start_on_boot" {% if instance['start_on_boot'] %}checked{% endif %}> Start on container service boot</label>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</form>
{% endblock %}
{% block extra_js %}
<script type="module">
import { ContainerEdit } from "{{ static_url('/static/js/ContainerEdit.js') }}";
const editor = new ContainerEdit(document.getElementById("cm-edit-form"));
editor.init();
window.app.containerEdit = editor;
</script>
{% endblock %}