From 020a010eea1b12714447c4babb67abc02ff030de Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 14:09:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20DEC-9068=20=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=E6=98=BE=E7=A4=BA=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=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'), + }, ], }, ],