Make UDP ports configurable

Part of cloudron/box#504
This commit is contained in:
Girish Ramakrishnan
2018-08-13 08:38:47 -07:00
parent 31a62313bb
commit 6c574ead94
2 changed files with 12 additions and 11 deletions

View File

@@ -51,7 +51,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appConfigure.app = app;
$scope.appConfigure.location = app.location;
$scope.appConfigure.domain = $scope.domains.filter(function (d) { return d.domain === app.domain; })[0];
$scope.appConfigure.portBindingsInfo = app.manifest.tcpPorts || {}; // Portbinding map only for information
$scope.appConfigure.portBindingsInfo = angular.extend({}, app.manifest.tcpPorts, app.manifest.udpPorts); // Portbinding map only for information
$scope.appConfigure.memoryLimit = app.memoryLimit || app.manifest.memoryLimit || (256 * 1024 * 1024);
$scope.appConfigure.xFrameOptions = app.xFrameOptions.indexOf('ALLOW-FROM') === 0 ? app.xFrameOptions.split(' ')[1] : '';
$scope.appConfigure.alternateDomainEnabled = !!app.alternateDomains[0];
@@ -275,10 +275,10 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appRestore.busyFetching = true;
$scope.appRestore.domain = $scope.domains.find(function (d) { return app.domain === d.domain; }); // pre-select the app's domain
$scope.appRestore.portBindingsInfo = $scope.appRestore.app.manifest.tcpPorts || {}; // Portbinding map only for information
$scope.appRestore.portBindingsInfo = angular.extend({}, $scope.appRestore.app.manifest.tcpPorts, $scope.appRestore.app.manifest.udpPorts); // Portbinding map only for information
// set default ports
for (var env in $scope.appRestore.app.manifest.tcpPorts) {
$scope.appRestore.portBindings[env] = $scope.appRestore.app.manifest.tcpPorts[env].defaultValue || 0;
for (var env in $scope.appRestore.portBindingsInfo) {
$scope.appRestore.portBindings[env] = $scope.appRestore.portBindingsInfo[env].defaultValue || 0;
$scope.appRestore.portBindingsEnabled[env] = true;
}