Browse Source
* commit 'c58b16497d43a0f75a373d48a5706bf2bdcef0b7': (116 commits) REPORT-114169 fix: 【多租户】新建数据连接输入框样式问题 BI-144496 fix: 数据连接增加埋点 getJdyDataLinkAppList REPORT-112276 公共数据取数简道云数据连接部分适配 设计优先级,优先使用平台内置的 FDL-9101 fix: 修复hana数据连接url联动输入框异常问题 REPORT-112768 fix: 修复数据连接更新视图不同步问题 REPORT-112768 fix: 修复数据连接更新视图不同步问题 REPORT-111534 fix:数据连接脏数据容错 无JIRA任务,修复打包问题 REPORT-109671 feat:druid校验语句问题 REPORT-110986 feat: 数据连接支持跳转至详情&联动 REPORT-110986 feat: 数据连接支持跳转至详情&联动 FDL-9101 fix: 修复saphana数据连接失败问题 FDL-9101 fix: 修复saphana数据连接失败问题 REPORT-107734 fix:【数据连接增加fetchsize配置项】tdsql数据连接特殊处理下 REPORT-107734【平台前端适配】数据连接增加fetchsize配置项 REPORT-102763 fix:数据连接支持对接业务系统-接口补充 REPORT-108103 Starrocks数据连接解析不包含catalog的数据连接出错 REPORT-108103 Starrocks数据连接解析不包含catalog的数据连接出错 REPORT-108103 Starrocks数据连接解析不包含catalog的数据连接出错 ...research/11.0
superman
6 months ago
61 changed files with 4507 additions and 1429 deletions
@ -1,3 +1,13 @@ |
|||||||
module.exports = function (api) { |
module.exports = api => { |
||||||
return require("@fui/babel-preset-fineui").configs.base(api) |
const { plugins, presets, sourceType } = require("@fui/babel-preset-fineui").configs.base(api); |
||||||
|
|
||||||
|
return { |
||||||
|
compact: false, |
||||||
|
presets, |
||||||
|
sourceType, |
||||||
|
plugins: [ |
||||||
|
...plugins, |
||||||
|
"@babel/plugin-proposal-logical-assignment-operators", |
||||||
|
], |
||||||
|
}; |
||||||
}; |
}; |
||||||
|
@ -0,0 +1,68 @@ |
|||||||
|
import { model, Model } from '@core/core'; |
||||||
|
|
||||||
|
type RootInfo = { |
||||||
|
url: string; // api url
|
||||||
|
prefix: string; // 路径前缀
|
||||||
|
root: string; // 根文件夹名称
|
||||||
|
}; |
||||||
|
|
||||||
|
export const ROOT_INFO_MAP: Record<string, RootInfo> = { |
||||||
|
// 证书 resources/certificates/
|
||||||
|
certificates: { |
||||||
|
url: '/v10/certificates/all', |
||||||
|
prefix: 'resources/', |
||||||
|
root: 'certificates', |
||||||
|
}, |
||||||
|
}; |
||||||
|
|
||||||
|
@model() |
||||||
|
export class FileChooserModel extends Model { |
||||||
|
static xtype = 'dec.dcm.model.components.file_chooser'; |
||||||
|
|
||||||
|
private options: { |
||||||
|
root: string; |
||||||
|
}; |
||||||
|
|
||||||
|
state() { |
||||||
|
return { |
||||||
|
keyword: '', // 搜索关键字
|
||||||
|
items: [], // 文件项
|
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
actions = { |
||||||
|
/** |
||||||
|
* 请求获取items |
||||||
|
* @param callback 回调 |
||||||
|
*/ |
||||||
|
requestGetItems: (callback?: Function) => { |
||||||
|
const { keyword } = this.model; |
||||||
|
const { url, prefix, root } = ROOT_INFO_MAP[this.options.root]; |
||||||
|
const requestUrl = `${url}?keyword=${encodeURIComponent(keyword)}`; |
||||||
|
Dec.reqGetHandle(requestUrl, '', (data) => { |
||||||
|
this.model.items = data |
||||||
|
.concat({ |
||||||
|
id: root, |
||||||
|
text: prefix + root, |
||||||
|
value: prefix + root, |
||||||
|
isParent: true, |
||||||
|
}) |
||||||
|
.map((item) => ({ |
||||||
|
...item, |
||||||
|
value: prefix + item.path, |
||||||
|
open: item.id === root || BI.isKey(keyword), |
||||||
|
})); |
||||||
|
BI.isFunction(callback) && callback(); |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
|
/** |
||||||
|
* 设置keyword |
||||||
|
* @param value |
||||||
|
*/ |
||||||
|
setKeyword: (value: string) => { |
||||||
|
this.model.keyword = value; |
||||||
|
this.requestGetItems(); |
||||||
|
}, |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,183 @@ |
|||||||
|
import { EVENT_CHANGE } from './../collapse/collapse'; |
||||||
|
import { shortcut, store } from '@core/core'; |
||||||
|
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor } from '@fui/core'; |
||||||
|
import { FileChooserModel } from './file_chooser.model'; |
||||||
|
|
||||||
|
@shortcut() |
||||||
|
@store(FileChooserModel, { |
||||||
|
props(this: FileChooser) { |
||||||
|
return this.options; |
||||||
|
}, |
||||||
|
}) |
||||||
|
export class FileChooser extends BI.Widget { |
||||||
|
static xtype = 'dec.dcm.components.file_chooser'; |
||||||
|
|
||||||
|
props = { |
||||||
|
width: 300, |
||||||
|
root: '', // 含义见model中的RootInfo
|
||||||
|
watermark: '', |
||||||
|
value: '', |
||||||
|
}; |
||||||
|
|
||||||
|
model: FileChooserModel['model']; |
||||||
|
store: FileChooserModel['store']; |
||||||
|
watch = { |
||||||
|
items: (value) => { |
||||||
|
this.fileTree.populate(value); |
||||||
|
}, |
||||||
|
}; |
||||||
|
|
||||||
|
textEditor: SignEditor; |
||||||
|
keywordEditor: SearchEditor; |
||||||
|
fileTree: MultiLayerSingleLevelTree; |
||||||
|
sureButton: Button; |
||||||
|
|
||||||
|
render() { |
||||||
|
const { width, watermark, value } = this.options; |
||||||
|
|
||||||
|
return { |
||||||
|
type: BI.VerticalAdaptLayout.xtype, |
||||||
|
height: 24, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.SignEditor.xtype, |
||||||
|
cls: 'bi-border-bottom bi-focus-shadow', |
||||||
|
width, |
||||||
|
height: 22, |
||||||
|
watermark, |
||||||
|
title: value, |
||||||
|
value, |
||||||
|
ref: (_ref: SignEditor) => { |
||||||
|
this.textEditor = _ref; |
||||||
|
}, |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: BI.SignEditor.EVENT_CHANGE, |
||||||
|
action: () => { |
||||||
|
const value = this.textEditor.getValue(); |
||||||
|
this.setValue(value); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.Button.xtype, |
||||||
|
|
||||||
|
text: BI.i18nText('Dec-Basic_Choose_File'), |
||||||
|
clear: true, |
||||||
|
handler: () => { |
||||||
|
this.openFileChoosePopover(); |
||||||
|
}, |
||||||
|
}, |
||||||
|
lgap: 10, |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
getValue(): string { |
||||||
|
return this.textEditor.getValue(); |
||||||
|
} |
||||||
|
|
||||||
|
setValue(value: string) { |
||||||
|
this.options.value = value; |
||||||
|
this.textEditor.text.setTitle(value); |
||||||
|
this.textEditor.setValue(value); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 打开文件选择弹窗 |
||||||
|
*/ |
||||||
|
private openFileChoosePopover() { |
||||||
|
// 重置搜索关键词
|
||||||
|
this.store.setKeyword(''); |
||||||
|
// 创建并显示窗口
|
||||||
|
const popoverName = BI.UUID(); |
||||||
|
BI.Popovers.create( |
||||||
|
popoverName, |
||||||
|
{ |
||||||
|
header: BI.i18nText('Dec-Data_Set_File_Select_Server_File'), |
||||||
|
body: { |
||||||
|
type: BI.VTapeLayout.xtype, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.SearchEditor.xtype, |
||||||
|
ref: (ref: SearchEditor) => { |
||||||
|
this.keywordEditor = ref; |
||||||
|
}, |
||||||
|
height: 24, |
||||||
|
value: this.model.keyword, |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: BI.SearchEditor.EVENT_CHANGE, |
||||||
|
action: () => { |
||||||
|
const value = this.keywordEditor.getValue(); |
||||||
|
this.store.setKeyword(value); |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
eventName: BI.SearchEditor.EVENT_CLEAR, |
||||||
|
action: () => { |
||||||
|
this.store.setKeyword(''); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.MultiLayerSingleLevelTree.xtype, |
||||||
|
ref: (ref: MultiLayerSingleLevelTree) => { |
||||||
|
this.fileTree = ref; |
||||||
|
}, |
||||||
|
keywordGetter: () => this.model.keyword, |
||||||
|
items: this.model.items, |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE, |
||||||
|
action: () => { |
||||||
|
this.sureButton.setEnable(true); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
tgap: 15, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: BI.RightVerticalAdaptLayout.xtype, |
||||||
|
height: 24, |
||||||
|
vgap: 10, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.Button.xtype, |
||||||
|
text: BI.i18nText('BI-Basic_Cancel'), |
||||||
|
level: 'ignore', |
||||||
|
handler: () => { |
||||||
|
BI.Popovers.remove(popoverName); |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.Button.xtype, |
||||||
|
ref: (ref: Button) => { |
||||||
|
this.sureButton = ref; |
||||||
|
}, |
||||||
|
text: BI.i18nText('BI-Basic_OK'), |
||||||
|
disabled: true, |
||||||
|
handler: () => { |
||||||
|
const value = this.fileTree.getValue()[0]; |
||||||
|
this.setValue(value); |
||||||
|
BI.Popovers.remove(popoverName); |
||||||
|
}, |
||||||
|
}, |
||||||
|
lgap: 10, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
this |
||||||
|
).show(popoverName); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
.data-conf-file { |
||||||
|
.x-icon{ |
||||||
|
width: 48px; |
||||||
|
height: 48px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.data-keytab-file { |
||||||
|
.x-icon{ |
||||||
|
width: 48px; |
||||||
|
height: 48px; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
import { model, Model } from '@core/core'; |
||||||
|
|
||||||
|
type UploadParam = { |
||||||
|
keytabPath: string; |
||||||
|
krb5ConfPath: string; |
||||||
|
principal: string; |
||||||
|
} |
||||||
|
|
||||||
|
@model() |
||||||
|
export class FileUploadModel extends Model { |
||||||
|
static xtype = 'dec.dcm.model.components.file_upload'; |
||||||
|
|
||||||
|
private options: { |
||||||
|
inter: string; |
||||||
|
} |
||||||
|
|
||||||
|
state() { |
||||||
|
return { |
||||||
|
uploadUrl: '', |
||||||
|
fileName: '', |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
actions = { |
||||||
|
setFileInfo: (params: UploadParam) => { |
||||||
|
const inter = this.options.inter; |
||||||
|
|
||||||
|
this.model.uploadUrl = Dec.Utils.getEncodeURL(Dec.fineServletURL + inter, "", params); |
||||||
|
}, |
||||||
|
|
||||||
|
setFileName:(v: string) => { |
||||||
|
this.model.fileName = v; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,327 @@ |
|||||||
|
import { shortcut, store } from '@core/core'; |
||||||
|
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor, Label } from '@fui/core'; |
||||||
|
import { FileUploadModel } from './file_upload.model'; |
||||||
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
||||||
|
import './file_upload.less'; |
||||||
|
|
||||||
|
const api = new ApiFactory().create(); |
||||||
|
|
||||||
|
@shortcut() |
||||||
|
@store(FileUploadModel, { |
||||||
|
props(this: FileUpload) { |
||||||
|
return this.options; |
||||||
|
}, |
||||||
|
}) |
||||||
|
export class FileUpload extends BI.Widget { |
||||||
|
public static xtype = "dec.dcm.components.file_upload"; |
||||||
|
public static EVENT_CHECK_SUCCESS = 'EVENT_CHECK_SUCCESS'; |
||||||
|
public static EVENT_CLEAR_FILE = 'EVENT_CLEAR_FILE'; |
||||||
|
|
||||||
|
public props = { |
||||||
|
watermark: '', |
||||||
|
value: '', |
||||||
|
processId: '', |
||||||
|
disabled: false, |
||||||
|
inter: '', |
||||||
|
access: '', |
||||||
|
iconCls: '' |
||||||
|
}; |
||||||
|
|
||||||
|
model: FileUploadModel['model']; |
||||||
|
store: FileUploadModel['store']; |
||||||
|
watch = { |
||||||
|
uploadUrl: function () { |
||||||
|
this.uploader.setUrl(this.model.uploadUrl); |
||||||
|
}, |
||||||
|
}; |
||||||
|
|
||||||
|
public textEditor: SignEditor; |
||||||
|
public keywordEditor: SearchEditor; |
||||||
|
public fileTree: MultiLayerSingleLevelTree; |
||||||
|
public sureButton: Button; |
||||||
|
public infoLabel: Label; |
||||||
|
|
||||||
|
public render() { |
||||||
|
const { width, watermark, value, processId, inter } = this.options; |
||||||
|
let self = this; |
||||||
|
const processName = BI.concat("process-", processId); |
||||||
|
const processClass = BI.concat(".process-", processId); |
||||||
|
this.setFileInfo({ |
||||||
|
keytabPath: '', |
||||||
|
principal:'', |
||||||
|
krb5ConfPath: '', |
||||||
|
}); |
||||||
|
|
||||||
|
return { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
items:[{ |
||||||
|
type: BI.FloatLeftLayout.xtype, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.SignEditor.xtype, |
||||||
|
cls: 'bi-border-bottom bi-focus-shadow', |
||||||
|
width: 300, |
||||||
|
height: 22, |
||||||
|
watermark, |
||||||
|
disabled: true, |
||||||
|
value, |
||||||
|
ref: (_ref: SignEditor) => { |
||||||
|
this.textEditor = _ref; |
||||||
|
}, |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: BI.SignEditor.EVENT_CHANGE, |
||||||
|
action: () => { |
||||||
|
const value = this.textEditor.getValue(); |
||||||
|
this.setValue(value); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, { |
||||||
|
type: BI.Button.xtype, |
||||||
|
width: 100, |
||||||
|
_lgap: 10, |
||||||
|
iconCls: "upload-font", |
||||||
|
level: "ignore", |
||||||
|
ghost: true, |
||||||
|
ref: (_ref: Button) => { |
||||||
|
this.uploadButton = _ref; |
||||||
|
}, |
||||||
|
text: BI.i18nText('Dec-Basic_Choose_File'), |
||||||
|
handler: () => { |
||||||
|
this.uploader.select(); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, { |
||||||
|
type: BI.FloatLeftLayout.xtype, |
||||||
|
tgap: 8, |
||||||
|
invisible: true, |
||||||
|
ref: (_ref) => { |
||||||
|
this.fileInfo = _ref; |
||||||
|
}, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
cls: "bi-border", |
||||||
|
items: [{ |
||||||
|
type: BI.HTapeLayout.xtype, |
||||||
|
height: 68, |
||||||
|
width: 300, |
||||||
|
items: [{ |
||||||
|
el: { |
||||||
|
type: BI.IconLabel.xtype, |
||||||
|
cls: this.options.iconCls, |
||||||
|
}, |
||||||
|
width: 48, |
||||||
|
lgap: 8, |
||||||
|
}, { |
||||||
|
el: { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
items : [{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
width: 200, |
||||||
|
height: 20, |
||||||
|
textAlign: "left", |
||||||
|
ref: (_ref: Label) => { |
||||||
|
this.fileName = _ref; |
||||||
|
}, |
||||||
|
},{ |
||||||
|
type: BI.VerticalAdaptLayout.xtype, |
||||||
|
items: [{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
cls: "bi-tips", |
||||||
|
height: 20, |
||||||
|
rgap: 3, |
||||||
|
ref: (_ref: Label) => { |
||||||
|
this.fileSize = _ref; |
||||||
|
}, |
||||||
|
}, { |
||||||
|
type: BI.Label.xtype, |
||||||
|
cls: "bi-tips", |
||||||
|
height: 20, |
||||||
|
ref: (_ref: Label) => { |
||||||
|
this.fileModified = _ref; |
||||||
|
}, |
||||||
|
}] |
||||||
|
|
||||||
|
}], |
||||||
|
|
||||||
|
}, |
||||||
|
tgap: 14, |
||||||
|
lgap: 4, |
||||||
|
}, { |
||||||
|
el: { |
||||||
|
type: BI.IconButton.xtype, |
||||||
|
cls: "default-delete-font", |
||||||
|
handler: function () { |
||||||
|
NProgress.set(0.0); |
||||||
|
self.xhr.abort(); |
||||||
|
self.store.setFileName(''); |
||||||
|
self.clearInfo(); |
||||||
|
self.fireEvent(FileUpload.EVENT_CLEAR_FILE); |
||||||
|
|
||||||
|
}, |
||||||
|
}, |
||||||
|
rgap: 10, |
||||||
|
}] |
||||||
|
}, { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
cls: processName, |
||||||
|
width: 300, |
||||||
|
height: 1, |
||||||
|
}] |
||||||
|
|
||||||
|
}, { |
||||||
|
el :{ |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
cls: "bi-error", |
||||||
|
ref: (_ref: any) => { |
||||||
|
this.errorInfo = _ref; |
||||||
|
}, |
||||||
|
invisible: true, |
||||||
|
items : [{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
height: 20, |
||||||
|
textAlign: "left", |
||||||
|
ref: (_ref: Label) => { |
||||||
|
this.errorCode = _ref; |
||||||
|
}, |
||||||
|
},{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
height: 20, |
||||||
|
textAlign: "left", |
||||||
|
ref: (_ref: Label) => { |
||||||
|
this.errorMsg = _ref; |
||||||
|
}, |
||||||
|
}, { |
||||||
|
type: BI.VerticalAdaptLayout.xtype, |
||||||
|
rgap: 5, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip1'), |
||||||
|
},{ |
||||||
|
type: BI.TextButton.xtype, |
||||||
|
cls: "bi-high-light bi-high-light-border-bottom", |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip2'), |
||||||
|
handler: function () { |
||||||
|
window.open(Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][DecCst.Hyperlink.KERBEROS_CONF_HELP]); |
||||||
|
}, |
||||||
|
},{ |
||||||
|
type: BI.Label.xtype, |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip3'), |
||||||
|
} |
||||||
|
], |
||||||
|
},], |
||||||
|
}, |
||||||
|
vgap: 4, |
||||||
|
lgap: 8, |
||||||
|
} |
||||||
|
], |
||||||
|
}, { |
||||||
|
type: BI.MultifileEditor.xtype, |
||||||
|
ref: (ref:any) => { |
||||||
|
self.uploader = ref; |
||||||
|
}, |
||||||
|
url: this.model.uploadUrl, |
||||||
|
accept: this.options.accept, |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
// 选择文件
|
||||||
|
eventName: BI.MultifileEditor.EVENT_CHANGE, |
||||||
|
action: function (files) { |
||||||
|
self.options.attachId = ''; |
||||||
|
const fileInfo = files.files[0]; |
||||||
|
self.setInfo(fileInfo); |
||||||
|
self.store.setFileName(fileInfo.fileName); |
||||||
|
this.upload(); |
||||||
|
NProgress.configure({ parent: processClass, minimum: 0.0 }); |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
// 上传进度刷新
|
||||||
|
eventName: BI.MultifileEditor.EVENT_PROGRESS, |
||||||
|
action: function (progress) { |
||||||
|
let rate = progress.loaded/progress.total; |
||||||
|
NProgress.set(rate); |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
// 开始上传文件
|
||||||
|
eventName: BI.MultifileEditor.EVENT_UPLOADSTART, |
||||||
|
action: function (progressEvent, xhr) { |
||||||
|
self.xhr = xhr; |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
// 上传文件完毕
|
||||||
|
eventName: BI.MultifileEditor.EVENT_UPLOADED, |
||||||
|
action: function () { |
||||||
|
const uploadedInfo = this.getValue(); |
||||||
|
const failed = BI.some(uploadedInfo, function (index, file) { |
||||||
|
if (file.data.errorCode) { |
||||||
|
BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Error'), { |
||||||
|
level: "error", |
||||||
|
}); |
||||||
|
self.setErrorInfo(file.data) |
||||||
|
return true; |
||||||
|
} |
||||||
|
}); |
||||||
|
const key = self.options.processId +'Path'; |
||||||
|
!failed && self.setValue(uploadedInfo[0].data.kerberosInfo[key]); |
||||||
|
!failed && self.fireEvent(FileUpload.EVENT_CHECK_SUCCESS, uploadedInfo[0].data); |
||||||
|
!failed && BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Success'),{ |
||||||
|
level: "success" |
||||||
|
}); |
||||||
|
NProgress.configure({ parent: 'body'}); |
||||||
|
|
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}] |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
public getValue(): string { |
||||||
|
return this.options.value; |
||||||
|
} |
||||||
|
|
||||||
|
public setValue(value: string) { |
||||||
|
this.options.value = value; |
||||||
|
this.textEditor.text.setTitle(value); |
||||||
|
this.textEditor.setValue(value); |
||||||
|
} |
||||||
|
|
||||||
|
public setInfo(info: any) { |
||||||
|
this.uploadButton.setEnable(false); |
||||||
|
this.fileInfo.setVisible(true); |
||||||
|
this.textEditor.setValue(info.fileName); |
||||||
|
this.fileName.setText(info.fileName); |
||||||
|
this.fileSize.setText(Dec.Utils.getByteWidthUnit(info.size)); |
||||||
|
this.fileModified.setText(BI.getDate().print("%Y-%X-%d %H:%M:%S")) |
||||||
|
} |
||||||
|
|
||||||
|
public clearInfo() { |
||||||
|
this.uploadButton.setEnable(true); |
||||||
|
this.fileInfo.setVisible(false); |
||||||
|
this.errorInfo.setVisible(false); |
||||||
|
this.textEditor.setValue(''); |
||||||
|
this.options.attachId = ''; |
||||||
|
} |
||||||
|
|
||||||
|
public setErrorInfo(errorInfo: any) { |
||||||
|
this.errorInfo.setVisible(true); |
||||||
|
this.errorCode.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorCode") + ":"+ errorInfo.errorCode); |
||||||
|
this.errorMsg.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorMsg") + ":" + errorInfo.errorMessage); |
||||||
|
} |
||||||
|
|
||||||
|
public setEnable(v) { |
||||||
|
this.uploadButton._setEnable(v); |
||||||
|
} |
||||||
|
|
||||||
|
public setFileInfo(params) { |
||||||
|
this.store.setFileInfo(params); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
import { shortcut } from '@core/core'; |
||||||
|
import { BubbleCombo, BubblePopupView, IconButton } from '@fui/core'; |
||||||
|
|
||||||
|
@shortcut() |
||||||
|
export class TipsCombo extends BI.Widget { |
||||||
|
public static xtype = 'dec.dcm.tips.combo'; |
||||||
|
|
||||||
|
public props: BubblePopupView['props'] & IconButton['props'] = { |
||||||
|
trigger: 'hover', |
||||||
|
direction: 'top' |
||||||
|
}; |
||||||
|
|
||||||
|
private bubbleCombo: BubbleCombo; |
||||||
|
|
||||||
|
private bubbleComboPopup: BubblePopupView; |
||||||
|
|
||||||
|
public render() { |
||||||
|
const { direction, trigger, el } = this.options; |
||||||
|
|
||||||
|
return { |
||||||
|
type: BI.BubbleCombo.xtype, |
||||||
|
trigger, |
||||||
|
direction, |
||||||
|
el: { |
||||||
|
type: BI.IconButton.xtype, |
||||||
|
cls: "detail-font", |
||||||
|
}, |
||||||
|
popup: { |
||||||
|
type: BI.BubblePopupView.xtype, |
||||||
|
ref: (_ref: BubblePopupView) => { |
||||||
|
this.bubbleComboPopup = _ref; |
||||||
|
}, |
||||||
|
el, |
||||||
|
}, |
||||||
|
listeners: [], |
||||||
|
ref: (_ref: BubbleCombo) => { |
||||||
|
this.bubbleCombo = _ref; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
/* |
||||||
|
https://work.fineres.com/browse/REPORT-91724 用于参数统一校验
|
||||||
|
*/ |
||||||
|
import { ILLEGAL_STRINGS } from "./constant"; |
||||||
|
export type CheckResult = { |
||||||
|
legal: boolean, |
||||||
|
errorMsg: string, |
||||||
|
} |
||||||
|
export const CHECK_CORRECT: CheckResult = { |
||||||
|
legal: true, |
||||||
|
errorMsg: "", |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* 检测非法字符,返回错误提示 |
||||||
|
* @param value 要校验的字符串 |
||||||
|
*/ |
||||||
|
export function checkIllegalStrings(value: string): CheckResult { |
||||||
|
// 后端传入的校验开关,如果没传,那也默认开启
|
||||||
|
const enabled = Dec.system.enableParameterVerify ?? true; |
||||||
|
let result = CHECK_CORRECT; |
||||||
|
if (enabled) { |
||||||
|
// 关键字不区分大小写
|
||||||
|
ILLEGAL_STRINGS.every(s => { |
||||||
|
const sIndex = value.toLowerCase().indexOf(s); |
||||||
|
if (sIndex !== -1) { |
||||||
|
result = { |
||||||
|
legal: false, |
||||||
|
errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${value.substr(sIndex, s.length)}`, |
||||||
|
}; |
||||||
|
|
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
return true; |
||||||
|
}); |
||||||
|
|
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
export function checkIllegalStringsInWidgetAndShowError(widget: any) { |
||||||
|
const value = widget.getValue(); |
||||||
|
const result = checkIllegalStrings(value); |
||||||
|
if (!result.legal) { |
||||||
|
widget.showError(result.errorMsg); |
||||||
|
} |
||||||
|
|
||||||
|
return result.legal; |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
/** |
||||||
|
* 参数检验的非法字符数组,由于不区分大小写,统一用小写 |
||||||
|
*/ |
||||||
|
export const ILLEGAL_STRINGS = [ |
||||||
|
"\"", |
||||||
|
"<", |
||||||
|
">", |
||||||
|
"&", |
||||||
|
"/script", |
||||||
|
"javascript:", |
||||||
|
"onblur", |
||||||
|
"getruntime", |
||||||
|
"processbuilder", |
||||||
|
"java.lang.processimpl", |
||||||
|
]; |
@ -0,0 +1 @@ |
|||||||
|
export { checkIllegalStringsInWidgetAndShowError, checkIllegalStrings } from "./checkIllegalStrings/checkIllegalStrings" |
@ -0,0 +1,24 @@ |
|||||||
|
BI.point("dec.dcm.model.connection", "createNewConnection", () => { |
||||||
|
Dec.Utils.saveFocusPoint({ |
||||||
|
id: "E73325", |
||||||
|
title: "新建数据连接", |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
BI.point("dec.dcm.model.title_maintain", "setTestEvent", () => { |
||||||
|
Dec.Utils.saveFocusPoint({ |
||||||
|
id: "E73328", |
||||||
|
title: "测试数据连接", |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
BI.point("dec.dcm.model.maintain_form", "addConnection", function () { |
||||||
|
Dec.Utils.saveFocusPoint({ |
||||||
|
id: "E8827", |
||||||
|
title: "保存数据连接", |
||||||
|
body: { |
||||||
|
datebaseType: this.model.datebaseTypeSelected, |
||||||
|
databaseName: this.model.connectionSelected, |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
@ -1,195 +1,405 @@ |
|||||||
import { shortcut, store } from '@core/core'; |
import { shortcut, store } from '@core/core'; |
||||||
import { FormItem } from '../components/form_item/form_item'; |
import { FormItem } from '../components/form_item/form_item'; |
||||||
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
||||||
import { ConnectionJdecModel } from './connection_jdbc.model'; |
import { ConnectionJdecModel } from './connection_jdbc.model'; |
||||||
import { ConnectionJDBC } from 'src/modules/crud/crud.typings'; |
import { ConnectionJDBC } from 'src/modules/crud/crud.typings'; |
||||||
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service'; |
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service'; |
||||||
import { CONNECTION_LAYOUT } from '@constants/constant'; |
import { CONNECTION_LAYOUT, CONNECT_SSH_TYPE } from '@constants/constant'; |
||||||
import { VerticalLayout } from '@fui/core'; |
import { VerticalLayout } from '@fui/core'; |
||||||
import { ApiFactory } from '../../../crud/apiFactory'; |
import { ApiFactory } from '../../../crud/apiFactory'; |
||||||
|
|
||||||
const api = new ApiFactory().create(); |
const api = new ApiFactory().create(); |
||||||
|
|
||||||
@shortcut() |
@shortcut() |
||||||
@store(ConnectionJdecModel) |
@store(ConnectionJdecModel) |
||||||
export class ConnectionJdbc extends BI.Widget { |
export class ConnectionJdbc extends BI.Widget { |
||||||
static xtype = 'dec.dcm.connection_jdbc'; |
static xtype = 'dec.dcm.connection_jdbc'; |
||||||
|
|
||||||
advancedSet: any; |
model: ConnectionJdecModel['model']; |
||||||
model: ConnectionJdecModel['model']; |
allDatabaseTypes = getAllDatabaseTypes(); |
||||||
allDatabaseTypes = getAllDatabaseTypes(); |
|
||||||
|
sshSet: VerticalLayout; |
||||||
render() { |
sslSet: VerticalLayout; |
||||||
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; |
advancedSet: VerticalLayout; |
||||||
const { |
parallelLoadSet: VerticalLayout; |
||||||
driver, |
|
||||||
driverSource, |
render() { |
||||||
database, |
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; |
||||||
user, |
const { |
||||||
originalCharsetName, |
driver, |
||||||
schema, |
driverSource, |
||||||
connectionPoolAttr, |
database, |
||||||
authType, |
user, |
||||||
principal, |
originalCharsetName, |
||||||
url, |
schema, |
||||||
fetchSize, |
connectionPoolAttr, |
||||||
} = connectionData; |
authType, |
||||||
const databaseType = getJdbcDatabaseType(database, driver); |
principal, |
||||||
const { host, port, databaseName } = resolveUrlInfo(url, database); |
url, |
||||||
const { hgap, vgap } = CONNECTION_LAYOUT; |
fetchSize, |
||||||
|
// ssh
|
||||||
return { |
usingSsh, |
||||||
type: BI.VerticalLayout.xtype, |
sshIp, |
||||||
hgap, |
sshPort, |
||||||
vgap, |
sshUser, |
||||||
items: [ |
sshType, |
||||||
{ |
sshSecret, |
||||||
type: FormItem.xtype, |
sshPrivateKeyPath, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
// ssl
|
||||||
value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver, |
usingSsl, |
||||||
}, |
caCertificate, |
||||||
{ |
verifyCa, |
||||||
type: FormItem.xtype, |
sslClientPrivateKey, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
sslClientCertificate, |
||||||
value: databaseName, |
// 并行装载
|
||||||
}, |
parallelLoad, |
||||||
{ |
// HDFS
|
||||||
type: FormItem.xtype, |
hdfs, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
} = connectionData; |
||||||
value: host, |
const databaseType = getJdbcDatabaseType(database, driver); |
||||||
}, |
const { host, port, catalog, databaseName, version } = resolveUrlInfo(url, database); |
||||||
{ |
this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version; |
||||||
type: FormItem.xtype, |
const { hgap, vgap } = CONNECTION_LAYOUT; |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
||||||
value: port, |
return { |
||||||
}, |
type: BI.VerticalLayout.xtype, |
||||||
authType ? |
hgap, |
||||||
{ |
vgap, |
||||||
type: FormItem.xtype, |
items: [ |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), |
{ |
||||||
value: authType, |
type: FormItem.xtype, |
||||||
} : { |
name: BI.i18nText('Dec-Basic_Version'), |
||||||
type: BI.Layout.xtype, |
invisible: BI.isUndefined(this.version), |
||||||
}, |
value: BI.i18nText('Dec-Migration_Database_Version', this.version), |
||||||
{ |
}, |
||||||
type: FormItem.xtype, |
{ |
||||||
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
type: FormItem.xtype, |
||||||
value: authType ? principal : user, |
_tgap: BI.isUndefined(this.version) ? vgap : 0, |
||||||
}, |
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
||||||
{ |
value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver, |
||||||
type: FormItem.xtype, |
}, |
||||||
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_KeyPath') : BI.i18nText('Dec-Dcm_Connection_Form_Password'), |
{ |
||||||
value: '******', |
type: FormItem.xtype, |
||||||
}, |
name: 'catalog', |
||||||
{ |
invisible: database !== 'starrocks', |
||||||
type: FormItem.xtype, |
value: catalog, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
}, |
||||||
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Default'), |
{ |
||||||
}, |
type: FormItem.xtype, |
||||||
{ |
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
||||||
type: FormItem.xtype, |
value: databaseName, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), |
}, |
||||||
value: schema, |
{ |
||||||
invisible: !databaseType.hasSchema, |
type: FormItem.xtype, |
||||||
}, |
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
||||||
{ |
value: host, |
||||||
type: FormItem.xtype, |
}, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
{ |
||||||
value: url, |
type: FormItem.xtype, |
||||||
}, |
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
||||||
{ |
value: port, |
||||||
type: Collapse.xtype, |
}, |
||||||
width: 70, |
authType |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'), |
? { |
||||||
listeners: [ |
type: FormItem.xtype, |
||||||
{ |
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), |
||||||
eventName: EVENT_CHANGE, |
value: authType, |
||||||
action: (isCollapse: boolean) => { |
} |
||||||
this.advancedSet.setVisible(!isCollapse); |
: { |
||||||
}, |
type: BI.Layout.xtype, |
||||||
}, |
}, |
||||||
], |
{ |
||||||
}, |
type: FormItem.xtype, |
||||||
{ |
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
||||||
type: BI.VerticalLayout.xtype, |
value: authType ? principal : user, |
||||||
tgap: -15, |
}, |
||||||
vgap, |
{ |
||||||
invisible: true, |
type: FormItem.xtype, |
||||||
ref: (_ref: VerticalLayout) => { |
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_KeyPath') : BI.i18nText('Dec-Dcm_Connection_Form_Password'), |
||||||
this.advancedSet = _ref; |
value: '******', |
||||||
}, |
}, |
||||||
items: [ |
{ |
||||||
{ |
type: FormItem.xtype, |
||||||
type: FormItem.xtype, |
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Default'), |
||||||
value: connectionPoolAttr.initialSize, |
}, |
||||||
}, |
// HDFS设置
|
||||||
{ |
{ |
||||||
type: FormItem.xtype, |
type: FormItem.xtype, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
invisible: BI.isNull(hdfs), |
||||||
value: connectionPoolAttr.maxActive, |
name: BI.i18nText('Dec-Dcm_Connection_Address', 'HDFS'), |
||||||
}, |
value: hdfs?.hdfsAddress, |
||||||
{ |
}, |
||||||
type: FormItem.xtype, |
// 并行装载设置
|
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
{ |
||||||
value: connectionPoolAttr.maxIdle, |
type: Collapse.xtype, |
||||||
}, |
invisible: BI.isNull(parallelLoad), |
||||||
{ |
name: BI.i18nText('Dec-Dcm_Connection_Setting', BI.i18nText('Dec-Dcm_Connection_Parallel_Load')), |
||||||
type: FormItem.xtype, |
listeners: [ |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
{ |
||||||
value: connectionPoolAttr.minIdle, |
eventName: EVENT_CHANGE, |
||||||
}, |
action: (isCollapse: boolean) => { |
||||||
{ |
this.parallelLoadSet.setVisible(!isCollapse); |
||||||
type: FormItem.xtype, |
}, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
}, |
||||||
value: connectionPoolAttr.maxWait, |
], |
||||||
unit: BI.i18nText('Dec-Dcm_Millisecond'), |
}, |
||||||
}, |
{ |
||||||
{ |
type: BI.VerticalLayout.xtype, |
||||||
type: FormItem.xtype, |
invisible: true, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Validation_Query'), |
ref: (_ref: VerticalLayout) => { |
||||||
value: api.getPlain(connectionPoolAttr.validationQuery || ''), |
this.parallelLoadSet = _ref; |
||||||
}, |
}, |
||||||
{ |
items: [ |
||||||
type: FormItem.xtype, |
{ |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), |
type: FormItem.xtype, |
||||||
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
_bgap: vgap, |
||||||
}, |
name: `${BI.i18nText('Dec-Dcm_Connection_Server_Address')}-${BI.i18nText('Dec-Memory_Detection_Server_Cluster_Node', '1')}`, |
||||||
{ |
value: parallelLoad?.serverAddress, |
||||||
type: FormItem.xtype, |
}, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
{ |
||||||
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
type: FormItem.xtype, |
||||||
}, |
_bgap: vgap, |
||||||
{ |
name: BI.i18nText('Dec-Dcm_Connection_Reuse_Temporary_Table'), |
||||||
type: FormItem.xtype, |
value: parallelLoad?.reuseTemporaryTable, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
}, |
||||||
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
{ |
||||||
}, |
type: FormItem.xtype, |
||||||
{ |
_bgap: vgap, |
||||||
type: FormItem.xtype, |
name: BI.i18nText('Dec-Dcm_Connection_Temporary_File_Pieces_Limit'), |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
value: parallelLoad?.filePiecesLimit, |
||||||
value: connectionPoolAttr.timeBetweenEvictionRunsMillis, |
}, |
||||||
unit: BI.i18nText('Dec-Dcm_Millisecond'), |
{ |
||||||
}, |
type: FormItem.xtype, |
||||||
{ |
name: BI.i18nText('Dec-Dcm_Connection_Temporary_File_Size_Limit'), |
||||||
type: FormItem.xtype, |
value: parallelLoad?.fileSizeLimit, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
}, |
||||||
value: connectionPoolAttr.numTestsPerEvictionRun, |
], |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
type: FormItem.xtype, |
type: FormItem.xtype, |
||||||
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), |
||||||
value: connectionPoolAttr.minEvictableIdleTimeMillis, |
value: schema, |
||||||
unit: BI.i18nText('BI-Basic_Seconds'), |
invisible: !databaseType.hasSchema, |
||||||
}, { |
}, |
||||||
type: FormItem.xtype, |
{ |
||||||
invisible: fetchSize < 0 && fetchSize !== -2, |
type: FormItem.xtype, |
||||||
name: 'Fetchsize', |
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
||||||
value: fetchSize === -2 ? '' : fetchSize, |
value: url, |
||||||
}, |
}, |
||||||
], |
{ |
||||||
}, |
type: FormItem.xtype, |
||||||
], |
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
||||||
}; |
value: connectionPoolAttr.maxActive, |
||||||
} |
}, |
||||||
} |
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), |
||||||
|
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow'), |
||||||
|
value: connectionPoolAttr.keepAlive ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), |
||||||
|
value: api.getPlain(connectionPoolAttr.validationQuery || ''), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
||||||
|
value: connectionPoolAttr.maxWait, |
||||||
|
unit: BI.i18nText('Dec-Dcm_Millisecond'), |
||||||
|
}, |
||||||
|
// ssh设置
|
||||||
|
{ |
||||||
|
type: Collapse.xtype, |
||||||
|
width: 100, |
||||||
|
invisible: !usingSsh, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Setting', 'SSH'), |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: EVENT_CHANGE, |
||||||
|
action: (isCollapse: boolean) => { |
||||||
|
this.sshSet.setVisible(!isCollapse); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
bgap: vgap, |
||||||
|
invisible: true, |
||||||
|
ref: (_ref: VerticalLayout) => { |
||||||
|
this.sshSet = _ref; |
||||||
|
}, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
||||||
|
value: sshIp, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
||||||
|
value: sshPort, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
||||||
|
value: sshUser, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'), |
||||||
|
value: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).text, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
invisible: sshType !== 'KEY', |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'), |
||||||
|
value: sshPrivateKeyPath, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).secretFormName, |
||||||
|
value: sshSecret, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
// ssl设置
|
||||||
|
{ |
||||||
|
type: Collapse.xtype, |
||||||
|
width: 100, |
||||||
|
invisible: !usingSsl, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Setting', 'SSL'), |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: EVENT_CHANGE, |
||||||
|
action: (isCollapse: boolean) => { |
||||||
|
this.sslSet.setVisible(!isCollapse); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
bgap: vgap, |
||||||
|
invisible: true, |
||||||
|
ref: (_ref: VerticalLayout) => { |
||||||
|
this.sslSet = _ref; |
||||||
|
}, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'), |
||||||
|
value: caCertificate, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
invisible: !caCertificate, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'), |
||||||
|
value: verifyCa ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'), |
||||||
|
value: sslClientPrivateKey, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'), |
||||||
|
value: sslClientCertificate, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
// 更多设置
|
||||||
|
{ |
||||||
|
type: Collapse.xtype, |
||||||
|
width: 100, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'), |
||||||
|
listeners: [ |
||||||
|
{ |
||||||
|
eventName: EVENT_CHANGE, |
||||||
|
action: (isCollapse: boolean) => { |
||||||
|
this.advancedSet.setVisible(!isCollapse); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: BI.VerticalLayout.xtype, |
||||||
|
bgap: vgap, |
||||||
|
invisible: true, |
||||||
|
ref: (_ref: VerticalLayout) => { |
||||||
|
this.advancedSet = _ref; |
||||||
|
}, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
||||||
|
value: connectionPoolAttr.initialSize, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
||||||
|
value: connectionPoolAttr.minIdle, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
||||||
|
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
||||||
|
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
||||||
|
value: connectionPoolAttr.timeBetweenEvictionRunsMillis, |
||||||
|
unit: BI.i18nText('Dec-Dcm_Millisecond'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
||||||
|
value: connectionPoolAttr.numTestsPerEvictionRun, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
||||||
|
value: connectionPoolAttr.minEvictableIdleTimeMillis, |
||||||
|
unit: BI.i18nText('BI-Basic_Seconds'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis'), |
||||||
|
value: connectionPoolAttr.maxEvictableIdleTimeMillis, |
||||||
|
unit: BI.i18nText('BI-Basic_Seconds'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold'), |
||||||
|
value: connectionPoolAttr.keepAliveBetweenTimeMillis, |
||||||
|
unit: BI.i18nText('Dec-Dcm_Millisecond'), |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: FormItem.xtype, |
||||||
|
name: 'Fetchsize', |
||||||
|
value: fetchSize, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
@ -0,0 +1 @@ |
|||||||
|
BI.constant('dec.constant.connection.list', []); |
@ -0,0 +1,17 @@ |
|||||||
|
import { DATEBASE_FILTER_TYPE } from "@constants/constant"; |
||||||
|
|
||||||
|
BI.constant('dec.constant.database.filter.type', [ |
||||||
|
{ |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_Commonly'), |
||||||
|
value: DATEBASE_FILTER_TYPE.COMMONLY, |
||||||
|
selected: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_All'), |
||||||
|
value: DATEBASE_FILTER_TYPE.ALL, |
||||||
|
}, |
||||||
|
{ |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_Other'), |
||||||
|
value: DATEBASE_FILTER_TYPE.OTHER, |
||||||
|
}, |
||||||
|
]); |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,96 @@ |
|||||||
|
import { shortcut } from '@core/core'; |
||||||
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
||||||
|
|
||||||
|
const api = new ApiFactory().create(); |
||||||
|
|
||||||
|
@shortcut() |
||||||
|
export class TimeOutSetting extends BI.Widget { |
||||||
|
public static xtype = 'dec.dcm.page.timeout.setting'; |
||||||
|
|
||||||
|
public props = { |
||||||
|
value: 0, |
||||||
|
}; |
||||||
|
|
||||||
|
beforeRender(cb: Function) { |
||||||
|
const self = this; |
||||||
|
api.getTimeOut().then(res => { |
||||||
|
self.props.value = res.data.count; |
||||||
|
cb(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
public render() { |
||||||
|
const { value } = this.props; |
||||||
|
const self = this; |
||||||
|
|
||||||
|
return { |
||||||
|
type: 'bi.vtape', |
||||||
|
cls: 'bi-background', |
||||||
|
items: [{ |
||||||
|
type: 'dec.setting.header', |
||||||
|
height: 40, |
||||||
|
listeners: [{ |
||||||
|
eventName: 'EVENT_CANCEL', |
||||||
|
action: function () { |
||||||
|
self.fireEvent('EVENT_CHANGE'); |
||||||
|
}, |
||||||
|
}, { |
||||||
|
eventName: 'EVENT_SAVE', |
||||||
|
action: function () { |
||||||
|
api.putTimeOut(Number(self.editor.getValue())); |
||||||
|
self.fireEvent('EVENT_CHANGE'); |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, { |
||||||
|
type: 'bi.vertical', |
||||||
|
cls: 'bi-card', |
||||||
|
vgap: 10, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
el: { |
||||||
|
type: 'bi.vertical_adapt', |
||||||
|
cls: 'bi-border-bottom', |
||||||
|
height: 40, |
||||||
|
items: [{ |
||||||
|
type: 'bi.label', |
||||||
|
textAlign: 'left', |
||||||
|
width: 120, |
||||||
|
cls: 'dec-font-weight-bold', |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), |
||||||
|
}] |
||||||
|
}, tgap: -10, hgap: 16, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'bi.vertical_adapt', |
||||||
|
hgap: 16, |
||||||
|
items: [{ |
||||||
|
type: 'dec.label.editor.item', |
||||||
|
text: BI.i18nText('Dec-Over_Time'), |
||||||
|
textWidth: 100, |
||||||
|
editorWidth: 80, |
||||||
|
allowBlank: false, |
||||||
|
value: value, |
||||||
|
validationChecker: function(v) { |
||||||
|
return BI.isPositiveInteger(v); |
||||||
|
}, |
||||||
|
errorText: BI.i18nText('BI-Please_Input_Positive_Integer'), |
||||||
|
ref: function (_ref) { |
||||||
|
self.editor = _ref; |
||||||
|
}, |
||||||
|
}, { |
||||||
|
el: { |
||||||
|
type: 'bi.label', |
||||||
|
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Millisecond'), |
||||||
|
}, |
||||||
|
lgap: 10, |
||||||
|
}] |
||||||
|
|
||||||
|
}, |
||||||
|
] |
||||||
|
}], |
||||||
|
ref: function (_ref) { |
||||||
|
self.setting = _ref; |
||||||
|
}, |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue