From dfdb4f73c53580a24b86c821d1846fbb84c5f875 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aeolus=2EZhang-=E5=BC=A0=E6=95=AC=E5=B3=A5?=
 <Aeolus.Zhang@fanruan.com>
Date: Tue, 23 May 2023 13:52:00 +0800
Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8Cs3?=
 =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0=E8=AF=BB?=
 =?UTF-8?q?=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitignore                                    |   4 +-
 front/bundle.js                               | 311 +++++++++++++++++
 front/gulpfile.js                             |  10 +
 front/package.json                            |  13 +
 readme.md                                     |   9 +-
 .../fanruan/fs/s3/repository/web/js/bundle.js | 312 +-----------------
 6 files changed, 346 insertions(+), 313 deletions(-)
 create mode 100644 front/bundle.js
 create mode 100644 front/gulpfile.js
 create mode 100644 front/package.json

diff --git a/.gitignore b/.gitignore
index 29c9cac..8dea5fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,6 @@ target/
 build
 local.properties
 classes/
-transform-classes/
\ No newline at end of file
+transform-classes/
+node_modules/
+*.lock
\ No newline at end of file
diff --git a/front/bundle.js b/front/bundle.js
new file mode 100644
index 0000000..1928ab5
--- /dev/null
+++ b/front/bundle.js
@@ -0,0 +1,311 @@
+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: {},
+
+        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',
+                        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.getCompleteCipher(),
+                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: val.enablePathStyleAccess,
+                signerOverride: val.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);
+}());
diff --git a/front/gulpfile.js b/front/gulpfile.js
new file mode 100644
index 0000000..bc6eefa
--- /dev/null
+++ b/front/gulpfile.js
@@ -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;
\ No newline at end of file
diff --git a/front/package.json b/front/package.json
new file mode 100644
index 0000000..10e2932
--- /dev/null
+++ b/front/package.json
@@ -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"
+  }
+}
diff --git a/readme.md b/readme.md
index 6427b8b..de1e1ef 100644
--- a/readme.md
+++ b/readme.md
@@ -2,4 +2,11 @@
 
 能够使用支持S3协议的云存储,作为文件服务器,安装好插件后在决策平台的智能运维->集群配置->文件一致性设置选项下,按下图设置即可:
 
