mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
add webpush switch
This commit is contained in:
@@ -720,6 +720,7 @@ export interface NotificationSwitch {
|
|||||||
slack: boolean
|
slack: boolean
|
||||||
synologychat: boolean
|
synologychat: boolean
|
||||||
vocechat: boolean
|
vocechat: boolean
|
||||||
|
webpush: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文件浏览接口
|
// 文件浏览接口
|
||||||
|
|||||||
+5
-1
@@ -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',
|
title: 'VoceChat',
|
||||||
value: 'vocechat',
|
value: 'vocechat',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'WebPush',
|
||||||
|
value: 'webpush',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
@@ -430,6 +434,7 @@ onMounted(() => {
|
|||||||
<th scope="col">Slack</th>
|
<th scope="col">Slack</th>
|
||||||
<th scope="col">SynologyChat</th>
|
<th scope="col">SynologyChat</th>
|
||||||
<th scope="col">VoceChat</th>
|
<th scope="col">VoceChat</th>
|
||||||
|
<th scope="col">WebPush</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -452,6 +457,9 @@ onMounted(() => {
|
|||||||
<td>
|
<td>
|
||||||
<VCheckbox v-model="message.vocechat" />
|
<VCheckbox v-model="message.vocechat" />
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<VCheckbox v-model="message.webpush" />
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="messagemTypes.length === 0">
|
<tr v-if="messagemTypes.length === 0">
|
||||||
<td colspan="6" class="text-center">没有设置任何通知渠道</td>
|
<td colspan="6" class="text-center">没有设置任何通知渠道</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user