Allow setting upstreamUri and hide irrelevant app configure tabs

This commit is contained in:
Johannes Zellner
2022-06-08 11:41:57 +02:00
parent 30fb353e4b
commit 1a641b8904
2 changed files with 61 additions and 6 deletions
+31
View File
@@ -162,6 +162,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.view = view;
};
$scope.isProxyApp = function (app) {
return app.manifest.id === 'io.cloudron.builtin.appproxy';
};
$scope.stopAppTask = function (taskId) {
Client.stopTask(taskId, function (error) {
// we can ignore a call trying to cancel an already done task
@@ -1132,6 +1136,33 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
};
$scope.proxy = {
busy: false,
error: {},
success: false,
upstreamUri: '',
show: function () {
$scope.proxy.error = {};
$scope.proxy.upstreamUri = $scope.app.upstreamUri || '';
},
submit: function () {
$scope.proxy.busy = true;
$scope.proxy.error = {};
Client.configureApp($scope.app.id, 'upstream_uri', { upstreamUri: $scope.proxy.upstreamUri }, function (error) {
if (error) return Client.error(error);
$timeout(function () {
$scope.proxy.success = true;
$scope.proxy.busy = false;
}, 1000);
});
}
};
$scope.updates = {
busy: false,
busyCheck: false,