2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 12:40:25 +08:00

feat: 数据库密码复制

This commit is contained in:
耗子
2024-12-03 11:02:20 +08:00
parent fc87cd0360
commit a5eee5eeec
2 changed files with 30 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ const columns: any = [
{
title: '密码',
key: 'password',
width: 150,
width: 250,
render(row: any) {
return h(NInputGroup, null, {
default: () => [
@@ -62,7 +62,19 @@ const columns: any = [
showPasswordOn: 'click',
readonly: true,
placeholder: '无'
})
}),
h(
NButton,
{
type: 'primary',
ghost: true,
onClick: () => {
navigator.clipboard.writeText(row.password)
window.$message.success('复制成功')
}
},
{ default: () => '复制' }
)
]
})
}
@@ -242,7 +254,7 @@ onUnmounted(() => {
<n-data-table
striped
remote
:scroll-x="1600"
:scroll-x="1700"
:loading="loading"
:columns="columns"
:data="data"

View File

@@ -46,7 +46,7 @@ const columns: any = [
{
title: '密码',
key: 'password',
width: 200,
width: 250,
render(row: any) {
return h(NInputGroup, null, {
default: () => [
@@ -56,7 +56,19 @@ const columns: any = [
showPasswordOn: 'click',
readonly: true,
placeholder: '未保存'
})
}),
h(
NButton,
{
type: 'primary',
ghost: true,
onClick: () => {
navigator.clipboard.writeText(row.password)
window.$message.success('复制成功')
}
},
{ default: () => '复制' }
)
]
})
}
@@ -222,7 +234,7 @@ onUnmounted(() => {
<n-data-table
striped
remote
:scroll-x="1700"
:scroll-x="1800"
:loading="loading"
:columns="columns"
:data="data"