|
|
@ -47,7 +47,7 @@ export class RequestPageComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {; |
|
|
|
ngOnInit(): void {; |
|
|
|
this.getSchemas(); |
|
|
|
this.getSchemas(); |
|
|
|
this.getTables(); |
|
|
|
//this.getTables();
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public getSchemas():void { |
|
|
|
public getSchemas():void { |
|
|
@ -72,6 +72,25 @@ export class RequestPageComponent implements OnInit { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public sortCorrectly(){ |
|
|
|
|
|
|
|
if(this.filterTable.length > 2){ |
|
|
|
|
|
|
|
if(this.schemaName){ |
|
|
|
|
|
|
|
this.infoTableService.getTablesWithFilterAndSchema(this.filterTable, this.schemaName).subscribe( |
|
|
|
|
|
|
|
(response: InfoTable[]) => { |
|
|
|
|
|
|
|
console.log(response); |
|
|
|
|
|
|
|
this.tablesBySchema = response; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.infoTableService.getTablesWithFilter(this.filterTable).subscribe( |
|
|
|
|
|
|
|
(response: InfoTable[]) => { |
|
|
|
|
|
|
|
console.log(response); |
|
|
|
|
|
|
|
this.infoTable = response; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public divideColumns(nameSch: String, tempsTab: InfoTable):void { |
|
|
|
public divideColumns(nameSch: String, tempsTab: InfoTable):void { |
|
|
|
console.log(nameSch, tempsTab.nameTable) |
|
|
|
console.log(nameSch, tempsTab.nameTable) |
|
|
|
this.infoColumnService.getSelectedColumns(nameSch, tempsTab.nameTable).subscribe( |
|
|
|
this.infoColumnService.getSelectedColumns(nameSch, tempsTab.nameTable).subscribe( |
|
|
@ -110,18 +129,17 @@ export class RequestPageComponent implements OnInit { |
|
|
|
if(this.schemaName){ |
|
|
|
if(this.schemaName){ |
|
|
|
this.selectedSchema = this.schemaName; |
|
|
|
this.selectedSchema = this.schemaName; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.log(this.schemaData) |
|
|
|
|
|
|
|
this.selectedSchema = this.schemaData.nameSchema; |
|
|
|
this.selectedSchema = this.schemaData.nameSchema; |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.selectedSchema){ |
|
|
|
if(this.selectedSchema){ |
|
|
|
this.infoTableService.getTablesBySchema(this.selectedSchema).subscribe( |
|
|
|
// this.infoTableService.getTablesBySchema(this.selectedSchema).subscribe(
|
|
|
|
(response : InfoTable[]) => { |
|
|
|
// (response : InfoTable[]) => {
|
|
|
|
this.tablesBySchema = response; |
|
|
|
// this.tablesBySchema = response;
|
|
|
|
}, |
|
|
|
// },
|
|
|
|
(error: HttpErrorResponse) => { |
|
|
|
// (error: HttpErrorResponse) => {
|
|
|
|
alert(error.message) |
|
|
|
// alert(error.message)
|
|
|
|
} |
|
|
|
// }
|
|
|
|
); |
|
|
|
// );
|
|
|
|
if(this.tableData){ |
|
|
|
if(this.tableData){ |
|
|
|
this.divideColumns(this.selectedSchema, this.tableData); |
|
|
|
this.divideColumns(this.selectedSchema, this.tableData); |
|
|
|
} |
|
|
|
} |
|
|
@ -158,6 +176,9 @@ export class RequestPageComponent implements OnInit { |
|
|
|
this.infoColumn = undefined; |
|
|
|
this.infoColumn = undefined; |
|
|
|
this.currentTable = undefined; |
|
|
|
this.currentTable = undefined; |
|
|
|
this.tableData = undefined; |
|
|
|
this.tableData = undefined; |
|
|
|
|
|
|
|
this.filterTable = ""; |
|
|
|
|
|
|
|
this.infoTable = undefined; |
|
|
|
|
|
|
|
this.schemaName = undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|