Browse Source

DEC-16411 feat: S3插件变为官方插件

persist/10.0
Feng 4 years ago
parent
commit
5724103649
  1. 3
      src/main/resources/com/fanruan/fs/s3/repository/locale/s3.properties
  2. 3
      src/main/resources/com/fanruan/fs/s3/repository/locale/s3_en_US.properties
  3. 3
      src/main/resources/com/fanruan/fs/s3/repository/locale/s3_zh_CN.properties
  4. 81
      src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js

3
src/main/resources/com/fanruan/fs/s3/repository/locale/s3.properties

@ -3,4 +3,5 @@ Plugin-S3_End_Point=Endpoint
Plugin-S3_Region=Region Plugin-S3_Region=Region
Plugin-S3_Access_Key_Id=AccessKeyId Plugin-S3_Access_Key_Id=AccessKeyId
Plugin-S3_Access_Key_Secret=AccessKeySecret Plugin-S3_Access_Key_Secret=AccessKeySecret
Plugin-S3_Bucket=Bucket Plugin-S3_Bucket=Bucket
Dec-Error_Start_With_Slash=The path cannot start with "/", but must end with "/"

3
src/main/resources/com/fanruan/fs/s3/repository/locale/s3_en_US.properties

@ -3,4 +3,5 @@ Plugin-S3_End_Point=Endpoint
Plugin-S3_Region=Region Plugin-S3_Region=Region
Plugin-S3_Access_Key_Id=AccessKeyId Plugin-S3_Access_Key_Id=AccessKeyId
Plugin-S3_Access_Key_Secret=AccessKeySecret Plugin-S3_Access_Key_Secret=AccessKeySecret
Plugin-S3_Bucket=Bucket Plugin-S3_Bucket=Bucket
Dec-Error_Start_With_Slash=The path cannot start with "/", but must end with "/"

3
src/main/resources/com/fanruan/fs/s3/repository/locale/s3_zh_CN.properties

@ -3,4 +3,5 @@ Plugin-S3_End_Point=Endpoint
Plugin-S3_Region=Region Plugin-S3_Region=Region
Plugin-S3_Access_Key_Id=AccessKeyId Plugin-S3_Access_Key_Id=AccessKeyId
Plugin-S3_Access_Key_Secret=AccessKeySecret Plugin-S3_Access_Key_Secret=AccessKeySecret
Plugin-S3_Bucket=Bucket Plugin-S3_Bucket=Bucket
Dec-Error_Start_With_Slash=\u8DEF\u5F84\u5F00\u5934\u4E0D\u80FD\u52A0\u659C\u6760\uFF0C\u5FC5\u987B\u4EE5\u659C\u6760\u7ED3\u5C3E

81
src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js

@ -3,8 +3,10 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
value: "S3", // 地址栏显示的hash值 value: "S3", // 地址栏显示的hash值
id: "decision-intelligence-cluster-file-s3", // id id: "decision-intelligence-cluster-file-s3", // id
text: "S3", // 文字 text: "S3", // 文字
cardType: "dec.intelligence.cluster.file.s3" cardType: "dec.intelligence.cluster.file.s3",
workRoot: false,
}); });
return items; return items;
}); });
@ -15,12 +17,12 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
props: { props: {
baseCls: "dec-cluster-ftp", baseCls: "dec-cluster-ftp",
value: {} value: {},
}, },
_store: function () { _store: function () {
return BI.Models.getModel("dec.model.intelligence.cluster.file.s3", { return BI.Models.getModel("dec.model.intelligence.cluster.file.s3", {
value: this.options.value value: this.options.value,
}); });
}, },
@ -28,6 +30,7 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.vertical", type: "bi.vertical",
tgap: 15, tgap: 15,
@ -49,8 +52,8 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
eventName: BI.Editor.EVENT_CHANGE, eventName: BI.Editor.EVENT_CHANGE,
action: function () { action: function () {
self.store.setEndPoint(this.getValue()); self.store.setEndPoint(this.getValue());
} },
}] }],
}, { }, {
type: "dec.label.editor.item", type: "dec.label.editor.item",
textWidth: LABEL_WIDTH, textWidth: LABEL_WIDTH,
@ -68,8 +71,8 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
eventName: BI.Editor.EVENT_CHANGE, eventName: BI.Editor.EVENT_CHANGE,
action: function () { action: function () {
self.store.setRegion(this.getValue()); self.store.setRegion(this.getValue());
} },
}] }],
}, { }, {
type: "dec.label.editor.item", type: "dec.label.editor.item",
textWidth: LABEL_WIDTH, textWidth: LABEL_WIDTH,
@ -87,8 +90,8 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
eventName: BI.Editor.EVENT_CHANGE, eventName: BI.Editor.EVENT_CHANGE,
action: function () { action: function () {
self.store.setAccessKeyId(this.getValue()); self.store.setAccessKeyId(this.getValue());
} },
}] }],
}, },
{ {
type: "dec.common.cipher.editor", type: "dec.common.cipher.editor",
@ -102,7 +105,7 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
}, },
ref: function (_ref) { ref: function (_ref) {
self.passwordRow = _ref; self.passwordRow = _ref;
} },
}, },
{ {
type: "dec.label.editor.item", type: "dec.label.editor.item",
@ -118,9 +121,23 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
eventName: BI.Editor.EVENT_CHANGE, eventName: BI.Editor.EVENT_CHANGE,
action: function () { action: function () {
self.store.setBucket(this.getValue()); 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;
},
}],
}; };
}, },
@ -130,13 +147,33 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
region: this.model.region, region: this.model.region,
accessKeyId: this.model.accessKeyId, accessKeyId: this.model.accessKeyId,
password: this.passwordRow.getCipher(), password: this.passwordRow.getCipher(),
bucket: this.model.bucket bucket: this.model.bucket,
workRoot: this.filePathRow.getValue(),
}; };
}, },
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;
}
return valid;
},
}); });
BI.shortcut("dec.intelligence.cluster.file.s3", S3); BI.shortcut("dec.intelligence.cluster.file.s3", S3);
})(); }());
!(function () { !(function () {
@ -144,12 +181,14 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
state: function () { state: function () {
var val = this.options.value; var val = this.options.value;
return { return {
endPoint: val.endPoint, endPoint: val.endPoint,
region: val.region, region: val.region,
accessKeyId: val.accessKeyId, accessKeyId: val.accessKeyId,
password: val.password, password: val.password,
bucket: val.bucket bucket: val.bucket,
workRoot: val.workRoot,
}; };
}, },
@ -157,10 +196,10 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
encodingArray: function () { encodingArray: function () {
return BI.map(DecCst.EncodeConstants.ENCODING_ARRAY, function (i, v) { return BI.map(DecCst.EncodeConstants.ENCODING_ARRAY, function (i, v) {
return { return {
value: v value: v,
}; };
}); });
} },
}, },
actions: { actions: {
@ -178,8 +217,8 @@ BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
setBucket: function (v) { setBucket: function (v) {
this.model.bucket = v; this.model.bucket = v;
} },
} },
}); });
BI.model("dec.model.intelligence.cluster.file.s3", Model); BI.model("dec.model.intelligence.cluster.file.s3", Model);
})(); }());

Loading…
Cancel
Save