diff --git a/websiteFunctions/static/websiteFunctions/DockerContainers.js b/websiteFunctions/static/websiteFunctions/DockerContainers.js index b6d70928b..a623cb720 100644 --- a/websiteFunctions/static/websiteFunctions/DockerContainers.js +++ b/websiteFunctions/static/websiteFunctions/DockerContainers.js @@ -13,6 +13,12 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; } + // Helper function to truncate container IDs + $scope.truncateId = function(id) { + if (!id) return ''; + return id.substring(0, 12); + }; + $scope.getcontainer = function () { $('#cyberpanelLoading').show(); url = "/docker/getDockersiteList"; @@ -397,7 +403,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { // Refresh container info after short delay to allow Docker to update setTimeout(function() { - $scope.Lunchcontainer(container.id); + $scope.getcontainer(); }, 1000); } else { new PNotify({ @@ -545,7 +551,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { }); $('#settings').modal('hide'); // Refresh container info after update - $scope.Lunchcontainer($scope.selectedContainer.id); + $scope.getcontainer(); } else { new PNotify({ title: 'Operation Failed!', @@ -570,6 +576,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) { $scope.addVolField = function() { if (!$scope.volList) { $scope.volList = {}; + $scope.volListNumber = 0; } $scope.volList[$scope.volListNumber] = {'dest': '', 'src': ''}; diff --git a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html index c809b1d3f..76053b7bb 100644 --- a/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/DockerSiteHome.html @@ -28,7 +28,7 @@
Container Info
-

ID: {{ '{% verbatim %}' }}{{ container.id.substring(0, 12) }}{{ '{% endverbatim %}' }}

+

ID: {{ '{% verbatim %}' }}{{ truncateId(container.id) }}{{ '{% endverbatim %}' }}

Image: {{ '{% verbatim %}' }}{{ container.Image }}{{ '{% endverbatim %}' }}

Status: {{ '{% verbatim %}' }}{{ container.Status }}{{ '{% endverbatim %}' }}