mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
feat: Enhance Bark alert configuration options and visibility (#12362)
This commit is contained in:
@@ -716,6 +716,11 @@
|
||||
cleanable
|
||||
>
|
||||
<el-option value="mail" :label="$t('xpack.alert.mail')" />
|
||||
<el-option
|
||||
v-if="!isProductPro"
|
||||
value="bark"
|
||||
:label="$t('xpack.alert.bark')"
|
||||
/>
|
||||
<el-option
|
||||
value="weCom"
|
||||
v-if="!globalStore.isIntl"
|
||||
@@ -734,6 +739,11 @@
|
||||
:disabled="!form.hasAlert || !isProductPro"
|
||||
:label="$t('xpack.alert.feiShu')"
|
||||
/>
|
||||
<el-option
|
||||
v-if="isProductPro"
|
||||
value="bark"
|
||||
:label="$t('xpack.alert.bark')"
|
||||
/>
|
||||
<el-option
|
||||
value="sms"
|
||||
v-if="!globalStore.isIntl"
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
<el-form-item :label="$t('xpack.alert.alertMethod')" prop="sendMethod">
|
||||
<el-select class="selectClass" v-model="dialogData.rowData!.sendMethod" multiple cleanable>
|
||||
<el-option value="mail" :label="$t('xpack.alert.mail')" />
|
||||
<el-option value="bark" :label="$t('xpack.alert.bark')" />
|
||||
<el-option v-if="!globalStore.isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
|
||||
<el-option
|
||||
value="weCom"
|
||||
v-if="!globalStore.isIntl"
|
||||
@@ -341,6 +341,7 @@
|
||||
:disabled="!globalStore.isProductPro"
|
||||
:label="$t('xpack.alert.feiShu')"
|
||||
/>
|
||||
<el-option v-if="globalStore.isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
|
||||
<el-option
|
||||
value="sms"
|
||||
v-if="!globalStore.isIntl"
|
||||
|
||||
@@ -121,59 +121,6 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="rounded-2xl shadow hover:shadow-md transition-all">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="text-lg font-semibold">{{ $t('xpack.alert.bark') }}</div>
|
||||
<div>
|
||||
<el-button
|
||||
plain
|
||||
round
|
||||
size="default"
|
||||
:disabled="!barkConfig.id"
|
||||
@click="onChangeBark(barkConfig.id)"
|
||||
>
|
||||
{{ $t('commons.button.edit') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="default"
|
||||
plain
|
||||
round
|
||||
:disabled="!barkConfig.id"
|
||||
@click="onDelete(barkConfig.id)"
|
||||
>
|
||||
{{ $t('commons.button.delete') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm mb-2">{{ $t('xpack.alert.barkConfigHelper') }}</div>
|
||||
<el-divider class="!mb-2 !mt-3" />
|
||||
<div class="text-sm config-form" v-if="barkConfig.id">
|
||||
<el-form
|
||||
@submit.prevent
|
||||
ref="alertFormRef"
|
||||
:label-position="mobile ? 'top' : 'left'"
|
||||
label-width="110px"
|
||||
>
|
||||
<el-form-item :label="$t('xpack.alert.webhookName')" prop="displayName">
|
||||
{{ barkConfig.config.displayName }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url">
|
||||
<div class="webhook-field">
|
||||
<el-tooltip :content="barkConfig.config.url" placement="top" effect="dark">
|
||||
<span class="webhook-text">
|
||||
{{ barkConfig.config.url }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-else class="flex items-center justify-center" style="height: 257px">
|
||||
<el-button size="large" round plain type="primary" @click="onChangeBark(0)">
|
||||
{{ $t('commons.button.create') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card
|
||||
class="rounded-2xl shadow hover:shadow-md transition-all"
|
||||
v-if="globalStore.isProductPro && !globalStore.isIntl"
|
||||
@@ -377,6 +324,68 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="rounded-2xl shadow hover:shadow-md transition-all">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="text-lg font-semibold">{{ $t('xpack.alert.bark') }}</div>
|
||||
<div>
|
||||
<el-button
|
||||
plain
|
||||
round
|
||||
size="default"
|
||||
:disabled="!barkConfig.id"
|
||||
@click="onChangeBark(barkConfig.id)"
|
||||
>
|
||||
{{ $t('commons.button.edit') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="default"
|
||||
plain
|
||||
round
|
||||
:disabled="!barkConfig.id"
|
||||
@click="onDelete(barkConfig.id)"
|
||||
>
|
||||
{{ $t('commons.button.delete') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm mb-2">{{ $t('xpack.alert.barkConfigHelper') }}</div>
|
||||
<el-divider class="!mb-2 !mt-3" />
|
||||
<div class="text-sm config-form" v-if="barkConfig.id">
|
||||
<el-form
|
||||
@submit.prevent
|
||||
ref="alertFormRef"
|
||||
:label-position="mobile ? 'top' : 'left'"
|
||||
label-width="110px"
|
||||
>
|
||||
<el-form-item :label="$t('xpack.alert.webhookName')" prop="displayName">
|
||||
{{ barkConfig.config.displayName }}
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('xpack.alert.webhookUrl')" prop="url">
|
||||
<div class="webhook-field">
|
||||
<template v-if="barkUrlVisible">
|
||||
<el-tooltip :content="barkConfig.config.url" placement="top" effect="dark">
|
||||
<span class="webhook-text">
|
||||
{{ barkConfig.config.url }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="webhook-text">****************</span>
|
||||
</template>
|
||||
<el-icon class="webhook-icon" @click="barkUrlVisible = !barkUrlVisible">
|
||||
<Hide v-if="!barkUrlVisible" />
|
||||
<View v-else />
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-else class="flex items-center justify-center" style="height: 257px">
|
||||
<el-button size="large" round plain type="primary" @click="onChangeBark(0)">
|
||||
{{ $t('commons.button.create') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card
|
||||
class="rounded-2xl shadow hover:shadow-md transition-all"
|
||||
v-if="globalStore.isProductPro && !globalStore.isIntl"
|
||||
@@ -557,6 +566,7 @@ const feiShuConfig = ref<Alert.WebhookConfig>({ ...defaultFeiShuConfig });
|
||||
const weComUrlVisible = ref(false);
|
||||
const dingTalkUrlVisible = ref(false);
|
||||
const feiShuUrlVisible = ref(false);
|
||||
const barkUrlVisible = ref(false);
|
||||
|
||||
const config = ref<Alert.AlertConfigInfo>({
|
||||
id: 0,
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
cleanable
|
||||
>
|
||||
<el-option value="mail" :label="$t('xpack.alert.mail')" />
|
||||
<el-option v-if="!isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
|
||||
<el-option
|
||||
value="weCom"
|
||||
v-if="!globalStore.isIntl"
|
||||
@@ -172,6 +173,7 @@
|
||||
:disabled="!dialogData.rowData!.hasAlert || !isProductPro"
|
||||
:label="$t('xpack.alert.feiShu')"
|
||||
/>
|
||||
<el-option v-if="isProductPro" value="bark" :label="$t('xpack.alert.bark')" />
|
||||
<el-option
|
||||
value="sms"
|
||||
v-if="!globalStore.isIntl"
|
||||
|
||||
Reference in New Issue
Block a user