Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cf573ab03 | |||
| fc55e9544d | |||
| 855d1b096f | |||
| 686aa2d0ba |
@@ -1,6 +1,20 @@
|
|||||||
<a name="readme-top"></a>
|
<a name="readme-top"></a>
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# [1.0.0-beta.10](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2025-02-16)
|
||||||
|
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
* **subscribe**: Update forms to include refetch functionality and improve toast messages ([fc55e95](https://github.com/perfect-panel/ppanel-web/commit/fc55e95))
|
||||||
|
|
||||||
|
# [1.0.0-beta.9](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2025-02-15)
|
||||||
|
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
* **register**: Adjust user email verification logic to handle domain suffix checks correctly ([686aa2d](https://github.com/perfect-panel/ppanel-web/commit/686aa2d))
|
||||||
|
|
||||||
# [1.0.0-beta.8](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2025-02-15)
|
# [1.0.0-beta.8](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2025-02-15)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function SubscribeConfig() {
|
|||||||
...data,
|
...data,
|
||||||
[key]: value,
|
[key]: value,
|
||||||
} as API.SubscribeConfig);
|
} as API.SubscribeConfig);
|
||||||
toast.success(t('saveSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
refetch();
|
refetch();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
/* empty */
|
/* empty */
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
server_group: z.array(z.number()).optional().default([]),
|
server_group: z.array(z.number()).optional().default([]),
|
||||||
server: z.array(z.number()).optional().default([]),
|
server: z.array(z.number()).optional().default([]),
|
||||||
deduction_ratio: z.number().optional().default(0),
|
deduction_ratio: z.number().optional().default(0),
|
||||||
purchase_with_discount: z.boolean().optional().default(false),
|
allow_deduction: z.boolean().optional().default(false),
|
||||||
reset_cycle: z.number().optional().default(0),
|
reset_cycle: z.number().optional().default(0),
|
||||||
renewal_reset: z.boolean().optional().default(false),
|
renewal_reset: z.boolean().optional().default(false),
|
||||||
});
|
});
|
||||||
@@ -639,7 +639,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
/>
|
/>
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name='purchase_with_discount'
|
name='allow_deduction'
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { useTranslations } from 'next-intl';
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
export function AuthMethodsForm({ user }: { user: API.User }) {
|
export function AuthMethodsForm({ user, refetch }: { user: API.User; refetch: () => void }) {
|
||||||
const t = useTranslations('user');
|
const t = useTranslations('user');
|
||||||
|
|
||||||
const [emailChanges, setEmailChanges] = useState<Record<string, string>>({});
|
const [emailChanges, setEmailChanges] = useState<Record<string, string>>({});
|
||||||
@@ -33,6 +33,7 @@ export function AuthMethodsForm({ user }: { user: API.User }) {
|
|||||||
auth_identifier: email,
|
auth_identifier: email,
|
||||||
});
|
});
|
||||||
toast.success(t('updateSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
|
refetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreateEmail = async (email: string) => {
|
const handleCreateEmail = async (email: string) => {
|
||||||
@@ -42,6 +43,7 @@ export function AuthMethodsForm({ user }: { user: API.User }) {
|
|||||||
auth_identifier: email,
|
auth_identifier: email,
|
||||||
});
|
});
|
||||||
toast.success(t('createSuccess'));
|
toast.success(t('createSuccess'));
|
||||||
|
refetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEmailChange = (authType: string, value: string) => {
|
const handleEmailChange = (authType: string, value: string) => {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const basicInfoSchema = z.object({
|
|||||||
|
|
||||||
type BasicInfoValues = z.infer<typeof basicInfoSchema>;
|
type BasicInfoValues = z.infer<typeof basicInfoSchema>;
|
||||||
|
|
||||||
export function BasicInfoForm({ user }: { user: API.User }) {
|
export function BasicInfoForm({ user, refetch }: { user: API.User; refetch: () => void }) {
|
||||||
const t = useTranslations('user');
|
const t = useTranslations('user');
|
||||||
|
|
||||||
const { common } = useGlobalStore();
|
const { common } = useGlobalStore();
|
||||||
@@ -64,6 +64,7 @@ export function BasicInfoForm({ user }: { user: API.User }) {
|
|||||||
...data,
|
...data,
|
||||||
} as API.UpdateUserBasiceInfoRequest);
|
} as API.UpdateUserBasiceInfoRequest);
|
||||||
toast.success(t('updateSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
|
refetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { NotifySettingsForm } from './notify-settings-form';
|
|||||||
export function UserProfileForm() {
|
export function UserProfileForm() {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
|
|
||||||
const { data: user } = useQuery({
|
const { data: user, refetch } = useQuery({
|
||||||
queryKey: ['user', id],
|
queryKey: ['user', id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await getUserDetail({
|
const { data } = await getUserDetail({
|
||||||
@@ -25,13 +25,13 @@ export function UserProfileForm() {
|
|||||||
return (
|
return (
|
||||||
<div className='grid gap-4 md:grid-cols-2 xl:grid-cols-3'>
|
<div className='grid gap-4 md:grid-cols-2 xl:grid-cols-3'>
|
||||||
<div className='md:col-span-2 xl:col-span-1'>
|
<div className='md:col-span-2 xl:col-span-1'>
|
||||||
<BasicInfoForm user={user} />
|
<BasicInfoForm user={user} refetch={refetch} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<NotifySettingsForm user={user} />
|
<NotifySettingsForm user={user} refetch={refetch} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<AuthMethodsForm user={user} />
|
<AuthMethodsForm user={user} refetch={refetch} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const notifySettingsSchema = z.object({
|
|||||||
|
|
||||||
type NotifySettingsValues = z.infer<typeof notifySettingsSchema>;
|
type NotifySettingsValues = z.infer<typeof notifySettingsSchema>;
|
||||||
|
|
||||||
export function NotifySettingsForm({ user }: { user: API.User }) {
|
export function NotifySettingsForm({ user, refetch }: { user: API.User; refetch: () => void }) {
|
||||||
const t = useTranslations('user');
|
const t = useTranslations('user');
|
||||||
|
|
||||||
const form = useForm<NotifySettingsValues>({
|
const form = useForm<NotifySettingsValues>({
|
||||||
@@ -39,6 +39,7 @@ export function NotifySettingsForm({ user }: { user: API.User }) {
|
|||||||
user_id: user.id,
|
user_id: user.id,
|
||||||
});
|
});
|
||||||
toast.success(t('updateSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
|
refetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -31,11 +31,10 @@ export default function RegisterForm({
|
|||||||
|
|
||||||
const handleCheckUser = async (email: string) => {
|
const handleCheckUser = async (email: string) => {
|
||||||
try {
|
try {
|
||||||
|
if (!auth.email.enable_verify) return true;
|
||||||
const domain = email.split('@')[1];
|
const domain = email.split('@')[1];
|
||||||
const isValid =
|
const isValid = auth.email?.domain_suffix_list.split('\n').includes(domain || '');
|
||||||
!auth.email.enable_verify ||
|
return isValid;
|
||||||
auth.email?.domain_suffix_list.split('\n').includes(domain || '');
|
|
||||||
return !isValid;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error checking user:', error);
|
console.log('Error checking user:', error);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ppanel-web",
|
"name": "ppanel-web",
|
||||||
"version": "1.0.0-beta.8",
|
"version": "1.0.0-beta.10",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
Reference in New Issue
Block a user