diff --git a/dashboard/public/views/app.html b/dashboard/public/views/app.html
index 12eb101e0..0321cedb5 100644
--- a/dashboard/public/views/app.html
+++ b/dashboard/public/views/app.html
@@ -1154,6 +1154,25 @@
+
+
+
diff --git a/dashboard/public/views/app.js b/dashboard/public/views/app.js
index 43e4c4685..d8291b209 100644
--- a/dashboard/public/views/app.js
+++ b/dashboard/public/views/app.js
@@ -613,6 +613,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
currentCpuQuota: 0,
cpuQuota: 0,
+ devices: '',
show: function () {
var app = $scope.app;
@@ -644,6 +645,8 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.resources.memoryLimit = $scope.resources.currentMemoryLimit;
$scope.resources.busy = false;
}, 500);
+
+ $scope.resources.devices = Object.keys(app.devices).join(', ');
},
submitMemoryLimit: function () {
@@ -687,6 +690,27 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
});
});
},
+
+ submitDevices: function () {
+ $scope.resources.busy = true;
+ $scope.resources.error = {};
+
+ const devices = {};
+ $scope.resources.devices.split(',').forEach(d => {
+ if (!d.trim()) return;
+ devices[d.trim()] = {};
+ });
+
+ Client.configureApp($scope.app.id, 'devices', { devices }, function (error) {
+ if (error) return Client.error(error);
+
+ refreshApp($scope.app.id, function (error) {
+ if (error) return Client.error(error);
+
+ $timeout(function () { $scope.resources.busy = false; }, 1000);
+ });
+ });
+ },
};
$scope.services = {