forked from phoenix/litellm-mirror
fix - save router settings on ui
This commit is contained in:
parent
70da4de3ff
commit
f64e261794
1 changed files with 13 additions and 7 deletions
|
@ -59,17 +59,21 @@ const GeneralSettings: React.FC<GeneralSettingsPageProps> = ({
|
||||||
setSelectedCallback(null);
|
setSelectedCallback(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSaveChanges = (callback: any) => {
|
const handleSaveChanges = (router_settings: any) => {
|
||||||
if (!accessToken) {
|
if (!accessToken) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("router_settings", router_settings);
|
||||||
|
|
||||||
const updatedVariables = Object.fromEntries(
|
const updatedVariables = Object.fromEntries(
|
||||||
Object.entries(callback.variables).map(([key, value]) => [key, (document.querySelector(`input[name="${key}"]`) as HTMLInputElement)?.value || value])
|
Object.entries(router_settings).map(([key, value]) => [key, (document.querySelector(`input[name="${key}"]`) as HTMLInputElement)?.value || value])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("updatedVariables", updatedVariables);
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
environment_variables: updatedVariables,
|
router_settings: updatedVariables
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -116,11 +120,13 @@ const GeneralSettings: React.FC<GeneralSettingsPageProps> = ({
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
|
||||||
</Card>
|
</Card>
|
||||||
|
<Col>
|
||||||
|
<Button className="mt-2" onClick={() => handleSaveChanges(routerSettings)}>
|
||||||
|
Save Changes
|
||||||
|
</Button>
|
||||||
|
</Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue