fix: Fix some issues with the alert (#9594)

This commit is contained in:
2025-07-22 10:11:59 +08:00 committed by GitHub
parent 71193cc912
commit 3334bf594d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 8 deletions

View file

@ -290,7 +290,7 @@ func isWithinTimeRange(savedTimeString string) bool {
func GetEmailContent(alertType string, params []dto.Param) string {
switch GetCronJobType(alertType) {
case "ssl":
return i18n.GetMsgWithMap("SSLAlert", map[string]interface{}{"day": getValueByIndex(params, "1")})
return i18n.GetMsgWithMap("SSLAlert", map[string]interface{}{"num": getValueByIndex(params, "1"), "day": getValueByIndex(params, "2")})
case "siteEndTime":
return i18n.GetMsgWithMap("WebSiteAlert", map[string]interface{}{"num": getValueByIndex(params, "1"), "day": getValueByIndex(params, "2")})
case "panelPwdEndTime":

View file

@ -1377,12 +1377,11 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
form.exclusionRules = form.ignoreFiles.join(',');
form.snapshotRule = { withImage: form.withImage, ignoreAppIDs: form.ignoreAppIDs };
form.alertCount = form.hasAlert && isProductPro.value ? form.alertCount : 0;
form.alertCount = form.hasAlert ? form.alertCount : 0;
form.alertMethod = form.alertMethodItems.join(',');
form.alertTitle =
form.hasAlert && isProductPro.value
? i18n.global.t('cronjob.alertTitle', [i18n.global.t('cronjob.' + form.type), form.name])
: '';
form.alertTitle = form.hasAlert
? i18n.global.t('cronjob.alertTitle', [i18n.global.t('cronjob.' + form.type), form.name])
: '';
if (!form) return;
if (isCreate.value) {

View file

@ -389,7 +389,7 @@ const rules = reactive({
cycle: [Rules.requiredInput, Rules.integerNumber, { validator: checkCycle, trigger: 'blur' }],
count: [Rules.requiredInput, Rules.integerNumber, { validator: checkCount, trigger: 'blur' }],
sendCount: [Rules.requiredInput, Rules.integerNumber, { validator: checkSendCount, trigger: 'blur' }],
method: [Rules.requiredSelect],
sendMethod: [Rules.requiredSelect],
});
function checkCycle(rule: any, value: any, callback: any) {

View file

@ -4,7 +4,9 @@
<template #toolbar>
<div class="flex justify-between gap-2 flex-wrap sm:flex-row">
<div class="flex flex-wrap gap-3">
<el-button type="primary" @click="syncAll">{{ $t('commons.button.sync') }}</el-button>
<el-button type="primary" @click="syncAll" v-if="isProductPro">
{{ $t('commons.button.sync') }}
</el-button>
<el-button type="primary" plain @click="onClean">{{ $t('xpack.alert.cleanLog') }}</el-button>
</div>
</div>
@ -59,6 +61,7 @@
</template>
</el-table-column>
<fu-table-operations
v-if="isProductPro"
:ellipsis="2"
width="130px"
:buttons="buttons"
@ -271,6 +274,7 @@ const searchAlertInfo = async () => {
loading.value = false;
}
}
await search();
};
onMounted(async () => {