mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
723 lines
22 KiB
HTML
723 lines
22 KiB
HTML
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "Docker Sites - CyberPanel" %}{% endblock %}
|
|
{% block content %}
|
|
|
|
{% load static %}
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
|
|
|
<style>
|
|
/* Modern Docker Sites List Styles */
|
|
.docker-sites-container {
|
|
padding: 30px;
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.page-header {
|
|
margin-bottom: 30px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 20px;
|
|
}
|
|
|
|
.page-header h1 {
|
|
color: #1e293b;
|
|
font-size: 32px;
|
|
font-weight: 700;
|
|
margin: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
.page-header .docker-icon {
|
|
width: 48px;
|
|
height: 48px;
|
|
background: linear-gradient(135deg, #5856d6 0%, #7c7ff2 100%);
|
|
border-radius: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
font-size: 24px;
|
|
box-shadow: 0 4px 12px rgba(88,86,214,0.25);
|
|
}
|
|
|
|
.page-header p {
|
|
color: #64748b;
|
|
font-size: 16px;
|
|
margin: 0;
|
|
flex: 1 1 100%;
|
|
}
|
|
|
|
.create-docker-btn {
|
|
background: linear-gradient(135deg, #5856d6 0%, #7c7ff2 100%);
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 10px;
|
|
font-weight: 600;
|
|
font-size: 15px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: all 0.3s ease;
|
|
box-shadow: 0 4px 12px rgba(88,86,214,0.2);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.create-docker-btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(88,86,214,0.3);
|
|
color: white;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* Search and Filter Section */
|
|
.search-filter-section {
|
|
display: flex;
|
|
gap: 20px;
|
|
margin-bottom: 30px;
|
|
align-items: center;
|
|
}
|
|
|
|
.search-box {
|
|
flex: 1;
|
|
position: relative;
|
|
}
|
|
|
|
.search-box input {
|
|
width: 100%;
|
|
padding: 14px 20px 14px 50px;
|
|
border: 2px solid #e8e9ff;
|
|
border-radius: 12px;
|
|
font-size: 15px;
|
|
transition: all 0.3s ease;
|
|
background: white;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
|
}
|
|
|
|
.search-box input:focus {
|
|
outline: none;
|
|
border-color: #5856d6;
|
|
box-shadow: 0 4px 12px rgba(88,86,214,0.15);
|
|
}
|
|
|
|
.search-box .search-icon {
|
|
position: absolute;
|
|
left: 18px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
color: #94a3b8;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.records-select {
|
|
min-width: 120px;
|
|
}
|
|
|
|
.records-select select {
|
|
padding: 14px 20px;
|
|
border: 2px solid #e8e9ff;
|
|
border-radius: 12px;
|
|
font-size: 15px;
|
|
background: white;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.records-select select:focus {
|
|
outline: none;
|
|
border-color: #5856d6;
|
|
}
|
|
|
|
/* Docker Site Cards */
|
|
.docker-site-card {
|
|
background: white;
|
|
border-radius: 16px;
|
|
padding: 0;
|
|
margin-bottom: 20px;
|
|
box-shadow: 0 2px 12px rgba(0,0,0,0.06);
|
|
transition: all 0.3s ease;
|
|
overflow: hidden;
|
|
border: 1px solid #f1f3f5;
|
|
}
|
|
|
|
.docker-site-card:hover {
|
|
box-shadow: 0 8px 24px rgba(0,0,0,0.1);
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.site-header {
|
|
background: linear-gradient(135deg, #f8f9ff 0%, #f3f1ff 100%);
|
|
padding: 20px 24px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
border-bottom: 1px solid #e8e9ff;
|
|
}
|
|
|
|
.site-title {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
.site-title h2 {
|
|
margin: 0;
|
|
font-size: 22px;
|
|
font-weight: 600;
|
|
color: #1e293b;
|
|
}
|
|
|
|
.site-title a {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
transition: color 0.3s ease;
|
|
}
|
|
|
|
.site-title a:hover {
|
|
color: #5856d6;
|
|
}
|
|
|
|
.external-link {
|
|
color: #94a3b8;
|
|
font-size: 16px;
|
|
margin-left: 8px;
|
|
}
|
|
|
|
.manage-btn {
|
|
background: #5856d6;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 8px;
|
|
font-weight: 500;
|
|
font-size: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: all 0.3s ease;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.manage-btn:hover {
|
|
background: #4845d2;
|
|
color: white;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(88,86,214,0.25);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.site-details {
|
|
padding: 24px;
|
|
}
|
|
|
|
.details-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
|
|
.detail-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.detail-icon {
|
|
width: 40px;
|
|
height: 40px;
|
|
background: #f8f9ff;
|
|
border-radius: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #5856d6;
|
|
font-size: 18px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.detail-content {
|
|
flex: 1;
|
|
}
|
|
|
|
.detail-label {
|
|
font-size: 12px;
|
|
color: #94a3b8;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
margin-bottom: 2px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.detail-value {
|
|
font-size: 15px;
|
|
color: #2f3640;
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* State Badge */
|
|
.state-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.state-badge.running,
|
|
.state-badge.active {
|
|
background: #d4f8e8;
|
|
color: #065f46;
|
|
}
|
|
|
|
.state-badge.stopped,
|
|
.state-badge.inactive {
|
|
background: #fee2e2;
|
|
color: #991b1b;
|
|
}
|
|
|
|
.state-badge.paused {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
}
|
|
|
|
.state-indicator {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: currentColor;
|
|
}
|
|
|
|
/* Action Buttons */
|
|
.site-actions {
|
|
padding: 0 24px 24px 24px;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 12px;
|
|
}
|
|
|
|
.delete-btn {
|
|
background: #fee2e2;
|
|
color: #dc2626;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 8px;
|
|
font-weight: 500;
|
|
font-size: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: all 0.3s ease;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.delete-btn:hover {
|
|
background: #dc2626;
|
|
color: white;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(220,38,38,0.25);
|
|
}
|
|
|
|
/* Loading State */
|
|
.loading-container {
|
|
text-align: center;
|
|
padding: 60px;
|
|
color: #94a3b8;
|
|
}
|
|
|
|
.loading-spinner {
|
|
width: 50px;
|
|
height: 50px;
|
|
margin: 0 auto 20px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
/* Pagination */
|
|
.pagination-section {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 20px;
|
|
margin-top: 30px;
|
|
}
|
|
|
|
.pagination-info {
|
|
color: #64748b;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.pagination-select {
|
|
min-width: 100px;
|
|
}
|
|
|
|
.pagination-select select {
|
|
padding: 10px 16px;
|
|
border: 2px solid #e8e9ff;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
background: white;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Modal Improvements */
|
|
.modal-content {
|
|
border-radius: 16px;
|
|
border: none;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.modal-header {
|
|
background: #f8f9ff;
|
|
border-bottom: 1px solid #e8e9ff;
|
|
padding: 20px 24px;
|
|
}
|
|
|
|
.modal-title {
|
|
color: #1e293b;
|
|
font-weight: 600;
|
|
font-size: 20px;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 24px;
|
|
}
|
|
|
|
.modal-body h4 {
|
|
color: #64748b;
|
|
font-weight: 500;
|
|
margin: 0;
|
|
}
|
|
|
|
.modal-footer {
|
|
background: #f8f9ff;
|
|
border-top: 1px solid #e8e9ff;
|
|
padding: 16px 24px;
|
|
gap: 12px;
|
|
}
|
|
|
|
.modal-footer .btn {
|
|
border-radius: 8px;
|
|
padding: 10px 20px;
|
|
font-weight: 500;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.modal-footer .btn-default {
|
|
background: white;
|
|
border: 1px solid #e8e9ff;
|
|
color: #64748b;
|
|
}
|
|
|
|
.modal-footer .btn-default:hover {
|
|
background: #f8f9ff;
|
|
border-color: #d8d9ff;
|
|
}
|
|
|
|
.modal-footer .btn-warning {
|
|
background: #dc2626;
|
|
border: none;
|
|
color: white;
|
|
}
|
|
|
|
.modal-footer .btn-warning:hover {
|
|
background: #b91c1c;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(220,38,38,0.25);
|
|
}
|
|
|
|
/* Empty State */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 80px 20px;
|
|
background: white;
|
|
border-radius: 16px;
|
|
box-shadow: 0 2px 12px rgba(0,0,0,0.06);
|
|
}
|
|
|
|
.empty-state-icon {
|
|
width: 100px;
|
|
height: 100px;
|
|
background: #f3f1ff;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0 auto 24px;
|
|
color: #5856d6;
|
|
font-size: 48px;
|
|
}
|
|
|
|
.empty-state h3 {
|
|
color: #1e293b;
|
|
font-size: 24px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.empty-state p {
|
|
color: #64748b;
|
|
font-size: 16px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
/* Alert Improvements */
|
|
.alert {
|
|
border-radius: 12px;
|
|
padding: 16px 20px;
|
|
margin-bottom: 20px;
|
|
border: none;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.alert-success {
|
|
background: #d4f8e8;
|
|
color: #065f46;
|
|
}
|
|
|
|
.alert-danger {
|
|
background: #fee2e2;
|
|
color: #991b1b;
|
|
}
|
|
|
|
.alert .close {
|
|
opacity: 0.5;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.alert .close:hover {
|
|
opacity: 1;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
});
|
|
</script>
|
|
|
|
<div ng-controller="listDockersite" class="docker-sites-container">
|
|
|
|
{% if Deleted %}
|
|
<div class="alert alert-success" role="alert">
|
|
<i class="fas fa-check-circle"></i>
|
|
<div>
|
|
<strong>Success!</strong> Website successfully deleted.
|
|
</div>
|
|
<button aria-label="" class="close" data-dismiss="alert">×</button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if LPError %}
|
|
<div class="alert alert-danger" role="alert">
|
|
<i class="fas fa-exclamation-circle"></i>
|
|
<div>
|
|
<strong>Error!</strong> {{ LPMessage }}
|
|
</div>
|
|
<button aria-label="" class="close" data-dismiss="alert">×</button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="page-header">
|
|
<h1>
|
|
<span class="docker-icon">
|
|
<i class="fab fa-docker"></i>
|
|
</span>
|
|
{% trans "Docker Sites" %}
|
|
</h1>
|
|
<a href="{% url "CreateDockersite" %}" class="create-docker-btn">
|
|
<i class="fas fa-plus-circle"></i>
|
|
{% trans "Create Docker App" %}
|
|
</a>
|
|
<p>{% trans "Launch, manage, modify and delete Docker applications from your server." %}</p>
|
|
</div>
|
|
|
|
<div class="search-filter-section">
|
|
<div class="search-box">
|
|
<i class="fas fa-search search-icon"></i>
|
|
<input ng-change="searchWebsites()"
|
|
placeholder="{% trans 'Search Docker sites...' %}"
|
|
ng-model="patternAdded"
|
|
type="text">
|
|
</div>
|
|
<div class="records-select">
|
|
<select ng-model="recordsToShow"
|
|
ng-change="getFurtherWebsitesFromDB()"
|
|
class="form-control">
|
|
<option>10</option>
|
|
<option>50</option>
|
|
<option>100</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-show="cyberPanelLoading" class="loading-container">
|
|
<img src="{% static 'images/loading.gif' %}" class="loading-spinner">
|
|
<p>Loading Docker sites...</p>
|
|
</div>
|
|
|
|
<div ng-hide="cyberPanelLoading">
|
|
<div ng-if="!WebSitesList || WebSitesList.length === 0" class="empty-state">
|
|
<div class="empty-state-icon">
|
|
<i class="fab fa-docker"></i>
|
|
</div>
|
|
<h3>{% trans "No Docker Sites Found" %}</h3>
|
|
<p>{% trans "Get started by creating your first Docker application." %}</p>
|
|
<a href="{% url "CreateDockersite" %}" class="create-docker-btn">
|
|
<i class="fas fa-plus-circle"></i>
|
|
{% trans "Create Docker App" %}
|
|
</a>
|
|
</div>
|
|
|
|
<div ng-repeat="web in WebSitesList track by $index" class="docker-site-card">
|
|
<div class="site-header">
|
|
<div class="site-title">
|
|
<h2>
|
|
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site">
|
|
{$ web.domain $}
|
|
<i class="fas fa-external-link-alt external-link"></i>
|
|
</a>
|
|
</h2>
|
|
</div>
|
|
<a href="/docker/manage/{$ web.id $}/app" class="manage-btn">
|
|
<i class="fas fa-cog"></i>
|
|
{% trans "Manage" %}
|
|
</a>
|
|
</div>
|
|
|
|
<div class="site-details">
|
|
<div class="details-grid">
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-circle"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">Status</div>
|
|
<span class="state-badge"
|
|
ng-class="{'running': web.state === 'running', 'active': web.state === 'Active', 'stopped': web.state === 'stopped', 'inactive': web.state === 'Inactive', 'paused': web.state === 'paused'}">
|
|
<span class="state-indicator"></span>
|
|
{$ web.state $}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-network-wired"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">IP Address</div>
|
|
<div class="detail-value">{$ web.ipAddress $}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-microchip"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">CPU Usage</div>
|
|
<div class="detail-value">{$ web.CPU $}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-memory"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">Memory Usage</div>
|
|
<div class="detail-value">{$ web.Ram $}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-cube"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">Package</div>
|
|
<div class="detail-value">{$ web.package $}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-item">
|
|
<div class="detail-icon">
|
|
<i class="fas fa-user-shield"></i>
|
|
</div>
|
|
<div class="detail-content">
|
|
<div class="detail-label">Owner</div>
|
|
<div class="detail-value">{$ web.admin $}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="site-actions">
|
|
<button class="delete-btn"
|
|
ng-click="DeleteDockersite('{% url 'ListDockerSites' %}?DeleteID=', web.id)"
|
|
data-toggle="modal"
|
|
data-target="#deleteDockersite">
|
|
<i class="fas fa-trash-alt"></i>
|
|
{% trans "Delete" %}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Delete Confirmation Modal -->
|
|
<div id="deleteDockersite" class="modal fade" role="dialog">
|
|
<div class="modal-dialog modal-sm">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">
|
|
<i class="fas fa-exclamation-triangle" style="color: #dc2626; margin-right: 8px;"></i>
|
|
Delete Docker App
|
|
</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<h4>Are you sure you want to delete this Docker application?</h4>
|
|
<p style="color: #64748b; font-size: 14px; margin-top: 12px;">
|
|
This action cannot be undone.
|
|
</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
|
Cancel
|
|
</button>
|
|
<button type="button" class="btn btn-warning" ng-click="ConfirmDelete()">
|
|
Delete App
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="listFail" class="alert alert-danger" style="display: none;">
|
|
<i class="fas fa-exclamation-circle"></i>
|
|
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-if="pagination.length > 1" class="pagination-section">
|
|
<span class="pagination-info">Page {$ currentPage $} of {$ pagination.length $}</span>
|
|
<div class="pagination-select">
|
|
<select ng-model="currentPage"
|
|
class="form-control"
|
|
ng-change="getFurtherWebsitesFromDB()">
|
|
<option ng-repeat="page in pagination">{$ $index + 1 $}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %} |