From 2470f8cba7221a8271a89ca49fb84ef7c4056e6a Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 3 Feb 2023 15:12:56 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E4=BC=98=E5=8C=96=E4=B8=80=E6=B3=A2=20?= =?UTF-8?q?lina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AccountListTable/const.js | 21 ++++----- .../TableFormatters/ChoicesFormatter.vue | 11 +++-- .../TableFormatters/ProtocolsFormatter.vue | 43 +++++++++++++++++++ src/components/TableFormatters/index.js | 7 ++- src/i18n/langs/en.json | 2 +- src/i18n/langs/ja.json | 2 +- src/i18n/langs/zh.json | 2 +- .../components/AssetBulkUpdateDialog.vue | 34 +++++++-------- .../Asset/AssetList/components/BaseList.vue | 11 ++--- src/views/assets/Label/LabelList.vue | 5 ++- .../Applet/AppletHost/AppletHostList.vue | 7 +-- 11 files changed, 96 insertions(+), 49 deletions(-) create mode 100644 src/components/TableFormatters/ProtocolsFormatter.vue diff --git a/src/components/AccountListTable/const.js b/src/components/AccountListTable/const.js index 48f869856..7f491c815 100644 --- a/src/components/AccountListTable/const.js +++ b/src/components/AccountListTable/const.js @@ -1,24 +1,25 @@ -import ChoicesFormatter from '@/components/TableFormatters/ChoicesFormatter' import i18n from '@/i18n/i18n' +import { ChoicesFormatter } from '@/components/TableFormatters' export const connectivityMeta = { - label: i18n.t('assets.Reachable'), + label: i18n.t('assets.Connectivity'), formatter: ChoicesFormatter, formatterArgs: { faChoices: { + '-': '', ok: 'fa-check-circle', - failed: 'fa-times-circle', - unknown: 'fa fa-question-circle' + err: 'fa-times-circle' }, classChoices: { ok: 'text-primary', - failed: 'text-danger', - unknown: 'fa fa-question-circle' + err: 'text-danger' }, - textChoices: { - ok: 'Avail', - failed: 'Failed', - unknown: '-' + getText({ cellValue }) { + if (cellValue.value === '-') { + return '-' + } else { + return cellValue.label + } } }, width: '100px', diff --git a/src/components/TableFormatters/ChoicesFormatter.vue b/src/components/TableFormatters/ChoicesFormatter.vue index 518859591..752f7e72b 100644 --- a/src/components/TableFormatters/ChoicesFormatter.vue +++ b/src/components/TableFormatters/ChoicesFormatter.vue @@ -1,6 +1,6 @@