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);
|
||||
};
|
||||
|
||||
const handleSaveChanges = (callback: any) => {
|
||||
const handleSaveChanges = (router_settings: any) => {
|
||||
if (!accessToken) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("router_settings", router_settings);
|
||||
|
||||
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 = {
|
||||
environment_variables: updatedVariables,
|
||||
router_settings: updatedVariables
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -117,10 +121,12 @@ const GeneralSettings: React.FC<GeneralSettingsPageProps> = ({
|
|||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
|
||||
</Card>
|
||||
|
||||
<Col>
|
||||
<Button className="mt-2" onClick={() => handleSaveChanges(routerSettings)}>
|
||||
Save Changes
|
||||
</Button>
|
||||
</Col>
|
||||
</Grid>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue