Browse Source
Merge in PG/plugin-repository-s3 from release/10.0 to persist/10.0 * commit 'aecbffaa354e8f7256bfe4ae111f06eedb756f3b': 无jira,回退错误提升的jartime 无jira任务 fix: 提升插件版本 JSY-28624 fix: 优化下分片上传逻辑 REPORT-102146 fix: isDirectory方法某些场景判断不正确 REPORT-100817 fix: s3插件对于分片上传的支持 REPORT-99648 fix:s3 fineui兼容问题 无jira任务 chore: 提升版本 无jira任务 fix: 测试连接后释放资源;list接口过滤自身目录 REPORT-97765 feat: s3插件支持配置连接池大小 REPORT-97765 feat: s3插件支持配置连接池大小 REPORT-96529 fix: list接口数量限制;删除接口性能优化 无jira任务提升jartime和版本号 REPORT-95454 bugfix:http配置根据endpoint进行设置persist/10.0
Icey.Zhang-张洁
1 year ago
9 changed files with 534 additions and 407 deletions
@ -0,0 +1,318 @@ |
|||||||
|
BI.config("dec.constant.intelligence.cluster.file.server", function (items) { |
||||||
|
items.push({ |
||||||
|
value: "S3", // 地址栏显示的hash值
|
||||||
|
id: "decision-intelligence-cluster-file-s3", // id
|
||||||
|
text: "S3", // 文字
|
||||||
|
cardType: "dec.intelligence.cluster.file.s3", |
||||||
|
workRoot: false, |
||||||
|
}); |
||||||
|
|
||||||
|
return items; |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
!(function () { |
||||||
|
var LABEL_WIDTH = 107, EDITOR_WIDTH = 393; |
||||||
|
var S3 = BI.inherit(BI.Widget, { |
||||||
|
|
||||||
|
props: { |
||||||
|
baseCls: "dec-cluster-ftp", |
||||||
|
value: {}, |
||||||
|
}, |
||||||
|
|
||||||
|
_store: function () { |
||||||
|
return BI.Models.getModel("dec.model.intelligence.cluster.file.s3", { |
||||||
|
value: this.options.value, |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
|
watch: { |
||||||
|
isOpen: function (v) { |
||||||
|
this.toggle.setVisible(v); |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
render: function () { |
||||||
|
var self = this, o = this.options; |
||||||
|
|
||||||
|
return { |
||||||
|
type: "bi.vertical", |
||||||
|
tgap: 15, |
||||||
|
items: [ |
||||||
|
{ |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Input"), |
||||||
|
text: BI.i18nText("Plugin-S3_End_Point"), |
||||||
|
value: this.model.endPoint, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
ref: function (_ref) { |
||||||
|
self.endPointRow = _ref; |
||||||
|
}, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setEndPoint(this.getValue()); |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, { |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Input"), |
||||||
|
text: BI.i18nText("Plugin-S3_Region"), |
||||||
|
value: this.model.region, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
ref: function (_ref) { |
||||||
|
self.regionRow = _ref; |
||||||
|
}, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setRegion(this.getValue()); |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, { |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Input"), |
||||||
|
text: BI.i18nText("Plugin-S3_Access_Key_Id"), |
||||||
|
value: this.model.accessKeyId, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
ref: function (_ref) { |
||||||
|
self.portRow = _ref; |
||||||
|
}, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setAccessKeyId(this.getValue()); |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "dec.common.cipher.editor", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Access_Key_Secret"), |
||||||
|
text: BI.i18nText("Plugin-S3_Access_Key_Secret"), |
||||||
|
value: this.model.password, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
ref: function (_ref) { |
||||||
|
self.passwordRow = _ref; |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Bucket"), |
||||||
|
text: BI.i18nText("Plugin-S3_Bucket"), |
||||||
|
value: this.model.bucket, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setBucket(this.getValue()); |
||||||
|
}, |
||||||
|
}], |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "dec.label.editor.item", |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Dec-Please_Input"), |
||||||
|
text: BI.i18nText("Dec-Basic_Path"), |
||||||
|
value: this.model.workRoot, |
||||||
|
ref: function (_ref) { |
||||||
|
self.filePathRow = _ref; |
||||||
|
}, |
||||||
|
}, { |
||||||
|
type: "bi.vertical_adapt", |
||||||
|
items: [{ |
||||||
|
type: "bi.icon_change_button", |
||||||
|
iconCls: this.model.isOpen ? "expander-down-font" : "expander-right-font", |
||||||
|
ref: (_ref) => { |
||||||
|
this.OtherConfigButton = _ref; |
||||||
|
}, |
||||||
|
handler: () => { |
||||||
|
this.store.setIsOpen(!this.model.isOpen); |
||||||
|
this.OtherConfigButton.setIcon(this.model.isOpen ? "expander-down-font" : "expander-right-font"); |
||||||
|
} |
||||||
|
}, { |
||||||
|
type: "bi.text_button", |
||||||
|
text: BI.i18nText('Plugin-S3_Other_Config'), |
||||||
|
handler: () => { |
||||||
|
this.store.setIsOpen(!this.model.isOpen); |
||||||
|
this.OtherConfigButton.setIcon(this.model.isOpen ? "expander-down-font" : "expander-right-font"); |
||||||
|
} |
||||||
|
}] |
||||||
|
}, { |
||||||
|
type: 'bi.vertical', |
||||||
|
ref: (_ref) => { |
||||||
|
this.toggle = _ref; |
||||||
|
}, |
||||||
|
invisible: () => !this.model.isOpen, |
||||||
|
items: [{ |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Input"), |
||||||
|
text: "PathStyleAccess", |
||||||
|
value: this.model.enablePathStyleAccess, |
||||||
|
ref: function (_ref) { |
||||||
|
self.enablePathStyleAccessRow = _ref; |
||||||
|
}, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setEnablePathStyleAccess(this.getValue()); |
||||||
|
} |
||||||
|
}] |
||||||
|
}, { |
||||||
|
type: "dec.label.editor.item", |
||||||
|
textWidth: LABEL_WIDTH, |
||||||
|
editorWidth: EDITOR_WIDTH, |
||||||
|
watermark: BI.i18nText("Plugin-S3_Input"), |
||||||
|
text: "SignerOverride", |
||||||
|
value: this.model.signerOverride, |
||||||
|
el: { |
||||||
|
disabled: !o.editable, |
||||||
|
}, |
||||||
|
tgap: 15, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.Editor.EVENT_CHANGE, |
||||||
|
action: function () { |
||||||
|
self.store.setSignerOverride(this.getValue()); |
||||||
|
} |
||||||
|
}] |
||||||
|
}], |
||||||
|
} |
||||||
|
] |
||||||
|
}; |
||||||
|
}, |
||||||
|
|
||||||
|
getValue: function () { |
||||||
|
var enablePathStyleAccess = false; |
||||||
|
if (this.model.enablePathStyleAccess === 'true') { |
||||||
|
enablePathStyleAccess = true; |
||||||
|
} |
||||||
|
|
||||||
|
return { |
||||||
|
endPoint: this.model.endPoint, |
||||||
|
region: this.model.region, |
||||||
|
accessKeyId: this.model.accessKeyId, |
||||||
|
password: this.passwordRow.getCipher(), |
||||||
|
bucket: this.model.bucket, |
||||||
|
workRoot: this.filePathRow.getValue(), |
||||||
|
enablePathStyleAccess, |
||||||
|
signerOverride: this.model.signerOverride, |
||||||
|
}; |
||||||
|
}, |
||||||
|
|
||||||
|
validation: function () { |
||||||
|
var valid = true; |
||||||
|
var path = this.filePathRow.getValue(); |
||||||
|
if (Dec.Utils.strLength(path) > DecCst.STRING_SHORT_TEXT_LENGTH) { |
||||||
|
this.filePathRow.showError(BI.i18nText("Dec-Error_Length_Greater_Than_Short_Text")); |
||||||
|
valid = false; |
||||||
|
} |
||||||
|
if (BI.startWith(path, "/") || !BI.endWith(path, "/")) { |
||||||
|
this.filePathRow.showError(BI.i18nText("Dec-Error_Start_With_Slash_Or_End_Without_Slash")); |
||||||
|
valid = false; |
||||||
|
} |
||||||
|
if (!BI.isKey(path)) { |
||||||
|
this.filePathRow.showError(BI.i18nText("Dec-Error_Null")); |
||||||
|
valid = false; |
||||||
|
} |
||||||
|
if (!(this.model.enablePathStyleAccess === 'false' || this.model.enablePathStyleAccess === 'true')) { |
||||||
|
this.enablePathStyleAccessRow.showError(BI.i18nText("Plugin-S3_EnablePathStyleAccess_Error_Tip")); |
||||||
|
valid = false; |
||||||
|
} |
||||||
|
|
||||||
|
return valid; |
||||||
|
}, |
||||||
|
|
||||||
|
}); |
||||||
|
BI.shortcut("dec.intelligence.cluster.file.s3", S3); |
||||||
|
}()); |
||||||
|
|
||||||
|
|
||||||
|
!(function () { |
||||||
|
var Model = BI.inherit(Fix.Model, { |
||||||
|
|
||||||
|
state: function () { |
||||||
|
var val = this.options.value; |
||||||
|
|
||||||
|
return { |
||||||
|
endPoint: val.endPoint, |
||||||
|
region: val.region, |
||||||
|
accessKeyId: val.accessKeyId, |
||||||
|
password: val.password, |
||||||
|
bucket: val.bucket, |
||||||
|
workRoot: val.workRoot, |
||||||
|
isOpen: false, |
||||||
|
enablePathStyleAccess: 'false', |
||||||
|
signerOverride: "", |
||||||
|
}; |
||||||
|
}, |
||||||
|
|
||||||
|
computed: { |
||||||
|
encodingArray: function () { |
||||||
|
return BI.map(DecCst.EncodeConstants.ENCODING_ARRAY, function (i, v) { |
||||||
|
return { |
||||||
|
value: v, |
||||||
|
}; |
||||||
|
}); |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
actions: { |
||||||
|
setEndPoint: function (v) { |
||||||
|
this.model.endPoint = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setRegion: function (v) { |
||||||
|
this.model.region = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setAccessKeyId: function (v) { |
||||||
|
this.model.accessKeyId = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setBucket: function (v) { |
||||||
|
this.model.bucket = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setEnablePathStyleAccess: function (v) { |
||||||
|
this.model.enablePathStyleAccess = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setSignerOverride: function (v) { |
||||||
|
this.model.signerOverride = v; |
||||||
|
}, |
||||||
|
|
||||||
|
setIsOpen: function (v) { |
||||||
|
this.model.isOpen = v; |
||||||
|
}, |
||||||
|
}, |
||||||
|
}); |
||||||
|
BI.model("dec.model.intelligence.cluster.file.s3", Model); |
||||||
|
}()); |
@ -0,0 +1,10 @@ |
|||||||
|
const gulp = require('gulp'); |
||||||
|
const uglify = require('gulp-uglify'); |
||||||
|
|
||||||
|
function build() { |
||||||
|
return gulp.src('./bundle.js') |
||||||
|
.pipe(uglify()) |
||||||
|
.pipe(gulp.dest('../src/main/resources/com/fanruan/fs/s3/repository/web/js')); |
||||||
|
} |
||||||
|
|
||||||
|
exports.default = build; |
@ -0,0 +1,13 @@ |
|||||||
|
{ |
||||||
|
"name": "front", |
||||||
|
"version": "1.0.0", |
||||||
|
"main": "index.js", |
||||||
|
"license": "MIT", |
||||||
|
"scripts": { |
||||||
|
"build": "gulp" |
||||||
|
}, |
||||||
|
"dependencies": { |
||||||
|
"gulp": "^4.0.2", |
||||||
|
"gulp-uglify": "^3.0.2" |
||||||
|
} |
||||||
|
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue