SSH认证添加私钥时可以从私钥文件中直接拖入

This commit is contained in:
GoEdgeLab
2023-03-19 17:49:07 +08:00
parent 237e88fe23
commit 16ba100d60
5 changed files with 32 additions and 6 deletions

View File

@@ -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: `<textarea @drop.prevent="drop" ref="textarea" v-model="realValue"></textarea>`
})