mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-18 09:07:35 +08:00
add webpush switch
This commit is contained in:
@@ -720,6 +720,7 @@ export interface NotificationSwitch {
|
||||
slack: boolean
|
||||
synologychat: boolean
|
||||
vocechat: boolean
|
||||
webpush: boolean
|
||||
}
|
||||
|
||||
// 文件浏览接口
|
||||
|
||||
@@ -107,7 +107,11 @@ async function subscribeForPushNotifications() {
|
||||
}
|
||||
})
|
||||
// 发送订阅请求
|
||||
await api.post('/message/subscribe', subscription)
|
||||
try {
|
||||
await api.post('/message/webpush/subscribe', subscription)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ const NotificationChannels = [
|
||||
title: 'VoceChat',
|
||||
value: 'vocechat',
|
||||
},
|
||||
{
|
||||
title: 'WebPush',
|
||||
value: 'webpush',
|
||||
},
|
||||
]
|
||||
|
||||
// 提示框
|
||||
@@ -430,6 +434,7 @@ onMounted(() => {
|
||||
<th scope="col">Slack</th>
|
||||
<th scope="col">SynologyChat</th>
|
||||
<th scope="col">VoceChat</th>
|
||||
<th scope="col">WebPush</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -452,6 +457,9 @@ onMounted(() => {
|
||||
<td>
|
||||
<VCheckbox v-model="message.vocechat" />
|
||||
</td>
|
||||
<td>
|
||||
<VCheckbox v-model="message.webpush" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="messagemTypes.length === 0">
|
||||
<td colspan="6" class="text-center">没有设置任何通知渠道</td>
|
||||
|
||||
Reference in New Issue
Block a user