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:
+13
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user