mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 01:25:36 +00:00
Pre-fill domain block/allow domain from search filter (#18172)
This commit is contained in:
parent
be0bc9acbf
commit
e7f0c9f7da
|
@ -100,6 +100,16 @@ ready(() => {
|
||||||
const registrationMode = document.getElementById('form_admin_settings_registrations_mode');
|
const registrationMode = document.getElementById('form_admin_settings_registrations_mode');
|
||||||
if (registrationMode) onChangeRegistrationMode(registrationMode);
|
if (registrationMode) onChangeRegistrationMode(registrationMode);
|
||||||
|
|
||||||
|
document.querySelector('a#add-instance-button')?.addEventListener('click', (e) => {
|
||||||
|
const domain = document.getElementById('by_domain')?.value;
|
||||||
|
|
||||||
|
if (domain) {
|
||||||
|
const url = new URL(event.target.href);
|
||||||
|
url.searchParams.set('_domain', domain);
|
||||||
|
e.target.href = url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const ReactDOM = require('react-dom');
|
const ReactDOM = require('react-dom');
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('admin.instances.title')
|
= t('admin.instances.title')
|
||||||
|
|
||||||
|
- content_for :header_tags do
|
||||||
|
= javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
|
||||||
|
|
||||||
- content_for :heading_actions do
|
- content_for :heading_actions do
|
||||||
- if whitelist_mode?
|
- if whitelist_mode?
|
||||||
= link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button'
|
= link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button', id: 'add-instance-button'
|
||||||
- else
|
- else
|
||||||
= link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button'
|
= link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button', id: 'add-instance-button'
|
||||||
|
|
||||||
.filters
|
.filters
|
||||||
.filter-subset
|
.filter-subset
|
||||||
|
|
Loading…
Reference in a new issue