[Glitch] Add graphs and retention metrics to admin dashboard (#16829)

Port 07341e7aa6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2021-10-14 20:44:59 +02:00
committed by Claire
parent 694c073d1f
commit 7aec1bc308
19 changed files with 838 additions and 70 deletions

View File

@@ -101,24 +101,4 @@ ready(() => {
const registrationMode = document.getElementById('form_admin_settings_registrations_mode');
if (registrationMode) onChangeRegistrationMode(registrationMode);
const React = require('react');
const ReactDOM = require('react-dom');
[].forEach.call(document.querySelectorAll('[data-admin-component]'), element => {
const componentName = element.getAttribute('data-admin-component');
const { locale, ...componentProps } = JSON.parse(element.getAttribute('data-props'));
import('../mastodon/containers/admin_component').then(({ default: AdminComponent }) => {
return import('../mastodon/components/admin/' + componentName).then(({ default: Component }) => {
ReactDOM.render((
<AdminComponent locale={locale}>
<Component {...componentProps} />
</AdminComponent>
), element);
});
}).catch(error => {
console.error(error);
});
});
});