feat: add change user-config

This commit is contained in:
2025-04-03 19:22:41 +08:00
parent 1e10c8529e
commit 521255c1af
25 changed files with 1667 additions and 762 deletions

View File

@@ -72,15 +72,15 @@ const FormModal = () => {
}}>
<DialogTitle>{isEdit ? 'Edit' : 'Add'}</DialogTitle>
<DialogContent>
<form className='flex flex-col gap-6' onSubmit={handleSubmit(onFinish)}>
<form className='flex flex-col gap-6 py-4' onSubmit={handleSubmit(onFinish)}>
<Controller name='key' control={control} defaultValue='' render={({ field }) => <TextField label='key' {...field} disabled />} />
<Controller name='version' control={control} defaultValue='' render={({ field }) => <TextField label='version' {...field} />} />
<div>
<Button type='submit' variant='contained' color='primary'>
{t('submit')}
{t('Submit')}
</Button>
<Button className='ml-2' onClick={onClose}>
{t('cancel')}
{t('Cancel')}
</Button>
</div>
</form>
@@ -117,10 +117,10 @@ export const AppVersionList = () => {
versionStore.setKey(appKey);
versionStore.getList();
}
}, []);
}, [appKey]);
const appVersion = useMemo(() => {
return versionStore.app?.version || '';
}, [versionStore.app]);
}, [versionStore.app?.version]);
return (
<div className='w-full h-full flex bg-slate-100'>
<div className='p-2 bg-white'>
@@ -153,6 +153,7 @@ export const AppVersionList = () => {
const isPublish = item.version === appVersion;
const color = isPublish ? 'bg-green-500' : '';
const isRunning = item.status === 'running';
console.log('appVersion', item, appVersion, versionStore.app);
return (
<div className='card w-[300px]' key={index}>
<div className={'flex items-center justify-between'}>