diff --git a/websiteFunctions/static/websiteFunctions/DockerContainers.js b/websiteFunctions/static/websiteFunctions/DockerContainers.js
index d5bcb1314..be2563669 100644
--- a/websiteFunctions/static/websiteFunctions/DockerContainers.js
+++ b/websiteFunctions/static/websiteFunctions/DockerContainers.js
@@ -74,7 +74,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
if (response.data.status === 1) {
var containerInfo = response.data.data[1];
- console.log("Container Info received:", containerInfo);
+ console.log("Full container info:", containerInfo);
// Find the container in the list and update its information
for (var i = 0; i < $scope.ContainerList.length; i++) {
@@ -84,11 +84,15 @@ 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("Container environment:", containerInfo.environment);
- // Environment Variables
- $scope.ContainerList[i].environment = containerInfo.environment;
- console.log("Updated container environment:", $scope.ContainerList[i].environment);
+ // Environment Variables - ensure it's properly set
+ if (containerInfo.environment) {
+ console.log("Setting environment:", containerInfo.environment);
+ $scope.ContainerList[i].environment = containerInfo.environment;
+ console.log("Container after env update:", $scope.ContainerList[i]);
+ } else {
+ console.log("No environment in container info");
+ }
// Resource Usage
var memoryBytes = containerInfo.memory_usage;
diff --git a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html
index 66ed22e45..80754f41c 100644
--- a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html
+++ b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html
@@ -943,15 +943,36 @@
// Function to extract n8n version from environment variables
$scope.getN8nVersion = function(container) {
- 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];
- }
+ console.log('getN8nVersion called with:', container);
+
+ if (!container) {
+ console.log('Container is null/undefined');
+ return 'unknown';
}
+
+ if (!container.environment) {
+ console.log('No environment in container');
+ return 'unknown';
+ }
+
+ if (!Array.isArray(container.environment)) {
+ console.log('Environment is not an array:', container.environment);
+ return 'unknown';
+ }
+
+ console.log('Searching through environment:', container.environment);
+
+ var version = container.environment.find(function(env) {
+ return typeof env === 'string' && env.startsWith('N8N_VERSION=');
+ });
+
+ if (version) {
+ var versionNumber = version.split('=')[1];
+ console.log('Found version:', versionNumber);
+ return versionNumber;
+ }
+
+ console.log('No N8N_VERSION found in environment');
return 'unknown';
};
@@ -1190,6 +1211,8 @@
n8n Container: {$ web.name $}
+
+ {$ web | json $}
v{$ getN8nVersion(web) $}
Update Available