mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
show n8n version
This commit is contained in:
@@ -84,23 +84,23 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
||||
$scope.ContainerList[i].created = new Date(containerInfo.created);
|
||||
$scope.ContainerList[i].uptime = containerInfo.uptime;
|
||||
$scope.ContainerList[i].image = containerInfo.image;
|
||||
console.log("Updated container image:", $scope.ContainerList[i].image);
|
||||
console.log("Container environment:", containerInfo.environment);
|
||||
|
||||
// Environment Variables
|
||||
$scope.ContainerList[i].environment = containerInfo.environment;
|
||||
console.log("Updated container environment:", $scope.ContainerList[i].environment);
|
||||
|
||||
// Resource Usage
|
||||
var memoryBytes = containerInfo.memory_usage;
|
||||
$scope.ContainerList[i].memoryUsage = formatBytes(memoryBytes);
|
||||
$scope.ContainerList[i].memoryUsagePercent = (memoryBytes / (1024 * 1024 * 1024)) * 100; // Assuming 1GB limit
|
||||
$scope.ContainerList[i].cpuUsagePercent = (containerInfo.cpu_usage / 10000000000) * 100; // Normalize to percentage
|
||||
$scope.ContainerList[i].memoryUsagePercent = (memoryBytes / (1024 * 1024 * 1024)) * 100;
|
||||
$scope.ContainerList[i].cpuUsagePercent = (containerInfo.cpu_usage / 10000000000) * 100;
|
||||
|
||||
// Network & Ports
|
||||
$scope.ContainerList[i].ports = containerInfo.ports;
|
||||
|
||||
// Volumes
|
||||
$scope.ContainerList[i].volumes = containerInfo.volumes;
|
||||
|
||||
// Environment Variables
|
||||
$scope.ContainerList[i].environment = containerInfo.environment;
|
||||
console.log("Container environment:", $scope.ContainerList[i].environment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -943,12 +943,13 @@
|
||||
|
||||
// Function to extract n8n version from environment variables
|
||||
$scope.getN8nVersion = function(container) {
|
||||
if (container.environment) {
|
||||
for (var i = 0; i < container.environment.length; i++) {
|
||||
var env = container.environment[i];
|
||||
if (env && typeof env === 'string' && env.startsWith('N8N_VERSION=')) {
|
||||
return env.split('=')[1];
|
||||
}
|
||||
if (container && container.environment && Array.isArray(container.environment)) {
|
||||
var version = container.environment.find(function(env) {
|
||||
return env.startsWith('N8N_VERSION=');
|
||||
});
|
||||
|
||||
if (version) {
|
||||
return version.split('=')[1];
|
||||
}
|
||||
}
|
||||
return 'unknown';
|
||||
|
||||
Reference in New Issue
Block a user