feat(web): add WeCom QR binding flow to channel settings (#1994)

- add backend WeCom QR flow endpoints and in-memory flow state management
- add frontend WeCom binding UI with QR polling and channel enable toggle
- update channel config behavior and i18n strings for WeCom and WeChat
- apply minor formatting cleanup in model-related components
This commit is contained in:
wenjie authored and GitHub committed 2026-03-25 16:15:04 +08:00
1 parent 6bd8fec87a
commit eb307e942b
11 files changed
+945 -16

No files matched your search

@@ -12,7 +12,6 @@ import {
} from "@/components/shared-form"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Textarea } from "@/components/ui/textarea"
import {
Sheet,
SheetContent,
@@ -21,6 +20,7 @@ import {
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet"
import { Textarea } from "@/components/ui/textarea"
interface AddForm {
modelName: string
@@ -103,7 +103,8 @@ export function AddModelSheet({
}
const setField =
(key: keyof AddForm) => (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
(key: keyof AddForm) =>
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
setForm((f) => ({ ...f, [key]: e.target.value }))
if (fieldErrors[key]) {
setFieldErrors((prev) => ({ ...prev, [key]: undefined }))
@@ -12,7 +12,6 @@ import {
} from "@/components/shared-form"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Textarea } from "@/components/ui/textarea"
import {
Sheet,
SheetContent,
@@ -21,6 +20,7 @@ import {
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet"
import { Textarea } from "@/components/ui/textarea"
interface EditForm {
apiKey: string
@@ -92,7 +92,8 @@ export function EditModelSheet({
}, [model])
const setField =
(key: keyof EditForm) => (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>
(key: keyof EditForm) =>
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>
setForm((f) => ({ ...f, [key]: e.target.value }))
const handleSave = async () => {
@@ -28,7 +28,8 @@ export function ModelCard({
}: ModelCardProps) {
const { t } = useTranslation()
const isOAuth = model.auth_method === "oauth"
const canSetDefault = model.configured && !model.is_default && !model.is_virtual
const canSetDefault =
model.configured && !model.is_default && !model.is_virtual
return (
<div