From e96583ebf950fbda9be9af391bd889b5f02bf1de Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 11:41:51 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20DEC-9068=20=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=97=B6=E6=98=BE=E7=A4=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection_pool/connection_pool.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/pages/connection_pool/connection_pool.ts b/src/modules/pages/connection_pool/connection_pool.ts index d4a4138..300e98e 100644 --- a/src/modules/pages/connection_pool/connection_pool.ts +++ b/src/modules/pages/connection_pool/connection_pool.ts @@ -1,5 +1,5 @@ import { shortcut, store } from '@core/core'; -import { ButtonGroup, Htape, Vtape, Label, Vertical } from 'ui'; +import { ButtonGroup, Htape, Vtape, Label, Vertical, Layout } from 'ui'; import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; import { ListItemXtype } from './list_item/list_item'; import { PoolXtype } from './pool/pool'; @@ -72,9 +72,13 @@ export class ConnectionPool extends BI.Widget { }, height: 40, }, - { - type: PoolXtype, - }, + this.model.connectionJDBC.length > 0 ? + { + type: PoolXtype, + } : + { + type: Layout, + }, ], }, ], From 020a010eea1b12714447c4babb67abc02ff030de Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 14:09:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20DEC-9068=20=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=97=B6=E6=98=BE=E7=A4=BA=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/connection_pool/connection_pool.ts | 64 ++++++++++++++----- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/src/modules/pages/connection_pool/connection_pool.ts b/src/modules/pages/connection_pool/connection_pool.ts index 300e98e..4749734 100644 --- a/src/modules/pages/connection_pool/connection_pool.ts +++ b/src/modules/pages/connection_pool/connection_pool.ts @@ -1,5 +1,5 @@ import { shortcut, store } from '@core/core'; -import { ButtonGroup, Htape, Vtape, Label, Vertical, Layout } from 'ui'; +import { ButtonGroup, Htape, Vtape, Label, Vertical, Layout, CenterAdapt } from 'ui'; import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; import { ListItemXtype } from './list_item/list_item'; import { PoolXtype } from './pool/pool'; @@ -57,28 +57,60 @@ export class ConnectionPool extends BI.Widget { }, width: 275, }, + this.model.connectionJDBC.length > 0 ? + this.renderPool() : this.renderNoConnection(), + ], + }; + } + + private renderPool() { + return { + type: Vtape, + items: [ + { + el: { + type: Label, + cls: 'bi-border-bottom', + textAlign: 'left', + lgap: 10, + ref: (_ref: any) => { + this.title = _ref; + }, + }, + height: 40, + }, + this.model.connectionJDBC.length > 0 ? + { + type: PoolXtype, + } : + { + type: Layout, + }, + ], + }; + } + + private renderNoConnection() { + return { + type: CenterAdapt, + items: [ { type: Vtape, + width: 260, + height: 150, items: [ { el: { - type: Label, - cls: 'bi-border-bottom', - textAlign: 'left', - lgap: 10, - ref: (_ref: any) => { - this.title = _ref; - }, - }, - height: 40, - }, - this.model.connectionJDBC.length > 0 ? - { - type: PoolXtype, - } : - { type: Layout, + cls: 'data-connection-background', }, + height: 130, + }, + { + type: Label, + cls: 'bi-tips', + text: BI.i18nText('Dec-Dcm_Connection_Plase_Add_One'), + }, ], }, ], From bbab4e8ffd4ddf97aced828021dd34775cf60212 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 14:16:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connection/connection_jdbc/connection_jdbc.ts | 2 ++ src/modules/pages/connection_pool/connection_pool.ts | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts index 919441f..81e83f3 100644 --- a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts +++ b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts @@ -18,6 +18,8 @@ export class ConnectionJdbc extends BI.Widget { const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; const { driver, database, host, user, newCharsetName, schema, connectionPool, port, authType, principal, keyPath } = connectionData; const databaseType = this.allDatabaseTypes.find(item => item.databaseType === database); + console.log('%cdatabase: ', 'color: MidnightBlue; background: Aquamarine;', database); + console.log('%cdatabaseType: ', 'color: MidnightBlue; background: Aquamarine;', databaseType); return { type: Vertical, diff --git a/src/modules/pages/connection_pool/connection_pool.ts b/src/modules/pages/connection_pool/connection_pool.ts index 4749734..7a449e3 100644 --- a/src/modules/pages/connection_pool/connection_pool.ts +++ b/src/modules/pages/connection_pool/connection_pool.ts @@ -79,13 +79,9 @@ export class ConnectionPool extends BI.Widget { }, height: 40, }, - this.model.connectionJDBC.length > 0 ? - { - type: PoolXtype, - } : - { - type: Layout, - }, + { + type: PoolXtype, + }, ], }; } From b079cd599ae4f403d1c66cad7af3edeab3c0838b Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 14:17:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4console.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/connection_jdbc/connection_jdbc.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts index 81e83f3..919441f 100644 --- a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts +++ b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts @@ -18,8 +18,6 @@ export class ConnectionJdbc extends BI.Widget { const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; const { driver, database, host, user, newCharsetName, schema, connectionPool, port, authType, principal, keyPath } = connectionData; const databaseType = this.allDatabaseTypes.find(item => item.databaseType === database); - console.log('%cdatabase: ', 'color: MidnightBlue; background: Aquamarine;', database); - console.log('%cdatabaseType: ', 'color: MidnightBlue; background: Aquamarine;', databaseType); return { type: Vertical,