mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
add additional info to docker js update
This commit is contained in:
@@ -8,193 +8,6 @@
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
<style>
|
||||
/* Dashboard Overview Styles */
|
||||
.dashboard-overview {
|
||||
padding: 20px 0;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.metric-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
transition: transform 0.2s;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.metric-card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.metric-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.metric-label {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Container Card Styles */
|
||||
.container-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.container-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.container-card:hover {
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.container-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.container-name {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container-status {
|
||||
padding: 4px 8px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.status-running {
|
||||
background-color: #e3f2fd;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.status-stopped {
|
||||
background-color: #ffebee;
|
||||
color: #f44336;
|
||||
}
|
||||
|
||||
.container-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.metric {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.metric-title {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.metric-value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.container-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
flex: 1;
|
||||
padding: 8px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.action-button.primary {
|
||||
background-color: #2196F3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.action-button.secondary {
|
||||
background-color: #f5f5f5;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* View Toggle Styles */
|
||||
.view-toggle {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.view-toggle button {
|
||||
padding: 8px 16px;
|
||||
border: 1px solid #ddd;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.view-toggle button.active {
|
||||
background: #2196F3;
|
||||
color: white;
|
||||
border-color: #2196F3;
|
||||
}
|
||||
|
||||
/* Search and Filter Styles */
|
||||
.container-filters {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search-container input {
|
||||
width: 100%;
|
||||
padding: 10px 15px;
|
||||
padding-left: 35px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.filter-dropdown {
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
background: #fff;
|
||||
border: 1px solid #e0e0e0;
|
||||
@@ -302,6 +115,14 @@
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.status-running {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
.status-stopped {
|
||||
background-color: #F44336;
|
||||
}
|
||||
|
||||
/* Tooltips */
|
||||
[data-toggle="tooltip"] {
|
||||
cursor: help;
|
||||
@@ -336,91 +157,6 @@
|
||||
<p>{% trans "Manage containers on server" %}</p>
|
||||
</div>
|
||||
|
||||
<!-- Dashboard Overview -->
|
||||
<div class="dashboard-overview">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="metric-card">
|
||||
<div class="metric-value">{$ totalContainers $}</div>
|
||||
<div class="metric-label">Total Containers</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="metric-card">
|
||||
<div class="metric-value">{$ runningContainers $}</div>
|
||||
<div class="metric-label">Running Containers</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="metric-card">
|
||||
<div class="metric-value">{$ cpuUsage | number:1 $}%</div>
|
||||
<div class="metric-label">CPU Usage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="metric-card">
|
||||
<div class="metric-value">{$ memoryUsage | number:1 $}%</div>
|
||||
<div class="metric-label">Memory Usage</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- View Toggle and Filters -->
|
||||
<div class="container-header">
|
||||
<div class="view-toggle btn-group">
|
||||
<button class="btn" ng-class="{'active': viewMode === 'grid'}" ng-click="viewMode = 'grid'">
|
||||
<i class="fa fa-th-large"></i> Grid
|
||||
</button>
|
||||
<button class="btn" ng-class="{'active': viewMode === 'list'}" ng-click="viewMode = 'list'">
|
||||
<i class="fa fa-list"></i> List
|
||||
</button>
|
||||
</div>
|
||||
<div class="container-filters">
|
||||
<div class="search-container">
|
||||
<i class="fa fa-search search-icon"></i>
|
||||
<input type="text" ng-model="searchQuery" placeholder="Search containers...">
|
||||
</div>
|
||||
<select class="form-control filter-dropdown" ng-model="statusFilter">
|
||||
<option value="">All Status</option>
|
||||
<option value="running">Running</option>
|
||||
<option value="stopped">Stopped</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Grid View -->
|
||||
<div class="container-grid" ng-if="viewMode === 'grid'">
|
||||
<div class="container-card" ng-repeat="container in ContainerList | filter:searchQuery | filter:statusFilter">
|
||||
<div class="container-header">
|
||||
<span class="container-name">{$ container.name $}</span>
|
||||
<span class="container-status" ng-class="{'status-running': container.status === 'running', 'status-stopped': container.status === 'stopped'}">
|
||||
{$ container.status $}
|
||||
</span>
|
||||
</div>
|
||||
<div class="container-metrics">
|
||||
<div class="metric">
|
||||
<div class="metric-title">CPU</div>
|
||||
<div class="metric-value">{$ container.cpu $}%</div>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<div class="metric-title">Memory</div>
|
||||
<div class="metric-value">{$ container.memory $}%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-actions">
|
||||
<button class="action-button primary" ng-click="Lunchcontainer(container.id)">
|
||||
<i class="fa fa-play"></i> Launch
|
||||
</button>
|
||||
<button class="action-button secondary" ng-click="showContainerDetails(container)">
|
||||
<i class="fa fa-cog"></i> Manage
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- List View (existing table) -->
|
||||
<div ng-if="viewMode === 'list'">
|
||||
<div class="panel" ng-hide="listcontainerview">
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
@@ -592,63 +328,81 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="conatinerview">
|
||||
<div>
|
||||
|
||||
|
||||
<div id="page-title">
|
||||
<h2 id="domainNamePage">{% trans "Currently managing: " %} {$ cName $}
|
||||
<button class="btn btn-warning pull-right" data-toggle="modal"
|
||||
data-target="#Recreatedockerapp"><i
|
||||
class="fa fa-refresh btn-icon"></i> Recreate
|
||||
<div id="page-title" class="mb-4">
|
||||
<h2 id="domainNamePage" class="d-flex justify-content-between align-items-center">
|
||||
<span>{% trans "Currently managing: " %} {$ cName $}</span>
|
||||
<button class="btn btn-warning" data-toggle="modal" data-target="#Recreatedockerapp">
|
||||
<i class="fa fa-refresh btn-icon"></i> Recreate
|
||||
</button>
|
||||
</h2>
|
||||
<p>
|
||||
{% trans "Container ID" %}: {$ cid $}
|
||||
<p class="text-muted">
|
||||
{% trans "Container ID" %}: <code>{$ cid $}</code>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
<div class="container-fluid p-0">
|
||||
<div class="panel panel-body">
|
||||
<h3 class="content-box-header">
|
||||
<h3 class="content-box-header d-flex justify-content-between align-items-center mb-4">
|
||||
{% trans "Container Information" %}
|
||||
<img id="infoLoading" src="/static/images/loading.gif" style="display: none;">
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="info-box">
|
||||
<h4>Basic Information</h4>
|
||||
<p><strong>Container ID:</strong> {$ cid $}</p>
|
||||
<p><strong>Status:</strong> <span class="label" ng-class="{'label-success': status === 'running', 'label-danger': status === 'stopped', 'label-warning': status !== 'running' && status !== 'stopped'}">{$ status $}</span></p>
|
||||
<p><strong>Created:</strong> {$ created | date:'medium' $}</p>
|
||||
<p><strong>Uptime:</strong> {$ uptime $}</p>
|
||||
<div class="info-box shadow-sm">
|
||||
<h4 class="border-bottom pb-2 mb-3">Basic Information</h4>
|
||||
<div class="info-list">
|
||||
<p class="mb-2"><strong>Container ID:</strong> <code>{$ cid $}</code></p>
|
||||
<p class="mb-2"><strong>Status:</strong>
|
||||
<span class="label px-3 py-1 rounded" ng-class="{'label-success': status === 'running', 'label-danger': status === 'stopped', 'label-warning': status !== 'running' && status !== 'stopped'}">
|
||||
{$ status $}
|
||||
</span>
|
||||
</p>
|
||||
<p class="mb-2"><strong>Created:</strong> {$ created | date:'medium' $}</p>
|
||||
<p class="mb-2"><strong>Uptime:</strong> {$ uptime $}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-box">
|
||||
<h4>Resource Usage</h4>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" ng-style="{'width': memoryUsagePercent + '%'}" aria-valuenow="{$ memoryUsagePercent $}" aria-valuemin="0" aria-valuemax="100">
|
||||
Memory: {$ memoryUsagePercent | number:1 $}%
|
||||
<div class="info-box shadow-sm mt-4">
|
||||
<h4 class="border-bottom pb-2 mb-3">Resource Usage</h4>
|
||||
<div class="mb-3">
|
||||
<label class="mb-2">Memory Usage</label>
|
||||
<div class="progress" style="height: 20px;">
|
||||
<div class="progress-bar" role="progressbar"
|
||||
ng-style="{'width': memoryUsagePercent + '%'}"
|
||||
aria-valuenow="{$ memoryUsagePercent $}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100">
|
||||
{$ memoryUsagePercent | number:1 $}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" ng-style="{'width': cpuUsagePercent + '%'}" aria-valuenow="{$ cpuUsagePercent $}" aria-valuemin="0" aria-valuemax="100">
|
||||
CPU: {$ cpuUsagePercent | number:1 $}%
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-2">CPU Usage</label>
|
||||
<div class="progress" style="height: 20px;">
|
||||
<div class="progress-bar" role="progressbar"
|
||||
ng-style="{'width': cpuUsagePercent + '%'}"
|
||||
aria-valuenow="{$ cpuUsagePercent $}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100">
|
||||
{$ cpuUsagePercent | number:1 $}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="info-box">
|
||||
<h4>Network & Ports</h4>
|
||||
<div class="info-box shadow-sm">
|
||||
<h4 class="border-bottom pb-2 mb-3">Network & Ports</h4>
|
||||
<div ng-if="ports && (ports | objLength) > 0">
|
||||
<table class="table table-striped">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Container Port</th>
|
||||
@@ -657,9 +411,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="(containerPort, hostBindings) in ports">
|
||||
<td>{$ containerPort $}</td>
|
||||
<td><code>{$ containerPort $}</code></td>
|
||||
<td>
|
||||
<span ng-repeat="binding in hostBindings">
|
||||
<span ng-repeat="binding in hostBindings" class="badge bg-light text-dark me-2">
|
||||
{$ binding.HostIp || '0.0.0.0' $}:{$ binding.HostPort $}
|
||||
</span>
|
||||
</td>
|
||||
@@ -667,15 +421,17 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div ng-if="!ports || (ports | objLength) === 0">
|
||||
<p>No ports exposed</p>
|
||||
</div>
|
||||
<div ng-if="!ports || (ports | objLength) === 0" class="text-muted">
|
||||
<p class="mb-0">No ports exposed</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-box">
|
||||
<h4>Volumes</h4>
|
||||
<div class="info-box shadow-sm mt-4">
|
||||
<h4 class="border-bottom pb-2 mb-3">Volumes</h4>
|
||||
<div ng-if="volumes && volumes.length > 0">
|
||||
<table class="table table-striped">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Source</th>
|
||||
@@ -685,22 +441,24 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="volume in volumes">
|
||||
<td>{$ volume.Source $}</td>
|
||||
<td>{$ volume.Destination $}</td>
|
||||
<td>{$ volume.Mode $}</td>
|
||||
<td><code>{$ volume.Source $}</code></td>
|
||||
<td><code>{$ volume.Destination $}</code></td>
|
||||
<td><span class="badge bg-secondary">{$ volume.Mode $}</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div ng-if="!volumes || volumes.length === 0">
|
||||
<p>No volumes mounted</p>
|
||||
</div>
|
||||
<div ng-if="!volumes || volumes.length === 0" class="text-muted">
|
||||
<p class="mb-0">No volumes mounted</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-box">
|
||||
<h4>Environment Variables</h4>
|
||||
<div class="info-box shadow-sm mt-4">
|
||||
<h4 class="border-bottom pb-2 mb-3">Environment Variables</h4>
|
||||
<div ng-if="environment && environment.length > 0">
|
||||
<table class="table table-striped">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
@@ -709,14 +467,15 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="env in environment">
|
||||
<td>{$ env.split('=')[0] $}</td>
|
||||
<td>{$ env.split('=')[1] $}</td>
|
||||
<td><code>{$ env.split('=')[0] $}</code></td>
|
||||
<td><code>{$ env.split('=')[1] $}</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div ng-if="!environment || environment.length === 0">
|
||||
<p>No environment variables set</p>
|
||||
</div>
|
||||
<div ng-if="!environment || environment.length === 0" class="text-muted">
|
||||
<p class="mb-0">No environment variables set</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user