2024-11-20 22:22:16 +01:00
|
|
|
|
import React from 'react';
|
2025-07-23 08:47:26 +02:00
|
|
|
|
import { Modal } from '@douyinfe/semi-ui';
|
2024-11-20 22:22:16 +01:00
|
|
|
|
import Logo from '../logo/Logo.jsx';
|
2025-07-23 08:47:26 +02:00
|
|
|
|
import { xhrPost } from '../../services/xhr.js';
|
2024-11-20 22:22:16 +01:00
|
|
|
|
|
|
|
|
|
|
import './TrackingModal.less';
|
2025-07-19 20:10:19 +02:00
|
|
|
|
import inDevelopment from '../../services/developmentMode.js';
|
2024-11-20 22:22:16 +01:00
|
|
|
|
|
|
|
|
|
|
const saveResponse = async (analyticsEnabled) => {
|
2025-07-23 08:47:26 +02:00
|
|
|
|
await xhrPost('/api/admin/generalSettings', {
|
|
|
|
|
|
analyticsEnabled,
|
|
|
|
|
|
});
|
2024-11-20 22:22:16 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default function TrackingModal() {
|
2025-07-23 08:47:26 +02:00
|
|
|
|
if (inDevelopment()) {
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2024-11-20 22:22:16 +01:00
|
|
|
|
|
2025-07-23 08:47:26 +02:00
|
|
|
|
return (
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
visible={true}
|
|
|
|
|
|
onOk={async () => {
|
|
|
|
|
|
await saveResponse(true);
|
|
|
|
|
|
location.reload();
|
|
|
|
|
|
}}
|
|
|
|
|
|
onCancel={async () => {
|
|
|
|
|
|
await saveResponse(false);
|
|
|
|
|
|
location.reload();
|
|
|
|
|
|
}}
|
|
|
|
|
|
maskClosable={false}
|
|
|
|
|
|
closable={false}
|
|
|
|
|
|
okText="Yes! I want to help"
|
|
|
|
|
|
cancelText="No, thanks"
|
2024-11-20 22:22:16 +01:00
|
|
|
|
>
|
2025-07-23 08:47:26 +02:00
|
|
|
|
<Logo white />
|
|
|
|
|
|
<div className="trackingModal__description">
|
|
|
|
|
|
<p>Hey 👋</p>
|
|
|
|
|
|
<p>Fed up with popups? Yeah, me too. But this one’s important, and I promise it will only appear once ;)</p>
|
|
|
|
|
|
<p>
|
|
|
|
|
|
Fredy is completely free (and will always remain free). If you’d like, you can support me by donating through
|
|
|
|
|
|
my GitHub, but there’s absolutely no obligation to do so.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
|
|
|
However, it would be a huge help if you’d allow me to collect some analytical data. Wait, before you click
|
2025-09-12 13:38:53 +02:00
|
|
|
|
"no", let me explain. If you agree, Fredy will send a ping once every 6 hours to my internal tracking project.
|
|
|
|
|
|
(Will be open-sourced soon)
|
2025-07-23 08:47:26 +02:00
|
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
|
|
|
The data includes: names of active adapters/providers, OS, architecture, Node version, and language. The
|
|
|
|
|
|
information is entirely anonymous and helps me understand which adapters/providers are most frequently used.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p>Thanks🤘</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|