You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

78 lines
2.8 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Service List</title>
<!-- Bootstrap 5.3 từ Cloudflare CDN -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="container p-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="text-white">🚀 Service List 🚀</h1>
<div>
<span class="text-white me-3">👤 {{ session['user'] }}</span>
<a href="{{ url_for('logout') }}" class="btn btn-danger">Logout</a>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered text-center">
<thead class="table-dark">
<tr>
<th>Service Name</th>
<th>Description</th>
<th>URL</th>
<th>Command</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for service in listService %}
<tr>
<td><strong>{{ service.name }}</strong></td>
<td>{{ service.description }}</td>
<td>
{% if service.url %}
<a href="{{ service.url }}" target="_blank" class="btn btn-link">🔗 Visit</a>
{% else %}
<span class="text-muted">N/A</span>
{% endif %}
</td>
<td><code class="text-primary">{{ service.command }}</code></td>
<td>
<button class="btn btn-success btn-sm run-btn"
data-command='{{ service.command | tojson | safe }}'>
Run
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Hiển thị kết quả -->
<div class="mt-4">
<h5 class="text-white">Command Output (Real-time Logs):</h5>
<pre id="commandOutput" class="bg-dark text-white p-3 rounded" style="height: 300px; overflow-y: auto;"></pre>
</div>
</div>
<!-- Container hiển thị Toast -->
<div id="toastContainer" class="position-fixed top-0 end-0 p-3" style="z-index: 1050;"></div>
<!-- Bootstrap JS từ Cloudflare CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
<script src="{{ url_for('static', filename='script.js') }}"></script>
</body>
</html>