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 @@
{$ web.id $}{{ web.id }}{$ containerPort $}{{ containerPort }}{$ volume.Source $}{$ volume.Destination $}{{ volume.Source }}{{ volume.Destination }}{$ env.split('=')[0] $}{{ env.split('=')[0] }}{$ env.split('=')[1] $}
- {$ env.split('=')[1] $}
+ {{ env.split('=')[1] }}
+ {{ env.split('=')[1] }}