feat: alert better visibility control (#12893)

* feat: alert better visibility control

* feat: alert better visibility control
This commit is contained in:
2026-05-28 18:04:41 +08:00
committed by GitHub
parent f5b47cf74d
commit 024a4a9ef3
4 changed files with 20 additions and 16 deletions
@@ -747,7 +747,7 @@
/>
<el-option
value="sms"
v-if="!isIntl"
v-if="!isIntl || !isEE"
:disabled="!form.hasAlert || !isProductPro"
:label="$t('xpack.alert.sms')"
/>
@@ -871,7 +871,7 @@ import { routerToName, routerToPath } from '@/utils/router';
import { loadBaseDir } from '@/api/modules/setting';
const router = useRouter();
const { docsUrl, isFxplay, isIntl, isProductPro } = useGlobalStore();
const { docsUrl, isFxplay, isIntl, isEE, isProductPro } = useGlobalStore();
const licenseRef = ref();
const scriptFileRef = ref();
const dirRef = ref();
@@ -18,7 +18,11 @@
<el-select filterable clearable v-model="req.type" @change="search()" class="!w-52 dropdown">
<template #prefix>{{ $t('commons.table.type') }}</template>
<template v-if="isMaster">
<el-option value="panelPwdEndTime" :label="$t('xpack.alert.panelPwdEndTime')" />
<el-option
v-if="!isEE"
value="panelPwdEndTime"
:label="$t('xpack.alert.panelPwdEndTime')"
/>
<el-option value="panelLogin" :label="$t('xpack.alert.panelLogin')" />
<el-option
v-if="isProductPro"
@@ -26,11 +30,11 @@
:label="$t('xpack.alert.licenseException')"
/>
<el-option
v-if="isProductPro"
v-if="isProductPro && !isEE.value"
value="nodeException"
:label="$t('xpack.alert.nodeException')"
/>
<el-option value="panelUpdate" :label="$t('xpack.alert.panelUpdate')" />
<el-option v-if="!isEE" value="panelUpdate" :label="$t('xpack.alert.panelUpdate')" />
</template>
<el-option value="sshLogin" :label="$t('xpack.alert.sshLogin')" />
<el-option value="ssl" :label="$t('xpack.alert.ssl')" />
@@ -152,7 +156,7 @@ import AddTask from '@/views/setting/alert/dash/task/index.vue';
import { Alert } from '@/api/interface/alert';
import { UpdateAlertStatus, SearchAlerts, DeleteAlert } from '@/api/modules/alert';
const { isMobile, isMaster, isProductPro } = useGlobalStore();
const { isMobile, isMaster, isProductPro, isEE } = useGlobalStore();
const { t } = i18n.global;
const loading = ref(false);
@@ -197,7 +201,7 @@ const buttons = [
const openView = async (
title: string,
rowData: Partial<Alert.AlertInfo> = {
type: isMaster.value ? 'panelPwdEndTime' : 'sshLogin',
type: isMaster.value && !isEE.value ? 'panelPwdEndTime' : 'sshLogin',
cycle: 15,
count: 0,
sendCount: 3,
@@ -25,7 +25,7 @@
/>
</template>
</el-select>
<span class="input-help" v-if="dialogData.rowData!.type === 'panelPwdEndTime'">
<span class="input-help" v-if="dialogData.rowData!.type === 'panelPwdEndTime' && !isEE">
{{ $t('xpack.alert.panelPwdEndTimeRulesHelper') }}
<el-link
style="font-size: 12px; margin-left: 5px"
@@ -343,7 +343,7 @@
<el-option v-if="isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
<el-option
value="sms"
v-if="!isIntl"
v-if="!isIntl || !isEE"
:disabled="!isProductPro"
:label="$t('xpack.alert.sms')"
/>
@@ -388,7 +388,7 @@ import { routerToName } from '@/utils/router';
import { checkCidr, checkCidrV6, checkIpV4V6 } from '@/utils/validate';
import { useGlobalStore } from '@/composables/useGlobalStore';
const { isMaster, isProductPro, isIntl } = useGlobalStore();
const { isMaster, isProductPro, isIntl, isEE } = useGlobalStore();
interface DialogProps {
title: string;
@@ -454,20 +454,20 @@ const rules = reactive({
});
const allTaskOptions = [
{ value: 'panelPwdEndTime', label: 'xpack.alert.panelPwdEndTime', show: isMaster.value },
{ value: 'panelLogin', label: 'xpack.alert.panelLogin', show: isMaster.value },
{ value: 'panelPwdEndTime', label: 'xpack.alert.panelPwdEndTime', show: isMaster.value && !isEE.value },
{ value: 'sshLogin', label: 'xpack.alert.sshLogin', show: true },
{ value: 'panelLogin', label: 'xpack.alert.panelLogin', show: isMaster.value },
{ value: 'licenseException', label: 'xpack.alert.licenseException', show: isMaster.value && isProductPro.value },
{ value: 'ssl', label: 'xpack.alert.ssl', show: true },
{ value: 'siteEndTime', label: 'xpack.alert.siteEndTime', show: true },
{ value: 'nodeException', label: 'xpack.alert.nodeException', show: isMaster.value && isProductPro.value },
{ value: 'nodeException', label: 'xpack.alert.nodeException', show: isMaster.value && isProductPro.value && !isEE.value },
{ value: 'cpu', label: 'xpack.alert.cpu', show: true },
{ value: 'memory', label: 'xpack.alert.memory', show: true },
{ value: 'disk', label: 'xpack.alert.disk', show: true },
{ value: 'load', label: 'xpack.alert.load', show: true },
{ value: 'cronJob', label: 'xpack.alert.cronjob', show: true },
{ value: 'clams', label: 'xpack.alert.clams', show: true },
{ value: 'panelUpdate', label: 'xpack.alert.panelUpdate', show: isMaster.value },
{ value: 'panelUpdate', label: 'xpack.alert.panelUpdate', show: isMaster.value && !isEE.value },
];
function checkRange(value: any, min: number, max: number, callback: any) {
@@ -180,7 +180,7 @@
<el-option v-if="isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
<el-option
value="sms"
v-if="!isIntl"
v-if="!isIntl || !isEE"
:disabled="!dialogData.rowData!.hasAlert || !isProductPro"
:label="$t('xpack.alert.sms')"
/>
@@ -245,7 +245,7 @@ import { createClam, updateClam } from '@/api/modules/toolbox';
import { useGlobalStore } from '@/composables/useGlobalStore';
import { specOptions, transObjToSpec, transSpecToObj, weekOptions } from '@/views/cronjob/cronjob/helper';
import { splitTimeFromSecond, transferTimeToSecond } from '@/utils/validate';
const { isIntl, isProductPro } = useGlobalStore();
const { isIntl, isProductPro, isEE } = useGlobalStore();
const licenseRef = ref();
const scanDirRef = ref();
const infectedDirRef = ref();