2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 11:27:17 +08:00

fix: 应用更新按钮错位

This commit is contained in:
耗子
2024-10-31 04:11:03 +08:00
parent 17cf1ada0e
commit f399e9fcec

View File

@@ -5,7 +5,7 @@ defineOptions({
import VersionModal from '@/views/app/VersionModal.vue'
import { NButton, NDataTable, NPopconfirm, NSwitch } from 'naive-ui'
import { NButton, NDataTable, NFlex, NPopconfirm, NSwitch } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import TheIcon from '@/components/custom/TheIcon.vue'
@@ -72,98 +72,102 @@ const columns: any = [
title: t('appIndex.columns.actions'),
key: 'actions',
width: 280,
align: 'center',
hideInExcel: true,
render(row: any) {
return [
row.installed && row.update_exist
? h(
NPopconfirm,
{
onPositiveClick: () => handleUpdate(row.slug)
},
{
default: () => {
return t('appIndex.confirm.update', { app: row.name })
return h(
NFlex,
{
justify: 'center'
},
[
row.installed && row.update_exist
? h(
NPopconfirm,
{
onPositiveClick: () => handleUpdate(row.slug)
},
trigger: () => {
return h(
NButton,
{
size: 'small',
type: 'warning'
},
{
default: () => t('appIndex.buttons.update'),
icon: renderIcon('material-symbols:arrow-circle-up-outline-rounded', {
size: 14
})
}
)
{
default: () => {
return t('appIndex.confirm.update', { app: row.name })
},
trigger: () => {
return h(
NButton,
{
size: 'small',
type: 'warning'
},
{
default: () => t('appIndex.buttons.update'),
icon: renderIcon('material-symbols:arrow-circle-up-outline-rounded', {
size: 14
})
}
)
}
}
}
)
: null,
row.installed
? h(
NButton,
{
size: 'small',
type: 'success',
onClick: () => handleManage(row.slug)
},
{
default: () => t('appIndex.buttons.manage'),
icon: renderIcon('material-symbols:settings-outline', { size: 14 })
}
)
: null,
row.installed
? h(
NPopconfirm,
{
onPositiveClick: () => handleUninstall(row.slug)
},
{
default: () => {
return t('appIndex.confirm.uninstall', { app: row.name })
)
: null,
row.installed
? h(
NButton,
{
size: 'small',
type: 'success',
onClick: () => handleManage(row.slug)
},
trigger: () => {
return h(
NButton,
{
size: 'small',
type: 'error',
style: 'margin-left: 15px;'
},
{
default: () => t('appIndex.buttons.uninstall'),
icon: renderIcon('material-symbols:delete-outline', { size: 14 })
}
)
{
default: () => t('appIndex.buttons.manage'),
icon: renderIcon('material-symbols:settings-outline', { size: 14 })
}
}
)
: null,
!row.installed
? h(
NButton,
{
size: 'small',
type: 'info',
onClick: () => {
versionModalShow.value = true
versionModalOperation.value = '安装'
versionModalInfo.value = row
)
: null,
row.installed
? h(
NPopconfirm,
{
onPositiveClick: () => handleUninstall(row.slug)
},
{
default: () => {
return t('appIndex.confirm.uninstall', { app: row.name })
},
trigger: () => {
return h(
NButton,
{
size: 'small',
type: 'error'
},
{
default: () => t('appIndex.buttons.uninstall'),
icon: renderIcon('material-symbols:delete-outline', { size: 14 })
}
)
}
}
},
{
default: () => t('appIndex.buttons.install'),
icon: renderIcon('material-symbols:download-rounded', { size: 14 })
}
)
: null
]
)
: null,
!row.installed
? h(
NButton,
{
size: 'small',
type: 'info',
onClick: () => {
versionModalShow.value = true
versionModalOperation.value = '安装'
versionModalInfo.value = row
}
},
{
default: () => t('appIndex.buttons.install'),
icon: renderIcon('material-symbols:download-rounded', { size: 14 })
}
)
: null
]
)
}
}
]