|
@@ -44,7 +44,6 @@ export const AuthForm = () => {
|
|
|
|
|
|
// i18n
|
|
// i18n
|
|
const { t: commonTrans } = useTranslation();
|
|
const { t: commonTrans } = useTranslation();
|
|
- const attuTrans = commonTrans('attu');
|
|
|
|
const { t: btnTrans } = useTranslation('btn');
|
|
const { t: btnTrans } = useTranslation('btn');
|
|
const { t: warningTrans } = useTranslation('warning');
|
|
const { t: warningTrans } = useTranslation('warning');
|
|
const { t: successTrans } = useTranslation('success');
|
|
const { t: successTrans } = useTranslation('success');
|
|
@@ -244,8 +243,8 @@ export const AuthForm = () => {
|
|
<section className={classes.wrapper}>
|
|
<section className={classes.wrapper}>
|
|
<div className={classes.titleWrapper}>
|
|
<div className={classes.titleWrapper}>
|
|
<Typography variant="h4" component="h4">
|
|
<Typography variant="h4" component="h4">
|
|
- {attuTrans.connectTitle}
|
|
|
|
- <CustomToolTip title={attuTrans.connectionTip}>
|
|
|
|
|
|
+ {commonTrans('attu.connectTitle')}
|
|
|
|
+ <CustomToolTip title={commonTrans('attu.connectionTip')}>
|
|
<Icons.info />
|
|
<Icons.info />
|
|
</CustomToolTip>
|
|
</CustomToolTip>
|
|
</Typography>
|
|
</Typography>
|
|
@@ -255,13 +254,13 @@ export const AuthForm = () => {
|
|
<CustomInput
|
|
<CustomInput
|
|
type="text"
|
|
type="text"
|
|
textConfig={{
|
|
textConfig={{
|
|
- label: attuTrans.address,
|
|
|
|
|
|
+ label: commonTrans('attu.address'),
|
|
key: 'address',
|
|
key: 'address',
|
|
onChange: (val: string) =>
|
|
onChange: (val: string) =>
|
|
handleInputChange('address', String(val)),
|
|
handleInputChange('address', String(val)),
|
|
variant: 'filled',
|
|
variant: 'filled',
|
|
className: classes.input,
|
|
className: classes.input,
|
|
- placeholder: attuTrans.address,
|
|
|
|
|
|
+ placeholder: commonTrans('attu.address'),
|
|
fullWidth: true,
|
|
fullWidth: true,
|
|
InputProps: {
|
|
InputProps: {
|
|
endAdornment: (
|
|
endAdornment: (
|
|
@@ -277,7 +276,7 @@ export const AuthForm = () => {
|
|
{
|
|
{
|
|
rule: 'require',
|
|
rule: 'require',
|
|
errorText: warningTrans('required', {
|
|
errorText: warningTrans('required', {
|
|
- name: attuTrans.address,
|
|
|
|
|
|
+ name: commonTrans('attu.address'),
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -285,14 +284,14 @@ export const AuthForm = () => {
|
|
}}
|
|
}}
|
|
checkValid={checkIsValid}
|
|
checkValid={checkIsValid}
|
|
validInfo={validation}
|
|
validInfo={validation}
|
|
- key={attuTrans.address}
|
|
|
|
|
|
+ key={commonTrans('attu.address')}
|
|
/>
|
|
/>
|
|
|
|
|
|
{/* db */}
|
|
{/* db */}
|
|
<CustomInput
|
|
<CustomInput
|
|
type="text"
|
|
type="text"
|
|
textConfig={{
|
|
textConfig={{
|
|
- label: `Milvus ${dbTrans('database')} ${attuTrans.optional}`,
|
|
|
|
|
|
+ label: `Milvus ${dbTrans('database')} ${commonTrans('attu.optional')}`,
|
|
key: 'database',
|
|
key: 'database',
|
|
onChange: (value: string) => handleInputChange('database', value),
|
|
onChange: (value: string) => handleInputChange('database', value),
|
|
variant: 'filled',
|
|
variant: 'filled',
|
|
@@ -303,14 +302,14 @@ export const AuthForm = () => {
|
|
}}
|
|
}}
|
|
checkValid={checkIsValid}
|
|
checkValid={checkIsValid}
|
|
validInfo={validation}
|
|
validInfo={validation}
|
|
- key={attuTrans.database}
|
|
|
|
|
|
+ key={commonTrans('attu.database')}
|
|
/>
|
|
/>
|
|
|
|
|
|
{/* toggle auth */}
|
|
{/* toggle auth */}
|
|
<div className={classes.toggle}>
|
|
<div className={classes.toggle}>
|
|
<CustomRadio
|
|
<CustomRadio
|
|
checked={withPass}
|
|
checked={withPass}
|
|
- label={attuTrans.authentication}
|
|
|
|
|
|
+ label={commonTrans('attu.authentication')}
|
|
handleChange={handleEnableAuth}
|
|
handleChange={handleEnableAuth}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -321,55 +320,55 @@ export const AuthForm = () => {
|
|
<CustomInput
|
|
<CustomInput
|
|
type="text"
|
|
type="text"
|
|
textConfig={{
|
|
textConfig={{
|
|
- label: `${attuTrans.token} ${attuTrans.optional} `,
|
|
|
|
|
|
+ label: `${commonTrans('attu.token')} ${commonTrans('attu.optional')} `,
|
|
key: 'token',
|
|
key: 'token',
|
|
onChange: (val: string) => handleInputChange('token', val),
|
|
onChange: (val: string) => handleInputChange('token', val),
|
|
variant: 'filled',
|
|
variant: 'filled',
|
|
className: classes.input,
|
|
className: classes.input,
|
|
- placeholder: attuTrans.token,
|
|
|
|
|
|
+ placeholder: commonTrans('attu.token'),
|
|
fullWidth: true,
|
|
fullWidth: true,
|
|
value: authReq.token,
|
|
value: authReq.token,
|
|
}}
|
|
}}
|
|
checkValid={checkIsValid}
|
|
checkValid={checkIsValid}
|
|
validInfo={validation}
|
|
validInfo={validation}
|
|
- key={attuTrans.token}
|
|
|
|
|
|
+ key={commonTrans('attu.token')}
|
|
/>
|
|
/>
|
|
{/* user */}
|
|
{/* user */}
|
|
<CustomInput
|
|
<CustomInput
|
|
type="text"
|
|
type="text"
|
|
textConfig={{
|
|
textConfig={{
|
|
- label: `${attuTrans.username} ${attuTrans.optional}`,
|
|
|
|
|
|
+ label: `${commonTrans('attu.username')} ${commonTrans('attu.optional')}`,
|
|
key: 'username',
|
|
key: 'username',
|
|
onChange: (value: string) =>
|
|
onChange: (value: string) =>
|
|
handleInputChange('username', value),
|
|
handleInputChange('username', value),
|
|
variant: 'filled',
|
|
variant: 'filled',
|
|
className: classes.input,
|
|
className: classes.input,
|
|
- placeholder: attuTrans.username,
|
|
|
|
|
|
+ placeholder: commonTrans('attu.username'),
|
|
fullWidth: true,
|
|
fullWidth: true,
|
|
value: authReq.username,
|
|
value: authReq.username,
|
|
}}
|
|
}}
|
|
checkValid={checkIsValid}
|
|
checkValid={checkIsValid}
|
|
validInfo={validation}
|
|
validInfo={validation}
|
|
- key={attuTrans.username}
|
|
|
|
|
|
+ key={commonTrans('attu.username')}
|
|
/>
|
|
/>
|
|
{/* pass */}
|
|
{/* pass */}
|
|
<CustomInput
|
|
<CustomInput
|
|
type="text"
|
|
type="text"
|
|
textConfig={{
|
|
textConfig={{
|
|
- label: `${attuTrans.password} ${attuTrans.optional}`,
|
|
|
|
|
|
+ label: `${commonTrans('attu.password')} ${commonTrans('attu.optional')}`,
|
|
key: 'password',
|
|
key: 'password',
|
|
onChange: (value: string) =>
|
|
onChange: (value: string) =>
|
|
handleInputChange('password', value),
|
|
handleInputChange('password', value),
|
|
variant: 'filled',
|
|
variant: 'filled',
|
|
className: classes.input,
|
|
className: classes.input,
|
|
- placeholder: attuTrans.password,
|
|
|
|
|
|
+ placeholder: commonTrans('attu.password'),
|
|
fullWidth: true,
|
|
fullWidth: true,
|
|
type: 'password',
|
|
type: 'password',
|
|
value: authReq.password,
|
|
value: authReq.password,
|
|
}}
|
|
}}
|
|
checkValid={checkIsValid}
|
|
checkValid={checkIsValid}
|
|
validInfo={validation}
|
|
validInfo={validation}
|
|
- key={attuTrans.password}
|
|
|
|
|
|
+ key={commonTrans('attu.password')}
|
|
/>
|
|
/>
|
|
</>
|
|
</>
|
|
)}
|
|
)}
|
|
@@ -380,10 +379,10 @@ export const AuthForm = () => {
|
|
control={
|
|
control={
|
|
<Checkbox
|
|
<Checkbox
|
|
checked={authReq.ssl}
|
|
checked={authReq.ssl}
|
|
- onChange={(e) => handleInputChange('ssl', e.target.checked)}
|
|
|
|
|
|
+ onChange={e => handleInputChange('ssl', e.target.checked)}
|
|
/>
|
|
/>
|
|
}
|
|
}
|
|
- label={attuTrans.ssl}
|
|
|
|
|
|
+ label={commonTrans('attu.ssl')}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -400,7 +399,9 @@ export const AuthForm = () => {
|
|
handleInputChange('checkHealth', e.target.checked);
|
|
handleInputChange('checkHealth', e.target.checked);
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
- <Typography component="span">{attuTrans.checkHealth}</Typography>
|
|
|
|
|
|
+ <Typography component="span">
|
|
|
|
+ {commonTrans('attu.checkHealth')}
|
|
|
|
+ </Typography>
|
|
</label>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|