mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat(minimax): add Group ID support to fix rate limit quota
Pass GroupId query param to Minimax T2A v2 API — required for paid plan quota allocation. Without it, Minimax defaults to (0/0 used). - shared/schema.ts: groupId field on minimaxConfig table - server/migrate.ts: ADD COLUMN IF NOT EXISTS group_id - server/routes/reels.ts: fetch and pass groupId alongside apiKey - server/services/ffmpeg.ts: minimax_group_id in request interface/body - ffmpeg-service/main.py: GroupId in URL, threaded through all call sites - client/src/pages/settings.tsx: Group ID input in Minimax settings card
This commit is contained in:
1 parent
cf20b0a264
commit
0209c3eacf
6 files changed
+61
-9
No files matched your search
@@ -31,6 +31,7 @@ export default function Settings() {
|
||||
const [ffmpegApiKey, setFfmpegApiKey] = useState("");
|
||||
const [externalApiKey, setExternalApiKey] = useState("");
|
||||
const [minimaxApiKey, setMinimaxApiKey] = useState("");
|
||||
const [minimaxGroupId, setMinimaxGroupId] = useState("");
|
||||
const { toast } = useToast();
|
||||
|
||||
const { data: session } = useQuery<{ id: string; username: string; role: string }>({
|
||||
@@ -264,6 +265,7 @@ export default function Settings() {
|
||||
|
||||
const hasExistingExternalApiConfig = !!(externalApiConfig as any)?.configured;
|
||||
const hasExistingMinimaxConfig = !!(minimaxConfig as any)?.apiKey;
|
||||
const hasExistingMinimaxGroupId = !!(minimaxConfig as any)?.groupId;
|
||||
|
||||
const saveMinimaxMutation = useMutation({
|
||||
mutationFn: () => {
|
||||
@@ -271,11 +273,15 @@ export default function Settings() {
|
||||
if (minimaxApiKey && minimaxApiKey.trim() !== "") {
|
||||
payload.apiKey = minimaxApiKey;
|
||||
}
|
||||
if (minimaxGroupId && minimaxGroupId.trim() !== "") {
|
||||
payload.groupId = minimaxGroupId;
|
||||
}
|
||||
return apiRequest('POST', '/api/minimax/config', payload);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['/api/minimax/config'] });
|
||||
setMinimaxApiKey("");
|
||||
setMinimaxGroupId("");
|
||||
toast({
|
||||
title: "Configuration sauvegardée",
|
||||
description: "Votre clé API Minimax a été enregistrée",
|
||||
@@ -680,6 +686,24 @@ export default function Settings() {
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="minimaxGroupId">Group ID Minimax</Label>
|
||||
<Input
|
||||
id="minimaxGroupId"
|
||||
type="text"
|
||||
value={minimaxGroupId}
|
||||
onChange={(e) => setMinimaxGroupId(e.target.value)}
|
||||
placeholder={hasExistingMinimaxGroupId ? "••••••••••••••••" : "1234567890"}
|
||||
data-testid="input-minimax-group-id"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{hasExistingMinimaxGroupId ? (
|
||||
<span className="text-green-600 dark:text-green-400">✓ Group ID configuré - Laissez vide pour conserver</span>
|
||||
) : (
|
||||
"Requis pour les quotas corrects — trouvez-le sur platform.minimaxi.com dans votre profil"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="rounded-lg bg-muted/50 p-3 space-y-1">
|
||||
<p className="text-xs font-medium">Voix françaises disponibles :</p>
|
||||
<div className="grid grid-cols-2 gap-1 text-xs text-muted-foreground">
|
||||
@@ -693,7 +717,7 @@ export default function Settings() {
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => saveMinimaxMutation.mutate()}
|
||||
disabled={saveMinimaxMutation.isPending || (!minimaxApiKey.trim() && !hasExistingMinimaxConfig)}
|
||||
disabled={saveMinimaxMutation.isPending || (!minimaxApiKey.trim() && !minimaxGroupId.trim() && !hasExistingMinimaxConfig)}
|
||||
data-testid="button-save-minimax"
|
||||
className="w-full"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user