mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 05:47:17 +08:00
feat: 数据库管理优化2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { renderIcon } from '@/utils'
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui'
|
||||
import { NButton, NInput, NPopconfirm, NTag } from 'naive-ui'
|
||||
|
||||
import database from '@/api/panel/database'
|
||||
|
||||
@@ -50,6 +50,23 @@ const columns: any = [
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'comment',
|
||||
minWidth: 250,
|
||||
resizable: true,
|
||||
ellipsis: { tooltip: true },
|
||||
render(row: any) {
|
||||
return h(NInput, {
|
||||
size: 'small',
|
||||
value: row.comment,
|
||||
onBlur: () => handleComment(row),
|
||||
onUpdateValue(v) {
|
||||
row.comment = v
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
@@ -104,6 +121,12 @@ const handleDelete = async (serverID: number, name: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleComment = (row: any) => {
|
||||
database.comment(row.server_id, row.name, row.comment).then(() => {
|
||||
window.$message.success('修改成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.$bus.on('database:refresh', () => {
|
||||
refresh()
|
||||
@@ -119,7 +142,7 @@ onUnmounted(() => {
|
||||
<n-data-table
|
||||
striped
|
||||
remote
|
||||
:scroll-x="800"
|
||||
:scroll-x="1000"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
|
||||
@@ -215,7 +215,7 @@ onUnmounted(() => {
|
||||
<n-data-table
|
||||
striped
|
||||
remote
|
||||
:scroll-x="1200"
|
||||
:scroll-x="1500"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
|
||||
@@ -188,7 +188,7 @@ onUnmounted(() => {
|
||||
<n-data-table
|
||||
striped
|
||||
remote
|
||||
:scroll-x="1400"
|
||||
:scroll-x="1500"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
|
||||
Reference in New Issue
Block a user