feat(gui): inline peer rename

Click on peer name in the table to edit it inline.
Enter to save, Escape to cancel, blur also saves.
Saved via POST /peers/<id>/rename without page reload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 10:25:28 +03:00
parent 667cdd90df
commit 0aead8c3ad
3 changed files with 68 additions and 1 deletions
+13
View File
@@ -625,6 +625,19 @@ def peer_delete_by_key():
return redirect(url_for("index"))
@app.post("/peers/<int:peer_id>/rename")
def peer_rename(peer_id: int):
name = (request.form.get("name") or "").strip()
if not name:
flash("Имя не может быть пустым", "error")
return redirect(url_for("index"))
with db_conn() as conn:
cur = conn.cursor()
cur.execute("UPDATE peers SET name=? WHERE id=?", (name, peer_id))
conn.commit()
return ("", 204)
@app.route("/scripts")
def scripts():
commands = {