mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-06 12:20:45 +01:00
show n8n version
This commit is contained in:
@@ -355,4 +355,41 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
||||
|
||||
// Add location service to the controller for the n8n URL
|
||||
$scope.location = window.location;
|
||||
|
||||
// Function to extract n8n version from environment variables
|
||||
$scope.getN8nVersion = function(container) {
|
||||
console.log('getN8nVersion called with container:', container);
|
||||
|
||||
if (!container || !container.environment) {
|
||||
console.log('No container or environment data');
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
console.log('Container environment:', container.environment);
|
||||
|
||||
var version = null;
|
||||
|
||||
// Try to find NODE_VERSION first
|
||||
version = container.environment.find(function(env) {
|
||||
return env && env.startsWith('NODE_VERSION=');
|
||||
});
|
||||
|
||||
if (version) {
|
||||
console.log('Found NODE_VERSION:', version);
|
||||
return version.split('=')[1];
|
||||
}
|
||||
|
||||
// Try to find N8N_VERSION
|
||||
version = container.environment.find(function(env) {
|
||||
return env && env.startsWith('N8N_VERSION=');
|
||||
});
|
||||
|
||||
if (version) {
|
||||
console.log('Found N8N_VERSION:', version);
|
||||
return version.split('=')[1];
|
||||
}
|
||||
|
||||
console.log('No version found in environment');
|
||||
return 'unknown';
|
||||
};
|
||||
});
|
||||
@@ -1211,12 +1211,9 @@
|
||||
<i class="fa fa-cube"></i>
|
||||
n8n Container: {$ web.name $}
|
||||
<span class="version-badge">
|
||||
<!-- Debug output -->
|
||||
<pre style="display:none">{$ web | json $}</pre>
|
||||
<i class="fa fa-tag"></i> v{$ getN8nVersion(web) $}
|
||||
<span ng-if="checkN8nUpdates(getN8nVersion(web))" class="update-available">
|
||||
<i class="fa fa-arrow-up"></i> Update Available
|
||||
</span>
|
||||
<span style="display: none;">Debug - Environment: {$ web.environment | json $}</span>
|
||||
<i class="fa fa-tag"></i>
|
||||
<span ng-bind="'v' + getN8nVersion(web)"></span>
|
||||
</span>
|
||||
<span class="workflow-status" ng-class="{'active': web.status === 'running', 'error': web.status !== 'running'}">
|
||||
<i class="fa" ng-class="{'fa-check-circle': web.status === 'running', 'fa-times-circle': web.status !== 'running'}"></i>
|
||||
|
||||
Reference in New Issue
Block a user