feat: edit printer (name, HA prefix, notes) via modal
Deploy via Portainer / deploy (push) Successful in 0s

This commit is contained in:
Jo
2026-07-07 12:06:01 +02:00
parent de9ecec6dc
commit 29af4b4917
2 changed files with 65 additions and 0 deletions
+13
View File
@@ -1347,6 +1347,19 @@ def delete_printer(id):
conn.commit(); conn.close()
return redirect(url_for('printers_page'))
@app.route('/printers/<int:id>/edit', methods=['POST'])
@login_required
def edit_printer(id):
name = request.form.get('name','').strip()
ha_prefix = request.form.get('ha_entity_prefix','').strip().lower()
notes = request.form.get('notes','').strip()
if name:
conn = get_db()
conn.execute('UPDATE printers SET name=?, ha_entity_prefix=?, notes=? WHERE id=?',
(name, ha_prefix, notes, id))
conn.commit(); conn.close()
return redirect(url_for('printers_page'))
@app.route('/working-schedule', methods=['GET','POST'])
def working_schedule():
if request.method == 'POST':