mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-28 03:39:46 +08:00
新增自定义通知类型支持,更新相关提示信息和样式
This commit is contained in:
BIN
src/assets/images/logos/notification.png
Normal file
BIN
src/assets/images/logos/notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -6,6 +6,7 @@ import vocechat_image from '@images/logos/vocechat.png'
|
||||
import synologychat_image from '@images/logos/synologychat.png'
|
||||
import slack_image from '@images/logos/slack.webp'
|
||||
import chrome_image from '@images/logos/chrome.png'
|
||||
import custom_image from '@images/logos/notification.png'
|
||||
import { useToast } from 'vue-toast-notification'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -51,6 +52,7 @@ const notificationTypeNames: { [key: string]: string } = {
|
||||
synologychat: t('notification.synologychat.name'),
|
||||
slack: t('notification.slack.name'),
|
||||
webpush: t('notification.webpush.name'),
|
||||
custom: t('setting.notification.custom'),
|
||||
}
|
||||
|
||||
// 消息类型下拉字典
|
||||
@@ -104,8 +106,10 @@ const getIcon = computed(() => {
|
||||
return slack_image
|
||||
case 'webpush':
|
||||
return chrome_image
|
||||
default:
|
||||
case 'wechat':
|
||||
return wechat_image
|
||||
default:
|
||||
return custom_image
|
||||
}
|
||||
})
|
||||
|
||||
@@ -131,7 +135,7 @@ function onClose() {
|
||||
</div>
|
||||
<div class="text-body-1 mb-3">{{ notificationTypeNames[notification.type] }}</div>
|
||||
</div>
|
||||
<VImg :src="getIcon" cover class="mt-7 me-3" max-width="3rem" />
|
||||
<VImg :src="getIcon" cover class="mt-7 me-1" max-width="3rem" />
|
||||
</VCardText>
|
||||
</VCard>
|
||||
<VDialog v-if="notificationInfoDialog" v-model="notificationInfoDialog" scrollable max-width="40rem">
|
||||
@@ -225,7 +229,7 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-if="notificationInfo.type == 'telegram'">
|
||||
<VRow v-else-if="notificationInfo.type == 'telegram'">
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
@@ -270,7 +274,7 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-if="notificationInfo.type == 'slack'">
|
||||
<VRow v-else-if="notificationInfo.type == 'slack'">
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
@@ -308,7 +312,7 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-if="notificationInfo.type == 'synologychat'">
|
||||
<VRow v-else-if="notificationInfo.type == 'synologychat'">
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
@@ -335,7 +339,7 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-if="notificationInfo.type == 'vocechat'">
|
||||
<VRow v-else-if="notificationInfo.type == 'vocechat'">
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
@@ -371,7 +375,7 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-if="notificationInfo.type == 'webpush'">
|
||||
<VRow v-else-if="notificationInfo.type == 'webpush'">
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
@@ -390,6 +394,26 @@ function onClose() {
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
<VRow v-else>
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.type"
|
||||
:label="t('notification.type')"
|
||||
:hint="t('notification.customTypeHint')"
|
||||
persistent-hint
|
||||
active
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="notificationInfo.name"
|
||||
:label="t('notification.name')"
|
||||
:hint="t('notification.nameRequired')"
|
||||
persistent-hint
|
||||
active
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VForm>
|
||||
</VCardText>
|
||||
<VCardActions class="pt-3">
|
||||
|
||||
@@ -279,6 +279,9 @@ export default {
|
||||
nameHint: 'Name of notification channel',
|
||||
type: 'Type',
|
||||
typeHint: 'Type of notification channel',
|
||||
customTypeHint: 'Custom notification type, used for plugin implementation scenarios',
|
||||
customTypePlaceholder: 'custom',
|
||||
nameRequired: 'Please enter name',
|
||||
enabled: 'Enabled',
|
||||
config: 'Configuration',
|
||||
wechat: {
|
||||
@@ -1184,6 +1187,7 @@ export default {
|
||||
synologyChat: 'SynologyChat',
|
||||
voceChat: 'VoceChat',
|
||||
webPush: 'WebPush',
|
||||
custom: 'Custom Notification',
|
||||
},
|
||||
words: {
|
||||
customIdentifiers: 'Custom Identifiers',
|
||||
|
||||
@@ -278,6 +278,9 @@ export default {
|
||||
nameHint: '通知渠道名称',
|
||||
type: '类型',
|
||||
typeHint: '通知渠道类型',
|
||||
customTypeHint: '自定义通知类型,用于插件实现场景',
|
||||
customTypePlaceholder: 'custom',
|
||||
nameRequired: '请输入名称',
|
||||
enabled: '启用',
|
||||
config: '配置',
|
||||
wechat: {
|
||||
@@ -1171,6 +1174,7 @@ export default {
|
||||
synologyChat: 'SynologyChat',
|
||||
voceChat: 'VoceChat',
|
||||
webPush: 'WebPush',
|
||||
custom: '自定义通知',
|
||||
},
|
||||
words: {
|
||||
customIdentifiers: '自定义识别词',
|
||||
|
||||
@@ -279,6 +279,9 @@ export default {
|
||||
nameHint: '通知渠道名稱',
|
||||
type: '類型',
|
||||
typeHint: '通知渠道類型',
|
||||
customTypeHint: '自定義通知類型,用於插件實現場景',
|
||||
customTypePlaceholder: 'custom',
|
||||
nameRequired: '請輸入名稱',
|
||||
enabled: '啟用',
|
||||
config: '配置',
|
||||
wechat: {
|
||||
@@ -1173,6 +1176,7 @@ export default {
|
||||
synologyChat: 'SynologyChat',
|
||||
voceChat: 'VoceChat',
|
||||
webPush: 'WebPush',
|
||||
custom: '自定義通知',
|
||||
},
|
||||
words: {
|
||||
customIdentifiers: '自定義識別詞',
|
||||
|
||||
@@ -313,6 +313,9 @@ onMounted(() => {
|
||||
<VListItem @click="addNotification('webpush')">
|
||||
<VListItemTitle>{{ t('setting.notification.webPush') }}</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem @click="addNotification('custom')">
|
||||
<VListItemTitle>{{ t('setting.system.custom') }}</VListItemTitle>
|
||||
</VListItem>
|
||||
</VList>
|
||||
</VMenu>
|
||||
</VBtn>
|
||||
@@ -466,10 +469,10 @@ onMounted(() => {
|
||||
<style scoped>
|
||||
/* Monaco编辑器容器样式 */
|
||||
.monaco-editor-container {
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
margin-top: 1rem;
|
||||
margin-block-start: 1rem;
|
||||
}
|
||||
|
||||
.template-card {
|
||||
|
||||
Reference in New Issue
Block a user