File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -552,16 +552,7 @@ export class PawSQLTreeProvider
552552 }
553553
554554 if ( ! ( isBackendConnected && isFrontendConnected && isApikeyValid ) ) {
555- const choice = await vscode . window . showErrorMessage (
556- LanguageService . getMessage ( "pawsql.config.validate.failed" ) +
557- `${
558- failedCommand . length === 0 ? "" : `: ${ failedCommand . join ( "," ) } `
559- } `,
560- LanguageService . getMessage ( "init.pawsql.config" )
561- ) ;
562- if ( choice === LanguageService . getMessage ( "init.pawsql.config" ) ) {
563- vscode . commands . executeCommand ( "pawsql.openSettings" ) ;
564- }
555+ vscode . commands . executeCommand ( "pawsql.openSettings" ) ;
565556 }
566557 return isBackendConnected && isFrontendConnected && isApikeyValid ;
567558 } catch ( error : any ) {
Original file line number Diff line number Diff line change 3535 "sidebar.show.statement.detail" : " 展示语句优化详情" ,
3636 "sidebar.apiKey.label" : " ApiKey" ,
3737 "sidebar.backendUrl.label" : " PawSQL 服务器" ,
38+ "sidebar.frontendUrl.label" : " PawSQL Website" ,
3839 "error.config.validate.failed" : " 验证失败" ,
3940 "error.config.validate.success" : " 验证成功" ,
4041 "error.load.data.failed" : " 加载数据失败" ,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const ConfigForm: React.FC<ConfigFormProps> = ({
4343 ...initialConfig ,
4444 } ;
4545 const [ initFlag , setInitFlag ] = React . useState ( false ) ;
46+ const [ loading , setLoading ] = React . useState ( false ) ;
4647
4748 const [ formState , setFormState ] = React . useState < Config > ( defaultConfig ) ;
4849 const [ snackbarOpen , setSnackbarOpen ] = React . useState ( false ) ;
@@ -62,12 +63,14 @@ const ConfigForm: React.FC<ConfigFormProps> = ({
6263
6364 const handleSubmit = async ( event : React . FormEvent ) => {
6465 event . preventDefault ( ) ;
66+ setLoading ( true ) ;
6567 setInitFlag ( true ) ;
6668 await onSubmit ( formState ) ;
6769 } ;
6870 useEffect ( ( ) => {
6971 if ( initFlag ) {
7072 setSnackbarOpen ( true ) ;
73+ setLoading ( false ) ;
7174 }
7275 } , [ refresh ] ) ;
7376
@@ -183,6 +186,7 @@ const ConfigForm: React.FC<ConfigFormProps> = ({
183186 type = "submit"
184187 variant = "contained"
185188 fullWidth
189+ disabled = { loading }
186190 sx = { {
187191 height : "48px" ,
188192 fontSize : "16px" ,
You can’t perform that action at this time.
0 commit comments