add jitsi to well-known config

This commit is contained in:
Girish Ramakrishnan
2021-12-03 19:16:30 -08:00
parent 8028b93f53
commit 8cbdea57d8
3 changed files with 20 additions and 3 deletions
+5
View File
@@ -228,6 +228,11 @@
<input type="text" class="form-control" ng-model="domainWellKnown.mastodonHostname" name="mastodonHostname" ng-disabled="domainWellKnown.busy">
</div>
<div class="form-group">
<label class="control-label">{{ 'domains.domainDialog.jitsiHostname' | tr }} <sup><a ng-href="https://docs.cloudron.io/domains/#jitsi-location" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
<input type="text" class="form-control" ng-model="domainWellKnown.jitsiHostname" name="jitsiHostname" ng-disabled="domainWellKnown.busy">
</div>
<input class="ng-hide" type="submit" ng-disabled="domainWellKnownForm.$invalid || domainWellKnown.busy"/>
</form>
</div>
+11
View File
@@ -131,6 +131,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
domain: null,
mastodonHostname: '',
matrixHostname: '',
jitsiHostname: '',
reset: function () {
$scope.domainWellKnown.busy = false;
@@ -139,6 +140,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainWellKnown.matrixHostname = '';
$scope.domainWellKnown.mastodonHostname = '';
$scope.domainWellKnown.jitsiHostname = '';
},
show: function (domain) {
@@ -153,6 +155,12 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
if (domain.wellKnown && domain.wellKnown['host-meta']) {
$scope.domainWellKnown.mastodonHostname = domain.wellKnown['host-meta'].match(new RegExp('template="https://(.*?)/'))[1];
}
if (domain.wellKnown && domain.wellKnown['matrix/client']) {
let parsed = JSON.parse(domain.wellKnown['matrix/client']);
if (parsed['im.vector.riot.jitsi'] && parsed['im.vector.riot.jitsi']['preferredDomain']) {
$scope.domainWellKnown.jitsiHostname = parsed['im.vector.riot.jitsi']['preferredDomain'];
}
}
} catch (e) {
console.error(e);
}
@@ -171,6 +179,9 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
wellKnown['matrix/client'] = JSON.stringify({
'm.homeserver': {
'base_url': 'https://' + $scope.domainWellKnown.matrixHostname
},
'im.vector.riot.jitsi': {
'preferredDomain': $scope.domainWellKnown.jitsiHostname
}
});
}