From e658962bd38d8163af01ce2e162944e489959d24 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sat, 12 Apr 2025 19:27:10 +0500 Subject: [PATCH] front end for n8n version --- .../websiteFunctions/DockerSiteHome.html | 75 +++++++------------ 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html index 4a64ef5ea..4804b25c8 100644 --- a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html @@ -915,7 +915,7 @@ } }); - // Angular extension for container action handling + // Add n8n version checking and update functionality angular.module('WebsitesApp').run(['$rootScope', function($rootScope) { // Add custom icon rendering for container actions $rootScope.renderIcon = function(iconName) { @@ -949,9 +949,9 @@ }; } - // Add n8n version checking function - $rootScope.checkN8nVersion = function(container) { - // Simulate version check + // Initialize n8n version info for containers + $rootScope.initializeN8nVersion = function(container) { + // This would normally come from the backend container.n8nVersion = { current: '1.0.0', latest: '1.1.0', @@ -970,6 +970,17 @@ container.updatingN8n = false; }, 3000); }; + + // Initialize version info when loading containers + var originalLunchcontainer = $rootScope.Lunchcontainer; + if (originalLunchcontainer) { + $rootScope.Lunchcontainer = function(containerId) { + var result = originalLunchcontainer(containerId); + // Initialize version info after container is loaded + $rootScope.initializeN8nVersion($rootScope.web); + return result; + }; + } }]); }); @@ -1144,6 +1155,12 @@

n8n Container: {$ web.name $} +
+ Version {$ web.n8nVersion.current || '...' $} + + Update available: {$ web.n8nVersion.latest $} + +
{$ web.status $} @@ -1165,57 +1182,15 @@ Open n8n -
- -
-

- n8n Version Information - -

-
-
- - - - - - - - - - - - - - - -
Current Version:{$ web.n8nVersion.current $}
Latest Version:{$ web.n8nVersion.latest $}
Update Available: - - {$ web.n8nVersion.updateAvailable ? 'Yes' : 'No' $} - -
-
-
-
- - Your n8n installation is up to date. - - A new version of n8n is available. Click the update button to upgrade to version {$ web.n8nVersion.latest $}. - -
-
-
-