mirror of https://github.com/TriliumNext/Notes
okay, we can start npm server now, but new db redirects to share
parent
7af4e52766
commit
bc66e98533
@ -0,0 +1,47 @@
|
||||
import OptionsWidget from "../options_widget.js";
|
||||
import options from "../../../../services/options.js";
|
||||
import { t } from "../../../../services/i18n.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="card-body">
|
||||
<h4>${t('Share Settings')}</h4>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" name="redirectBareDomain" value="true">
|
||||
${t('Redirect bare domain to Share page')}
|
||||
</label>
|
||||
<p class="form-text">${t('When enabled, accessing the root URL will redirect to the Share page instead of Login')}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" name="showLoginInShareTheme" value="true">
|
||||
${t('Show Login link in Share theme')}
|
||||
</label>
|
||||
<p class="form-text">${t('Add a login link to the Share page footer')}</p>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
export default class ShareSettingsOptions extends OptionsWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
}
|
||||
|
||||
async optionsLoaded(options: Record<string, any>) {
|
||||
this.$widget.find('input[name="redirectBareDomain"]').prop('checked',
|
||||
options.redirectBareDomain === 'true');
|
||||
|
||||
this.$widget.find('input[name="showLoginInShareTheme"]').prop('checked',
|
||||
options.showLoginInShareTheme === 'true');
|
||||
}
|
||||
|
||||
async save() {
|
||||
const redirectBareDomain = this.$widget.find('input[name="redirectBareDomain"]').prop('checked');
|
||||
await this.updateOption('redirectBareDomain', redirectBareDomain.toString());
|
||||
|
||||
const showLoginInShareTheme = this.$widget.find('input[name="showLoginInShareTheme"]').prop('checked');
|
||||
await this.updateOption('showLoginInShareTheme', showLoginInShareTheme.toString());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue