Load site settings from dotenv and store OAuth credentials

This commit is contained in:
2026-11-23 16:53:29 +08:00
parent 1bb0554608
commit 01ede89dcd
27 changed files with 730 additions and 76 deletions
+9 -4
View File
@@ -9,15 +9,20 @@ jQuery(function ($) {
});
$('[data-provider-settings]').each(function () {
const $settings = $(this);
const $preset = $settings.closest('form').find('[data-layout-preset]');
const $form = $settings.closest('form');
const $preset = $form.find('[data-layout-preset]');
const $account = $form.find('[name="components[]"][value=account]');
const $mode = $settings.find('[name=provider_mode]');
const sync = () => {
$settings.prop('hidden', $preset.val() !== 'member');
const mode = $mode.val();
const active = $preset.val() === 'member' && $account.is(':checked');
$settings.prop({hidden: !active, disabled: !active});
$settings.find('[data-provider-field]').prop('hidden', !mode);
$settings.find('[data-provider-mode]').each(function () {
$(this).prop('hidden', this.dataset.providerMode !== $mode.val());
$(this).prop('hidden', this.dataset.providerMode !== mode);
});
};
$preset.add($mode).on('change', sync);
$preset.add($mode).add($account).on('change', sync);
sync();
});