-![ui](screenshots/s3.png)
\ No newline at end of file
+![ui](screenshots/s3.png)
+
+# 前台gulp打包:
+进入front文件夹:`cd front`
+
+安装依赖:`yarn install`
+
+打包:`yarn build`
\ No newline at end of file
diff --git a/src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js b/src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js
index f69de5a..8450155 100644
--- a/src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js
+++ b/src/main/resources/com/fanruan/fs/s3/repository/web/js/bundle.js
@@ -1,311 +1 @@
-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: {},
-
-        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',
-                        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.getCompleteCipher(),
-                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);
-}());
+BI.config("dec.constant.intelligence.cluster.file.server",function(e){return e.push({value:"S3",id:"decision-intelligence-cluster-file-s3",text:"S3",cardType:"dec.intelligence.cluster.file.s3",workRoot:!1}),e}),function(){var i=107,n=393,e=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:{},render:function(){var t=this,e=this.options;return{type:"bi.vertical",tgap:15,items:[{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Input"),text:BI.i18nText("Plugin-S3_End_Point"),value:this.model.endPoint,el:{disabled:!e.editable},ref:function(e){t.endPointRow=e},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setEndPoint(this.getValue())}}]},{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Input"),text:BI.i18nText("Plugin-S3_Region"),value:this.model.region,el:{disabled:!e.editable},ref:function(e){t.regionRow=e},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setRegion(this.getValue())}}]},{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Input"),text:BI.i18nText("Plugin-S3_Access_Key_Id"),value:this.model.accessKeyId,el:{disabled:!e.editable},ref:function(e){t.portRow=e},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setAccessKeyId(this.getValue())}}]},{type:"dec.common.cipher.editor",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Access_Key_Secret"),text:BI.i18nText("Plugin-S3_Access_Key_Secret"),value:this.model.password,el:{disabled:!e.editable},ref:function(e){t.passwordRow=e}},{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Bucket"),text:BI.i18nText("Plugin-S3_Bucket"),value:this.model.bucket,el:{disabled:!e.editable},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setBucket(this.getValue())}}]},{type:"dec.label.editor.item",el:{disabled:!e.editable},textWidth:i,editorWidth:n,watermark:BI.i18nText("Dec-Please_Input"),text:BI.i18nText("Dec-Basic_Path"),value:this.model.workRoot,ref:function(e){t.filePathRow=e}},{type:"bi.vertical_adapt",items:[{type:"bi.icon_change_button",iconCls:this.model.isOpen?"expander-down-font":"expander-right-font",ref:e=>{this.OtherConfigButton=e},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",invisible:()=>!this.model.isOpen,items:[{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Input"),text:"PathStyleAccess",value:this.model.enablePathStyleAccess,ref:function(e){t.enablePathStyleAccessRow=e},el:{disabled:!e.editable},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setEnablePathStyleAccess(this.getValue())}}]},{type:"dec.label.editor.item",textWidth:i,editorWidth:n,watermark:BI.i18nText("Plugin-S3_Input"),text:"SignerOverride",value:this.model.signerOverride,el:{disabled:!e.editable},tgap:15,listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.store.setSignerOverride(this.getValue())}}]}]}]}},getValue:function(){var e=!1;return"true"===this.model.enablePathStyleAccess&&(e=!0),{endPoint:this.model.endPoint,region:this.model.region,accessKeyId:this.model.accessKeyId,password:this.passwordRow.getCompleteCipher(),bucket:this.model.bucket,workRoot:this.filePathRow.getValue(),enablePathStyleAccess:e,signerOverride:this.model.signerOverride}},validation:function(){var e=!0,t=this.filePathRow.getValue();return Dec.Utils.strLength(t)>DecCst.STRING_SHORT_TEXT_LENGTH&&(this.filePathRow.showError(BI.i18nText("Dec-Error_Length_Greater_Than_Short_Text")),e=!1),!BI.startWith(t,"/")&&BI.endWith(t,"/")||(this.filePathRow.showError(BI.i18nText("Dec-Error_Start_With_Slash_Or_End_Without_Slash")),e=!1),BI.isKey(t)||(this.filePathRow.showError(BI.i18nText("Dec-Error_Null")),e=!1),"false"!==this.model.enablePathStyleAccess&&"true"!==this.model.enablePathStyleAccess&&(this.enablePathStyleAccessRow.showError(BI.i18nText("Plugin-S3_EnablePathStyleAccess_Error_Tip")),e=!1),e}});BI.shortcut("dec.intelligence.cluster.file.s3",e)}(),function(){var e=BI.inherit(Fix.Model,{state:function(){var e=this.options.value;return{endPoint:e.endPoint,region:e.region,accessKeyId:e.accessKeyId,password:e.password,bucket:e.bucket,workRoot:e.workRoot,isOpen:!1,enablePathStyleAccess:e.enablePathStyleAccess,signerOverride:e.signerOverride}},computed:{encodingArray:function(){return BI.map(DecCst.EncodeConstants.ENCODING_ARRAY,function(e,t){return{value:t}})}},actions:{setEndPoint:function(e){this.model.endPoint=e},setRegion:function(e){this.model.region=e},setAccessKeyId:function(e){this.model.accessKeyId=e},setBucket:function(e){this.model.bucket=e},setEnablePathStyleAccess:function(e){this.model.enablePathStyleAccess=e},setSignerOverride:function(e){this.model.signerOverride=e},setIsOpen:function(e){this.model.isOpen=e}}});BI.model("dec.model.intelligence.cluster.file.s3",e)}();
\ No newline at end of file