This commit is contained in:
pika 2025-03-31 09:32:33 +02:00
parent 0a99abb52d
commit 7ce4914ea1
5 changed files with 182 additions and 37 deletions

View file

@ -229,6 +229,7 @@ def app_new(server_id=None):
name = request.form.get("name")
server_id = request.form.get("server_id")
documentation = request.form.get("documentation", "")
url = request.form.get("url", "") # Get the URL
if not name or not server_id:
flash("Name and server are required", "danger")
@ -240,8 +241,8 @@ def app_new(server_id=None):
selected_server_id=server_id,
)
# Create the app
app = App(name=name, server_id=server_id, documentation=documentation)
# Create the app with the URL
app = App(name=name, server_id=server_id, documentation=documentation, url=url)
try:
db.session.add(app)
@ -309,6 +310,7 @@ def app_edit(app_id):
name = request.form.get("name", "").strip()
server_id = request.form.get("server_id")
documentation = request.form.get("documentation", "")
url = request.form.get("url", "") # Get the URL
# Process port data from form
port_data = []
@ -326,6 +328,12 @@ def app_edit(app_id):
valid, error = validate_app_data(name, server_id, existing_app_id=app_id)
if valid:
# Update application with URL
app.name = name
app.server_id = server_id
app.documentation = documentation
app.url = url
# Update application
from app.utils.app_utils import save_app