From 6da4861a95fb8f0a2cbad6e7fec080c253b705da Mon Sep 17 00:00:00 2001
From: Xun Qin <42538704+lvchenjia@users.noreply.github.com>
Date: Wed, 8 Nov 2023 11:50:38 +0800
Subject: [PATCH] fix: fix issue #5, limit the display length of the text box
content
Signed-off-by: Xun Qin <42538704+lvchenjia@users.noreply.github.com>
fix: fix issue #5, limit the display length of the text box content
---
src/layout/components/admin/UserList.vue | 8 ++++--
src/views/alertPage/alert-config.vue | 13 ++++++++-
src/views/alertPage/index.vue | 3 +++
src/views/alertPage/system-log.vue | 27 ++++++++-----------
.../clusterManagement/DiskManagement.vue | 16 ++++++++---
.../clusterManagement/ServerManagement.vue | 4 ++-
src/views/storagePool/index.vue | 3 +++
7 files changed, 50 insertions(+), 24 deletions(-)
diff --git a/src/layout/components/admin/UserList.vue b/src/layout/components/admin/UserList.vue
index 5a06205..ea12631 100644
--- a/src/layout/components/admin/UserList.vue
+++ b/src/layout/components/admin/UserList.vue
@@ -39,12 +39,16 @@ const columns = ref([
{
title: '用户名',
key: 'userName',
-
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '邮箱',
key: 'email',
-
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '用户角色',
diff --git a/src/views/alertPage/alert-config.vue b/src/views/alertPage/alert-config.vue
index 65eecf4..49b5c53 100644
--- a/src/views/alertPage/alert-config.vue
+++ b/src/views/alertPage/alert-config.vue
@@ -55,6 +55,9 @@ const columns = ref([
title: '名称',
width: 'auto',
key: 'name',
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '级别',
@@ -84,17 +87,25 @@ const columns = ref([
title: '规则',
width: 'auto',
key: 'rule',
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '描述',
width: 'auto',
key: 'desc',
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '接收人',
width: 'auto',
key: 'alertUsers',
-
+ ellipsis: {
+ tooltip: true
+ },
render: row => {
return {row.alertUsers.join(', ')}
},
diff --git a/src/views/alertPage/index.vue b/src/views/alertPage/index.vue
index 13bcfb2..5297838 100644
--- a/src/views/alertPage/index.vue
+++ b/src/views/alertPage/index.vue
@@ -120,6 +120,9 @@ const columns = ref([
title: '告警内容',
width: 'auto',
key: 'summary',
+ ellipsis: {
+ tooltip: true
+ },
},
])
diff --git a/src/views/alertPage/system-log.vue b/src/views/alertPage/system-log.vue
index 83ea4dc..70b871c 100644
--- a/src/views/alertPage/system-log.vue
+++ b/src/views/alertPage/system-log.vue
@@ -89,6 +89,9 @@ const columns = ref([
title: '访问者',
width: 'auto',
key: 'user',
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '模块',
@@ -99,7 +102,9 @@ const columns = ref([
title: '操作',
width: 'auto',
key: 'method',
-
+ ellipsis: {
+ tooltip: true
+ },
// render: (row) => {
// return (
// {row.enable? '开启' : '关闭'}
@@ -110,26 +115,16 @@ const columns = ref([
title: '结果',
width: 'auto',
key: 'errorMsg',
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '内容',
width: 'auto',
key: 'content',
- render(row) {
- return (
-
- {{
- trigger: () => (
-
- {row.content.length < 15
- ? row.content
- : row.content.substring(0, 15) + '...'}
-
- ),
- default: () => {row.content},
- }}
-
- )
+ ellipsis: {
+ tooltip: true
},
},
])
diff --git a/src/views/clusterManagement/DiskManagement.vue b/src/views/clusterManagement/DiskManagement.vue
index 36e87fd..84378c3 100644
--- a/src/views/clusterManagement/DiskManagement.vue
+++ b/src/views/clusterManagement/DiskManagement.vue
@@ -92,7 +92,9 @@ const columns = ref([
title: '主机名',
width: 'auto',
key: 'hostName',
-
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '盘符',
@@ -104,13 +106,17 @@ const columns = ref([
title: '类型',
width: 'auto',
key: 'diskType',
-
+ ellipsis: {
+ tooltip: true
+ },
},
{
title: '型号',
width: 'auto',
key: 'model',
-
+ ellipsis: {
+ tooltip: true
+ },
},
// {
// title: '写缓存',
@@ -121,7 +127,9 @@ const columns = ref([
title: '挂载点',
key: 'mountPoint',
width: 'auto',
-
+ ellipsis: {
+ tooltip: true
+ },
render(row) {
if (row.mountPoint) {
return {row.mountPoint}
diff --git a/src/views/clusterManagement/ServerManagement.vue b/src/views/clusterManagement/ServerManagement.vue
index 8ed3bcc..9cc5568 100644
--- a/src/views/clusterManagement/ServerManagement.vue
+++ b/src/views/clusterManagement/ServerManagement.vue
@@ -37,7 +37,9 @@ const columns = ref([
title: '主机名',
key: 'hostName',
width: 'auto',
-
+ ellipsis: {
+ tooltip: true
+ },
render(row) {
return h(
NButton,
diff --git a/src/views/storagePool/index.vue b/src/views/storagePool/index.vue
index 9b0539b..d69160c 100644
--- a/src/views/storagePool/index.vue
+++ b/src/views/storagePool/index.vue
@@ -23,6 +23,9 @@ const columns: DataTableColumns = [
title: '逻辑池名称',
width: 'auto',
key: 'name',
+ ellipsis: {
+ tooltip: true
+ },
render(row) {
return h(
NButton,