From 3ad2bc2f8e285368ccd8a6d388b111719197c9aa Mon Sep 17 00:00:00 2001 From: alan Date: Wed, 25 Sep 2019 18:07:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DEC-10046=20=E6=94=B9=E4=B8=BA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.service.ts | 6 ++++++ src/modules/pages/connection/list/list_item/list_item.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index a9df67a..d30a881 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -97,3 +97,9 @@ export function connectionCanEdit(connection: Connection) { return true; } + +export function getTextByDatabaseType(databaseType: string) { + const database = DATA_BASE_TYPES.find(item => item.databaseType === databaseType); + + return database ? database.text : ''; +} diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index ce32b2e..cd1faa3 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -7,7 +7,7 @@ import { TestStatusXtype, TestStatus, EVENT_CLOSE, EVENT_RELOAD } from 'src/modu import { hasRegistered } from '../list.service'; import { connectionType } from '@constants/env'; import { ConnectionJDBC } from 'src/modules/crud/crud.typings'; -import { connectionCanEdit } from '../../../../app.service'; +import { connectionCanEdit, getTextByDatabaseType } from '../../../../app.service'; export const ListItemXtype = 'dec.dcm.connection.list_item'; @shortcut(ListItemXtype) @@ -126,7 +126,7 @@ export class ListItem extends BI.BasicButton { const isRegistered = hasRegistered(databaseType); const otherIcons = [ { - text: BI.i18nText('Dec-Dcm_Type', databaseType), + text: BI.i18nText('Dec-Dcm_Type', getTextByDatabaseType(databaseType)), disabled: true, cls: 'dcm-info-font', value: 12,