This commit is contained in:
pika 2025-03-31 13:47:34 +02:00
parent 5a309a0f6d
commit 1ab129b798
5 changed files with 499 additions and 107 deletions

View file

@ -43,14 +43,17 @@
{% endwith %}
<form method="POST"
action="{{ url_for('dashboard.app_edit', app_id=app.id) if edit_mode else url_for('dashboard.app_new') }}">
action="{% if edit_mode %}{{ url_for('dashboard.app_edit', app_id=app.id) }}{% else %}{{ url_for('dashboard.app_new') }}{% endif %}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% if app %}
<input type="hidden" id="app-id" name="app_id" value="{{ app.id }}">
{% endif %}
<div class="mb-3">
<label class="form-label required">Application Name</label>
<input type="text" class="form-control" name="name" value="{{ app.name if app else '' }}" required
placeholder="Enter application name">
<small class="form-hint">Choose a unique name for this application</small>
<label for="app-name" class="form-label required">Application Name</label>
<input type="text" class="form-control" id="app-name" name="name" required
value="{% if app %}{{ app.name }}{% endif %}">
<div id="name-feedback"></div>
</div>
<div class="mb-3">
@ -68,17 +71,16 @@
</div>
<div class="mb-3">
<label class="form-label required">Server</label>
<select class="form-select" name="server_id" required>
<option value="">Select a server</option>
<label for="server-id" class="form-label required">Server</label>
<select class="form-select" id="server-id" name="server_id" required>
<option value="">Select Server</option>
{% for server in servers %}
<option value="{{ server.id }}" {% if app and server.id==app.server_id %}selected {% elif selected_server_id
and server.id|string==selected_server_id|string %}selected {% endif %}>
<option value="{{ server.id }}" {% if (app and app.server_id==server.id) or (selected_server_id and
selected_server_id|int==server.id|int) %}selected{% endif %}>
{{ server.hostname }} ({{ server.ip_address }})
</option>
{% endfor %}
</select>
<small class="form-hint">Select the server where this application runs</small>
</div>
<div class="mb-3">
@ -305,4 +307,9 @@
}
}
</script>
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='js/validation.js') }}"></script>
{% endblock %}