diff --git a/src/translation/en.json b/src/translation/en.json index c74b1aa34..5b47b6605 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -911,13 +911,14 @@ "fallbackCertCustomCertInfo": "This wildcard certificate will be used for all apps on this domain. If not provided, a self-signed certificate will be automatically generated.", "fallbackCertKeyPlaceholder": "Key", "fallbackCertCertificatePlaceholder": "Certificate", - "matrixHostname": "Matrix server location", - "mastodonHostname": "Mastodon server location", + "matrixHostname": "Matrix Server Location", + "mastodonHostname": "Mastodon Server Location", "netcupCustomerNumber": "Customer Number", "netcupApiKey": "API Key", "netcupApiPassword": "API Password", "vultrToken": "Vultr Token", - "wellKnownDescription": "The values will be used by Cloudron to respond to /.well-known/ URLs. Note that an app must be available on the bare domain {{ domain }} for this to work." + "wellKnownDescription": "The values will be used by Cloudron to respond to /.well-known/ URLs. Note that an app must be available on the bare domain {{ domain }} for this to work.", + "jitsiHostname": "Jitsi Location" }, "removeDialog": { "title": "Really remove {{ domain }}?", diff --git a/src/views/domains.html b/src/views/domains.html index dc149854e..a165e1c25 100644 --- a/src/views/domains.html +++ b/src/views/domains.html @@ -228,6 +228,11 @@ +
+ + +
+ diff --git a/src/views/domains.js b/src/views/domains.js index 704872c14..792ec37f2 100644 --- a/src/views/domains.js +++ b/src/views/domains.js @@ -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 } }); }