fix: custom_providers base_url and dynamic deliver targets (#801)

- custom_providers: always use user's base_url instead of
  PROVIDER_PRESETS matching by name that overwrites local URLs
- JobFormModal: dynamically add connected platform channels
  (Telegram, Discord, Slack, WhatsApp, Matrix, WeChat, WeCom,
  Feishu, DingTalk) to job deliver target dropdown

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
WenhuaXia
2026-05-16 22:07:02 +08:00
committed by GitHub
parent 8571a7d0ac
commit f2c8ace7c2
2 changed files with 29 additions and 12 deletions
@@ -2,6 +2,7 @@
import { ref, onMounted, computed } from 'vue'
import { NModal, NForm, NFormItem, NInput, NButton, NSelect, NInputNumber, useMessage } from 'naive-ui'
import { useJobsStore } from '@/stores/hermes/jobs'
import { useSettingsStore } from '@/stores/hermes/settings'
import {
buildJobUpdateRequest,
getJob,
@@ -23,6 +24,7 @@ const emit = defineEmits<{
}>()
const jobsStore = useJobsStore()
const settingsStore = useSettingsStore()
const message = useMessage()
const showModal = ref(true)
@@ -50,10 +52,30 @@ const schedulePresets = computed(() => [
{ label: t('jobs.presetEveryMonth'), value: '0 9 1 * *' },
])
const targetOptions = computed(() => [
{ label: t('jobs.origin'), value: 'origin' },
{ label: t('jobs.local'), value: 'local' },
])
const targetOptions = computed(() => {
const options: Array<{ label: string; value: string }> = [
{ label: t('jobs.origin'), value: 'origin' },
{ label: t('jobs.local'), value: 'local' },
]
const channels = [
{ key: 'telegram', label: 'Telegram' },
{ key: 'discord', label: 'Discord' },
{ key: 'slack', label: 'Slack' },
{ key: 'whatsapp', label: 'WhatsApp' },
{ key: 'matrix', label: 'Matrix' },
{ key: 'weixin', label: 'WeChat' },
{ key: 'wecom', label: 'WeCom' },
{ key: 'feishu', label: 'Feishu' },
{ key: 'dingtalk', label: 'DingTalk' },
]
for (const ch of channels) {
const config = settingsStore.platforms[ch.key] || {}
if (Object.keys(config).length > 0) {
options.push({ label: ch.label, value: ch.key })
}
}
return options
})
const originalJob = ref<Job | null>(null)