This commit is contained in:
pika 2025-03-31 00:35:42 +02:00
parent 30e9c9328e
commit 254593d260
20 changed files with 156 additions and 65 deletions

View file

@ -58,7 +58,8 @@
<select class="form-select" name="server_id" required>
<option value="">Select a server</option>
{% for server in servers %}
<option value="{{ server.id }}" {% if app and server.id==app.server_id %}selected{% endif %}>
<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 %}>
{{ server.hostname }} ({{ server.ip_address }})
</option>
{% endfor %}

View file

@ -1,5 +1,7 @@
{% extends "layout.html" %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<div class="container-xl">
<div class="page-header d-print-none">
@ -12,13 +14,16 @@
{{ app.name }}
</h2>
</div>
<div class="col-auto ms-auto">
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<a href="{{ url_for('dashboard.app_edit', app_id=app.id) }}" class="btn btn-primary">
<span class="ti ti-edit me-2"></span>Edit Application
<a href="{{ url_for('dashboard.app_edit', app_id=app.id) }}" class="btn btn-primary d-none d-sm-inline-block">
<span class="ti ti-edit"></span>
Edit Application
</a>
<button class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteAppModal">
<span class="ti ti-trash me-2"></span>Delete
<button class="btn btn-danger d-none d-sm-inline-block" data-bs-toggle="modal"
data-bs-target="#deleteAppModal">
<span class="ti ti-trash"></span>
Delete
</button>
</div>
</div>
@ -180,7 +185,7 @@
</div>
</div>
<!-- Confirmation Modal for Port Deletion -->
<!-- Delete Port Modal -->
<div class="modal modal-blur fade" id="deletePortModal" tabindex="-1">
<div class="modal-dialog modal-sm modal-dialog-centered">
<div class="modal-content">
@ -342,7 +347,9 @@
border-left-color: #d73a49;
}
</style>
{% endblock %}
{% block extra_js %}
<script>
// Store app ID for JavaScript use
const appId = {{ app.id }};
@ -365,6 +372,9 @@
.then(response => response.json())
.then(data => {
document.querySelector('#addPortForm input[name="port_number"]').value = data.port;
})
.catch(error => {
console.error('Error fetching random port:', error);
});
});
}