@@ -6,6 +6,7 @@ import { DatasourceService } from '@renderer/services/management/datasource.serv
66import { StringUtils } from '@renderer/utils/string.utils' ;
77import { NzMessageService } from 'ng-zorro-antd/message' ;
88import { DatabaseService } from '@renderer/services/management/database.service' ;
9+ import { DatabaseEnum } from "@renderer/enum/database.enum" ;
910
1011@Component ( {
1112 selector : 'app-component-rename-database' ,
@@ -37,14 +38,16 @@ export class DatabaseRenameComponent extends BaseComponent implements AfterViewI
3738 this . checkStatus = true ;
3839 const request = new RequestModel ( ) ;
3940 request . config = await this . dataSourceService . getByAliasAsync ( this . config . value ) ;
40- this . databaseService . getDatabase ( request , this . value )
41- . then ( response => {
42- if ( response . status ) {
43- this . checkStatus = response . data ?. columns [ 0 ] ?. isSupport ;
44- } else {
45- this . messageService . error ( response . message ) ;
46- }
47- } ) ;
41+ if ( request . config . type === DatabaseEnum . clickhosue ) {
42+ this . databaseService . getDatabase ( request , this . value )
43+ . then ( response => {
44+ if ( response . status ) {
45+ this . checkStatus = response . data ?. columns [ 0 ] ?. isSupport ;
46+ } else {
47+ this . messageService . error ( response . message ) ;
48+ }
49+ } ) ;
50+ }
4851 }
4952
5053 handlerValidate ( ) {
@@ -60,15 +63,15 @@ export class DatabaseRenameComponent extends BaseComponent implements AfterViewI
6063 const request = new RequestModel ( ) ;
6164 request . config = await this . dataSourceService . getByAliasAsync ( this . config . value ) ;
6265 this . databaseService . rename ( request , this . value , this . inputValue )
63- . then ( response => {
64- if ( response . status ) {
65- this . messageService . success ( response . message ) ;
66- this . config . status = true ;
67- this . emitter . emit ( this . config ) ;
68- } else {
69- this . messageService . error ( response . message ) ;
70- }
71- this . loading . button = false ;
72- } ) ;
66+ . then ( response => {
67+ if ( response . status ) {
68+ this . messageService . success ( response . message ) ;
69+ this . config . status = true ;
70+ this . emitter . emit ( this . config ) ;
71+ } else {
72+ this . messageService . error ( response . message ) ;
73+ }
74+ this . loading . button = false ;
75+ } ) ;
7376 }
7477}
0 commit comments