feat: add methodInvalid translation for alert configuration (#13005)

This commit is contained in:
2026-06-11 12:24:29 +08:00
committed by GitHub
parent e777fa143e
commit c846ca3e71
13 changed files with 27 additions and 5 deletions
+1
View File
@@ -5463,6 +5463,7 @@ const message = {
alertNotice: 'Alert Notification',
methodConfig: 'Notification Method Configuration',
createMethod: 'Create Notification Method',
methodInvalid: 'Invalid configuration {0}',
commonConfig: 'Global Configuration',
smsConfig: 'SMS',
smsConfigHelper: 'Configure phone numbers for SMS notifications',
+1
View File
@@ -5531,6 +5531,7 @@ const message = {
alertNotice: 'Notificación de alerta',
methodConfig: 'Config de métodos de notificación',
createMethod: 'Crear método de notificación',
methodInvalid: 'Configuración inválida {0}',
commonConfig: 'Config global',
smsConfig: 'SMS',
smsConfigHelper: 'Configura teléfonos para notificaciones SMS',
+1
View File
@@ -5505,6 +5505,7 @@ const message = {
alertNotice: 'アラート通知',
methodConfig: '通知方法の設定',
createMethod: '通知方法を作成',
methodInvalid: '無効な設定 {0}',
commonConfig: 'グローバル設定',
smsConfig: 'SMS',
smsConfigHelper: 'SMS 通知の電話番号を設定する',
+1
View File
@@ -5390,6 +5390,7 @@ const message = {
alertNotice: '알림 통지',
methodConfig: '알림 방법 설정',
createMethod: '알림 방법 생성',
methodInvalid: '유효하지 않은 설정 {0}',
commonConfig: '전역 설정',
smsConfig: 'SMS',
smsConfigHelper: 'SMS 알림을 받을 전화번호를 설정합니다',
+1
View File
@@ -5577,6 +5577,7 @@ const message = {
alertNotice: 'Pemberitahuan Amaran',
methodConfig: 'Konfigurasi Kaedah Pemberitahuan',
createMethod: 'Cipta Kaedah Pemberitahuan',
methodInvalid: 'Konfigurasi tidak sah {0}',
commonConfig: 'Konfigurasi Global',
smsConfig: 'SMS',
smsConfigHelper: 'Konfigurasi nombor untuk pemberitahuan SMS',
+1
View File
@@ -5723,6 +5723,7 @@ const message = {
alertNotice: 'Notificação de Alerta',
methodConfig: 'Configuração do Método de Notificação',
createMethod: 'Criar Método de Notificação',
methodInvalid: 'Configuração inválida {0}',
commonConfig: 'Configuração Global',
smsConfig: 'SMS',
smsConfigHelper: 'Configure os números para notificação por SMS',
+1
View File
@@ -5575,6 +5575,7 @@ const message = {
alertNotice: 'Уведомление об оповещении',
methodConfig: 'Настройка способа уведомления',
createMethod: 'Создать способ уведомления',
methodInvalid: 'Недопустимая конфигурация {0}',
commonConfig: 'Глобальная настройка',
smsConfig: 'SMS',
smsConfigHelper: 'Настройка номеров для SMS-уведомлений',
+1
View File
@@ -5567,6 +5567,7 @@ const message = {
alertNotice: 'Uyarı Bildirimi',
methodConfig: 'Bildirim Yöntemi Ayarı',
createMethod: 'Bildirim Yöntemi Oluştur',
methodInvalid: 'Geçersiz yapılandırma {0}',
commonConfig: 'Genel Ayar',
smsConfig: 'SMS',
smsConfigHelper: 'SMS bildirimi için telefon numaralarını yapılandırın',
+1
View File
@@ -5100,6 +5100,7 @@ const message = {
alertNotice: '警報通知',
methodConfig: '發送方式設定',
createMethod: '建立發送方式',
methodInvalid: '失效設定 {0}',
commonConfig: '全域設定',
smsConfig: '簡訊',
smsConfigHelper: '設定簡訊通知號碼',
+1
View File
@@ -5070,6 +5070,7 @@ const message = {
alertNotice: '告警通知',
methodConfig: '发送方式配置',
createMethod: '创建发送方式',
methodInvalid: '失效配置 {0}',
commonConfig: '全局配置',
smsConfig: '短信通知',
smsConfigHelper: '配置短信通知号码',
@@ -30,7 +30,7 @@
:label="$t('xpack.alert.licenseException')"
/>
<el-option
v-if="isProductPro && !isEE"
v-if="isProductPro"
value="nodeException"
:label="$t('xpack.alert.nodeException')"
/>
@@ -214,7 +214,7 @@ const openView = async (
rowData: Partial<Alert.AlertInfo> = {
type: isMaster.value && !isEE.value ? 'panelPwdEndTime' : 'sshLogin',
cycle: 15,
count: 0,
count: isMaster.value && !isEE.value ? 0 : 3,
sendCount: 3,
method: '',
project: '',
@@ -300,9 +300,12 @@ const formatMethod = (row: Alert.AlertInfo) => {
return typeLabel;
}
}
const invalidLabel = /^\d+$/.test(method)
? i18n.global.t('xpack.alert.methodInvalid', [`#${method}`])
: i18n.global.t('xpack.alert.methodInvalid', [method]);
const oldLabel = i18n.global.t(`xpack.alert.${method}`);
if (!oldLabel || oldLabel === `xpack.alert.${method}` || oldLabel.includes('.')) {
return /^\d+$/.test(method) ? `#${method}` : method;
return invalidLabel;
}
return oldLabel;
};
@@ -570,6 +570,7 @@ const acceptParams = (params: DialogProps): void => {
}
initOptions(dialogData.value.rowData.type, dialogData.value.rowData.subType);
visible.value = true;
console.log(dialogData.value.rowData);
};
const rules = reactive({
+10 -2
View File
@@ -21,7 +21,12 @@
</template>
</el-table-column>
<el-table-column :label="$t('xpack.alert.alertMethod')" prop="method" width="200px">
<el-table-column
:label="$t('xpack.alert.alertMethod')"
prop="method"
width="200px"
show-overflow-tooltip
>
<template #default="{ row }">
{{ formatMethod(row) }}
</template>
@@ -245,6 +250,9 @@ const formatMethod = (row: Alert.AlertLog) => {
}
}
const invalidLabel = /^\d+$/.test(method)
? i18n.global.t('xpack.alert.methodInvalid', [`#${method}`])
: i18n.global.t('xpack.alert.methodInvalid', [method]);
switch (method) {
case 'mail':
case 'email':
@@ -264,7 +272,7 @@ const formatMethod = (row: Alert.AlertLog) => {
case 'bark':
return t('xpack.alert.bark');
default:
return /^\d+$/.test(method) ? `#${method}` : method;
return invalidLabel;
}
};