mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
Allow admins to set subdomain for their instance
Fixes #209 Admins can see and set subdomain for their instance. Self-host customers only!
This commit is contained in:
parent
af9bc25660
commit
f828583b49
6 changed files with 25 additions and 3 deletions
|
@ -19,7 +19,9 @@ import Component from '@ember/component';
|
|||
|
||||
export default Component.extend(Notifier, {
|
||||
appMeta: service(),
|
||||
router: service(),
|
||||
maxTags: 3,
|
||||
domain: '',
|
||||
titleEmpty: empty('model.general.title'),
|
||||
messageEmpty: empty('model.general.message'),
|
||||
conversionEndpointEmpty: empty('model.general.conversionEndpoint'),
|
||||
|
@ -30,6 +32,7 @@ export default Component.extend(Notifier, {
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this.set('maxTags', this.get('model.general.maxTags'));
|
||||
this.set('domain', this.get('model.general.domain'));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -110,11 +113,20 @@ export default Component.extend(Notifier, {
|
|||
|
||||
this.set('model.general.maxTags', this.get('maxTags'));
|
||||
|
||||
let domainChanged = this.get('model.general.domain') !== this.get('domain').toLowerCase();
|
||||
this.set('model.general.domain', this.get('domain').toLowerCase());
|
||||
|
||||
this.get('onUpdate')().then(() => {
|
||||
this.notifySuccess('Saved');
|
||||
set(this, 'titleError', false);
|
||||
set(this, 'messageError', false);
|
||||
set(this, 'conversionEndpointError', false);
|
||||
|
||||
|
||||
if (domainChanged) {
|
||||
let router = this.get('router');
|
||||
router.transitionTo('auth.login');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ export default Model.extend({
|
|||
title: attr('string'),
|
||||
message: attr('string'),
|
||||
email: attr('string'),
|
||||
domain: attr('string'),
|
||||
conversionEndpoint: attr('string'),
|
||||
allowAnonymousAccess: attr('boolean', { defaultValue: false }),
|
||||
maxTags: attr('number', {defaultValue: 3}),
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
import RSVP from 'rsvp';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
orgService: service('organization'),
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
</div>
|
||||
<small class="form-text text-muted">You can choose to upload a small logo (e.g. 64px x 64px)</small>
|
||||
</div>
|
||||
{{#if (eq appMeta.location "selfhost")}}
|
||||
<div class="form-group">
|
||||
<label for="orgDomain">Site URL Subdomain</label>
|
||||
{{input id="orgDomain" type="text" value=domain class="form-control" placeholder="e.g. docs"}}
|
||||
<small class="form-text text-muted">If you are hosting on "docs.example.org" then the subdomain value should be set to "doc"</small>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="form-group">
|
||||
<label>Public Spaces Viewable By Anonymous Users</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue