Skip to content

Commit d10bae6

Browse files
authored
Merge pull request #258 from qianmoQ/1.22.0-SNAPSHOT
1.22.0 snapshot
2 parents 0745036 + 8d9ab31 commit d10bae6

7 files changed

Lines changed: 36 additions & 17 deletions

File tree

src/renderer/app/pages/management/datasource/datasource.component.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ng-template>
1212
</nz-empty>
1313
<ng-template #notHasValues>
14-
<nz-table #basicTable [nzData]="tableDetails">
14+
<nz-table #basicTable [nzData]="tableDetails" nzTableLayout="fixed">
1515
<thead>
1616
<tr>
1717
<th>{{'common.alias' | translate}}</th>
@@ -31,13 +31,15 @@
3131
</thead>
3232
<tbody>
3333
<tr *ngFor="let data of basicTable.data" style="{{!data.status ? 'color: #F50;': ''}}">
34-
<td>{{data.alias}}</td>
35-
<td>{{data.name ? data.name : '-'}}</td>
36-
<td>{{data.host}}</td>
37-
<td>{{data.protocol}}</td>
38-
<td>{{data.type}}</td>
39-
<td>{{data.username ? data.username : '-'}}</td>
40-
<td>{{data.version ? data.version : '-'}}</td>
34+
<td nzEllipsis>{{data.alias}}</td>
35+
<td nzEllipsis>{{data.name ? data.name : '-'}}</td>
36+
<td nzEllipsis>{{data.host}}</td>
37+
<td nzEllipsis>{{data.protocol}}</td>
38+
<td>
39+
<nz-avatar nzIcon="user" nzSrc="/renderer/assets/icon/source/{{data.type}}.svg"></nz-avatar>
40+
</td>
41+
<td nzEllipsis>{{data.username ? data.username : '-'}}</td>
42+
<td nzEllipsis>{{data.version ? data.version : '-'}}</td>
4143
<td>
4244
<button nz-button nzShape="circle" nzSize="small" nzType="primary"
4345
nz-tooltip nzTooltipTitle="{{'common.edit' | translate}}">

src/renderer/app/pages/query/beta/query.beta.component.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@
4444
<i nz-icon nzType="close-circle" nzTheme="outline"></i>
4545
{{'common.cancel'|translate}}
4646
</button>
47+
<div *ngIf="applyResult.headers.length > 0 && applyResult?.statistics" style="float: right;">
48+
<nz-tag [nzColor]="'#87d068'" nz-tooltip nzTooltipTitle="{{'tooltip.rows'|translate}}">
49+
<i class="fa fa-columns"></i> {{applyResult.columns.length}}
50+
</nz-tag>
51+
<nz-tag [nzColor]="'#87d068'" nz-tooltip nzTooltipTitle="{{'tooltip.elapsed'|translate}}">
52+
<i class="fa fa-clock-o"></i> {{applyResult.statistics.elapsed}}
53+
</nz-tag>
54+
<nz-tag [nzColor]="'#87d068'" nz-tooltip nzTooltipTitle="{{'tooltip.rowsRead'|translate}}">
55+
<i class="fa fa-columns"></i> {{applyResult.statistics.rows_read}}
56+
</nz-tag>
57+
<nz-tag [nzColor]="'#87d068'" nz-tooltip nzTooltipTitle="{{'tooltip.bytesRead'|translate}}">
58+
<i class="fa fa-braille"></i> {{applyResult.statistics.bytes_read}}
59+
</nz-tag>
60+
</div>
4761
</ng-template>
4862
</div>
4963
<div nz-col class="gutter-row" [nzSpan]="24">

src/renderer/app/pages/query/beta/query.beta.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export class QueryBetaComponent implements AfterViewInit, AfterViewChecked {
6262
configuration: {...DefaultConfig},
6363
headers: [],
6464
columns: [],
65+
statistics: null,
6566
message: null,
6667
status: false,
6768
height: 0,
@@ -231,6 +232,7 @@ export class QueryBetaComponent implements AfterViewInit, AfterViewChecked {
231232
this.applyResult.headers.push({key: column.name, title: column.name});
232233
});
233234
this.applyResult.columns = response.data.columns;
235+
this.applyResult.statistics = response.data.statistics;
234236
if (this.applyResult.headers.length > 0) {
235237
this.applyResult.columns = response.data.columns;
236238
if (this.applyResult.columns.length > 0) {

src/renderer/components/datasource/clickhouse/datasource.clickhouse.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<nz-form-control nzErrorTip="{{'placeholder.protocol'|translate}}">
2424
<nz-radio-group formControlName="protocol" [(ngModel)]="configure.protocol">
2525
<label nz-radio nzValue="HTTP">HTTP</label>
26+
<label nz-radio nzValue="HTTPS">HTTPS</label>
2627
<label nz-radio nzValue="SSH">SSH</label>
2728
</nz-radio-group>
2829
</nz-form-control>

src/renderer/config/plugin/mysql.config.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { BaseConfig } from "@renderer/config/base.config";
33
export class MySQLConfig implements BaseConfig {
44
columnDiskUsedRatio = `SELECT '{0}' AS db, '{1}' AS name`;
55
columnItems = `
6-
SELECT
7-
TABLE_SCHEMA AS "database", TABLE_NAME AS tableName, COLUMN_NAME AS name,
6+
SELECT TABLE_SCHEMA AS "database", TABLE_NAME AS tableName, COLUMN_NAME AS name
87
-- DATA_TYPE AS type
9-
concat(DATA_TYPE, '(', CHARACTER_MAXIMUM_LENGTH, ')') AS type
8+
-- concat(DATA_TYPE, '(', CHARACTER_MAXIMUM_LENGTH, ')') AS type
109
FROM information_schema.columns
1110
WHERE table_schema = '{0}' AND table_name = '{1}'
1211
GROUP BY COLUMN_NAME
@@ -87,9 +86,7 @@ FROM information_schema.tables
8786
WHERE table_schema = '{0}'
8887
`;
8988
tableItems = `
90-
SELECT
91-
table_schema AS "database", TABLE_NAME AS name,
92-
ENGINE AS value, MAX_DATA_LENGTH AS total_rows
89+
SELECT table_schema AS "database", TABLE_NAME AS name
9390
FROM information_schema.tables
9491
WHERE table_schema = '{0}'
9592
GROUP BY TABLE_NAME

src/renderer/plugin/clickhouse.plugin.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import { UrlUtils } from "@renderer/utils/url.utils";
1414
export class ClickHousePlugin implements PluginInterface {
1515

1616
constructor(private httpService: HttpService,
17-
private sshService: SshService,
18-
private basicService: BasicService) { }
17+
private sshService: SshService,
18+
private basicService: BasicService) {
19+
}
1920

2021
getName(): DatabaseEnum {
2122
return DatabaseEnum.clickhosue;
@@ -29,6 +30,7 @@ export class ClickHousePlugin implements PluginInterface {
2930
const configure = request.config;
3031
switch (configure.protocol) {
3132
case 'HTTP':
33+
case 'HTTPS':
3234
return this.httpService.post(UrlUtils.formatUrl(request), sql);
3335
case 'SSH':
3436
const basicConfig = this.getConfig();
@@ -49,4 +51,4 @@ export class ClickHousePlugin implements PluginInterface {
4951
return Promise.reject(new Error('Unsupported protocol'));
5052
}
5153
}
52-
}
54+
}

src/renderer/services/forward.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class ForwardService {
3636
const configure = request.config;
3737
switch (configure.protocol) {
3838
case 'HTTP':
39+
case 'HTTPS':
3940
let response;
4041
switch (configure.type) {
4142
case DatabaseEnum.clickhosue:

0 commit comments

Comments
 (0)