mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix: show API Key Compatible providers in Antigravity CLI Tools model selector (#241)
This commit is contained in:
@@ -25,6 +25,7 @@ export default function AntigravityToolCard({
|
||||
const [modelMappings, setModelMappings] = useState({});
|
||||
const [modalOpen, setModalOpen] = useState(false);
|
||||
const [currentEditingAlias, setCurrentEditingAlias] = useState(null);
|
||||
const [modelAliases, setModelAliases] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
if (apiKeys?.length > 0 && !selectedApiKey) {
|
||||
@@ -40,8 +41,12 @@ export default function AntigravityToolCard({
|
||||
if (isExpanded && !status) {
|
||||
fetchStatus();
|
||||
loadSavedMappings();
|
||||
fetchModelAliases();
|
||||
}
|
||||
if (isExpanded) {
|
||||
loadSavedMappings();
|
||||
fetchModelAliases();
|
||||
}
|
||||
if (isExpanded) loadSavedMappings();
|
||||
}, [isExpanded]);
|
||||
|
||||
const loadSavedMappings = async () => {
|
||||
@@ -60,6 +65,16 @@ export default function AntigravityToolCard({
|
||||
}
|
||||
};
|
||||
|
||||
const fetchModelAliases = async () => {
|
||||
try {
|
||||
const res = await fetch("/api/models/alias");
|
||||
const data = await res.json();
|
||||
if (res.ok) setModelAliases(data.aliases || {});
|
||||
} catch (error) {
|
||||
console.log("Error fetching model aliases:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const fetchStatus = async () => {
|
||||
try {
|
||||
const res = await fetch("/api/cli-tools/antigravity-mitm");
|
||||
@@ -249,9 +264,9 @@ export default function AntigravityToolCard({
|
||||
{/* Status indicators — ordered: Cert → Server → DNS */}
|
||||
<div className="flex items-center gap-1">
|
||||
{[
|
||||
{ key: "cert", label: "Cert", ok: status?.certExists },
|
||||
{ key: "cert", label: "Cert", ok: status?.certExists },
|
||||
{ key: "server", label: "Server", ok: status?.running },
|
||||
{ key: "dns", label: "DNS", ok: status?.dnsConfigured },
|
||||
{ key: "dns", label: "DNS", ok: status?.dnsConfigured },
|
||||
].map(({ key, label, ok }, i) => {
|
||||
const isLoading = startingStep === key;
|
||||
return (
|
||||
@@ -455,6 +470,7 @@ export default function AntigravityToolCard({
|
||||
onSelect={handleModelSelect}
|
||||
selectedModel={currentEditingAlias ? modelMappings[currentEditingAlias] : null}
|
||||
activeProviders={activeProviders}
|
||||
modelAliases={modelAliases}
|
||||
title={`Select model for ${currentEditingAlias}`}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user