mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
show n8n version
This commit is contained in:
@@ -74,7 +74,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
|
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
var containerInfo = response.data.data[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
|
// Find the container in the list and update its information
|
||||||
for (var i = 0; i < $scope.ContainerList.length; i++) {
|
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].created = new Date(containerInfo.created);
|
||||||
$scope.ContainerList[i].uptime = containerInfo.uptime;
|
$scope.ContainerList[i].uptime = containerInfo.uptime;
|
||||||
$scope.ContainerList[i].image = containerInfo.image;
|
$scope.ContainerList[i].image = containerInfo.image;
|
||||||
console.log("Container environment:", containerInfo.environment);
|
|
||||||
|
|
||||||
// Environment Variables
|
// Environment Variables - ensure it's properly set
|
||||||
|
if (containerInfo.environment) {
|
||||||
|
console.log("Setting environment:", containerInfo.environment);
|
||||||
$scope.ContainerList[i].environment = containerInfo.environment;
|
$scope.ContainerList[i].environment = containerInfo.environment;
|
||||||
console.log("Updated container environment:", $scope.ContainerList[i].environment);
|
console.log("Container after env update:", $scope.ContainerList[i]);
|
||||||
|
} else {
|
||||||
|
console.log("No environment in container info");
|
||||||
|
}
|
||||||
|
|
||||||
// Resource Usage
|
// Resource Usage
|
||||||
var memoryBytes = containerInfo.memory_usage;
|
var memoryBytes = containerInfo.memory_usage;
|
||||||
|
|||||||
@@ -943,15 +943,36 @@
|
|||||||
|
|
||||||
// Function to extract n8n version from environment variables
|
// Function to extract n8n version from environment variables
|
||||||
$scope.getN8nVersion = function(container) {
|
$scope.getN8nVersion = function(container) {
|
||||||
if (container && container.environment && Array.isArray(container.environment)) {
|
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) {
|
var version = container.environment.find(function(env) {
|
||||||
return env.startsWith('N8N_VERSION=');
|
return typeof env === 'string' && env.startsWith('N8N_VERSION=');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
return version.split('=')[1];
|
var versionNumber = version.split('=')[1];
|
||||||
}
|
console.log('Found version:', versionNumber);
|
||||||
|
return versionNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('No N8N_VERSION found in environment');
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1190,6 +1211,8 @@
|
|||||||
<i class="fa fa-cube"></i>
|
<i class="fa fa-cube"></i>
|
||||||
n8n Container: {$ web.name $}
|
n8n Container: {$ web.name $}
|
||||||
<span class="version-badge">
|
<span class="version-badge">
|
||||||
|
<!-- Debug output -->
|
||||||
|
<pre style="display:none">{$ web | json $}</pre>
|
||||||
<i class="fa fa-tag"></i> v{$ getN8nVersion(web) $}
|
<i class="fa fa-tag"></i> v{$ getN8nVersion(web) $}
|
||||||
<span ng-if="checkN8nUpdates(getN8nVersion(web))" class="update-available">
|
<span ng-if="checkN8nUpdates(getN8nVersion(web))" class="update-available">
|
||||||
<i class="fa fa-arrow-up"></i> Update Available
|
<i class="fa fa-arrow-up"></i> Update Available
|
||||||
|
|||||||
Reference in New Issue
Block a user