diff --git a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html index 187b63318..7097db516 100644 --- a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html @@ -941,34 +941,23 @@ $scope.conatinerview = false; $scope.cyberpanelLoading = true; - // 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.startsWith('N8N_VERSION=')) { - return env.split('=')[1]; - } - } + // Initialize container data + $scope.initContainer = function(container) { + if (container.environment && container.environment.some(env => env.includes('n8n'))) { + // Get container details including image info + $http.get('/docker/container/' + container.id + '/json').then(function(response) { + container.image = response.data.Config.Image; + $scope.$apply(); + }); } - // If no version found in environment, try to extract from image tag - if (container.image && container.image.includes(':')) { - return container.image.split(':')[1]; - } - return 'unknown'; - }; - - // Function to check if updates are available - $scope.checkN8nUpdates = function(currentVersion) { - // This is a placeholder. You'll need to implement the actual version check - // For now, we'll assume an update is available if version is not 'latest' - return currentVersion !== 'latest'; }; - // Add custom icon rendering for container actions - $scope.renderIcon = function(iconName) { - return ''; - }; + // Watch for container list changes + $scope.$watch('ContainerList', function(newVal) { + if (newVal && newVal.length > 0) { + newVal.forEach($scope.initContainer); + } + }); // Handle container actions $scope.handleAction = function(action, container) { @@ -1191,16 +1180,16 @@

- n8n Container: {$ web.name $} - - v{$ getN8nVersion(web) $} - + n8n Container: {{ web.name }} + + v{{ web.image.split(':')[1] || 'unknown' }} + Update Available - {$ web.status $} + {{ web.status }}

@@ -1216,10 +1205,10 @@ - - + Open n8n
@@ -1358,11 +1347,11 @@

- {% trans "Container: " %} {$ web.name $} + {% trans "Container: " %} {{ web.name }} - {$ web.status $} + {{ web.status }}

@@ -1390,15 +1379,15 @@ Container ID: - {$ web.id $} + {{ web.id }} Created: - {$ web.created | date:'medium' $} + {{ web.created | date:'medium' }} Uptime: - {$ web.uptime $} + {{ web.uptime }} @@ -1407,22 +1396,22 @@

Resource Usage

- +
- +
@@ -1444,10 +1433,10 @@ - {$ containerPort $} + {{ containerPort }} - {$ binding.HostIp || '0.0.0.0' $}:{$ binding.HostPort $} + {{ binding.HostIp || '0.0.0.0' }}:{{ binding.HostPort }} @@ -1471,8 +1460,8 @@ - {$ volume.Source $} - {$ volume.Destination $} + {{ volume.Source }} + {{ volume.Destination }} @@ -1498,10 +1487,10 @@ - {$ env.split('=')[0] $} + {{ env.split('=')[0] }} - {$ env.split('=')[1] $} - {$ env.split('=')[1] $} + {{ env.split('=')[1] }} + {{ env.split('=')[1] }} @@ -1518,7 +1507,7 @@ Refresh - +