From 16ba100d60adef68ef196f093a273f45b4b16d0b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 19 Mar 2023 17:49:07 +0800 Subject: [PATCH] =?UTF-8?q?SSH=E8=AE=A4=E8=AF=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A7=81=E9=92=A5=E6=97=B6=E5=8F=AF=E4=BB=A5=E4=BB=8E=E7=A7=81?= =?UTF-8?q?=E9=92=A5=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9B=B4=E6=8E=A5=E6=8B=96?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/components/common/file-textarea.js | 26 +++++++++++++++++++ .../@default/clusters/grants/create.html | 4 +-- .../@default/clusters/grants/createPopup.html | 2 +- .../@default/clusters/grants/update.html | 2 +- .../@default/clusters/grants/updatePopup.html | 4 +-- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 web/public/js/components/common/file-textarea.js diff --git a/web/public/js/components/common/file-textarea.js b/web/public/js/components/common/file-textarea.js new file mode 100644 index 00000000..99c89fb9 --- /dev/null +++ b/web/public/js/components/common/file-textarea.js @@ -0,0 +1,26 @@ +Vue.component("file-textarea", { + props: ["value"], + data: function () { + let value = this.value + if (typeof value != "string") { + value = "" + } + return { + realValue: value + } + }, + mounted: function () { + }, + methods: { + drop: function (e) { + let that = this + e.dataTransfer.items[0].getAsFile().text().then(function (data) { + that.setValue(data) + }) + }, + setValue: function (value) { + this.realValue = value + } + }, + template: `` +}) \ No newline at end of file diff --git a/web/views/@default/clusters/grants/create.html b/web/views/@default/clusters/grants/create.html index ee60dda6..e1c7b84d 100644 --- a/web/views/@default/clusters/grants/create.html +++ b/web/views/@default/clusters/grants/create.html @@ -49,8 +49,8 @@ RSA私钥 * - -

用来生成登录SSH公钥的私钥

+ +

用来生成登录SSH公钥的私钥。

diff --git a/web/views/@default/clusters/grants/createPopup.html b/web/views/@default/clusters/grants/createPopup.html index 2f32a624..3725aebd 100644 --- a/web/views/@default/clusters/grants/createPopup.html +++ b/web/views/@default/clusters/grants/createPopup.html @@ -47,7 +47,7 @@ RSA私钥 * - +

用来生成登录SSH公钥的私钥

diff --git a/web/views/@default/clusters/grants/update.html b/web/views/@default/clusters/grants/update.html index c5c88696..477773fd 100644 --- a/web/views/@default/clusters/grants/update.html +++ b/web/views/@default/clusters/grants/update.html @@ -50,7 +50,7 @@ RSA私钥 * - +

用来生成登录SSH公钥的私钥

diff --git a/web/views/@default/clusters/grants/updatePopup.html b/web/views/@default/clusters/grants/updatePopup.html index 92e752b9..99673c44 100644 --- a/web/views/@default/clusters/grants/updatePopup.html +++ b/web/views/@default/clusters/grants/updatePopup.html @@ -49,8 +49,8 @@ RSA私钥 * - -

用来生成登录SSH公钥的私钥

+ +

用来生成登录SSH公钥的私钥。