- Facebook/Instagram/TikTok 渠道 OAuth 授权流程改进 - 新增 oauth/credentialstore 包 - 集成应用 OpenAI 重命名为 OpenAI 兼容 (migration 061) - 消息生命周期与 AI 流程架构文档 - inbox 管理界面 i18n 更新
69 lines
1.6 KiB
Vue
69 lines
1.6 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import ChannelSelector from '../ChannelSelector.vue';
|
|
|
|
const props = defineProps({
|
|
channel: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
enabledFeatures: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(['channelItemClick']);
|
|
|
|
const isActive = computed(() => {
|
|
const { key } = props.channel;
|
|
if (Object.keys(props.enabledFeatures).length === 0) {
|
|
return false;
|
|
}
|
|
if (key === 'website') {
|
|
return props.enabledFeatures.channel_website;
|
|
}
|
|
if (key === 'email') {
|
|
return props.enabledFeatures.channel_email;
|
|
}
|
|
if (key === 'voice') {
|
|
return props.enabledFeatures.channel_voice;
|
|
}
|
|
|
|
// All other channels (facebook, instagram, tiktok, whatsapp, sms, api,
|
|
// telegram, line, etc.) are always clickable. OAuth credentials (App ID,
|
|
// API tokens, etc.) are collected per-inbox during the channel setup flow,
|
|
// not gated by global config.
|
|
return true;
|
|
});
|
|
|
|
const isComingSoon = computed(() => {
|
|
const { key } = props.channel;
|
|
// Show "Coming Soon" only if the channel is marked as coming soon
|
|
// and the corresponding feature flag is not enabled yet.
|
|
return ['voice'].includes(key) && !isActive.value;
|
|
});
|
|
|
|
const isBeta = computed(() => {
|
|
return ['tiktok', 'voice'].includes(props.channel.key);
|
|
});
|
|
|
|
const onItemClick = () => {
|
|
if (isActive.value) {
|
|
emit('channelItemClick', props.channel.key);
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<ChannelSelector
|
|
:title="channel.title"
|
|
:description="channel.description"
|
|
:icon="channel.icon"
|
|
:is-coming-soon="isComingSoon"
|
|
:is-beta="isBeta"
|
|
:disabled="!isActive"
|
|
@click="onItemClick"
|
|
/>
|
|
</template>
|