Skip to content

Commit 30d24fa

Browse files
Merge pull request #15215 from ARajan1084/prettier-support
Added prettier to autoformat frontend
2 parents b348a26 + 5197268 commit 30d24fa

File tree

298 files changed

+17298
-20166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+17298
-20166
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.next
3+
.out
4+
dist
5+
build
6+
.coverage
7+
.vercel
8+
.turbo
9+
.next-static
10+
*.min.js
11+
coverage/

ui/litellm-dashboard/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"printWidth": 120,
6+
"trailingComma": "all"
7+
}

ui/litellm-dashboard/.prettierrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
output: 'export',
4-
basePath: '',
5-
assetPrefix: '/litellm-asset-prefix', // If a server_root_path is set, this will be overridden by runtime injection
3+
output: "export",
4+
basePath: "",
5+
assetPrefix: "/litellm-asset-prefix", // If a server_root_path is set, this will be overridden by runtime injection
66
};
77

88
nextConfig.experimental = {
9-
missingSuspenseWithCSRBailout: false
10-
}
9+
missingSuspenseWithCSRBailout: false,
10+
};
1111

1212
export default nextConfig;

ui/litellm-dashboard/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/litellm-dashboard/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"start": "next start",
99
"lint": "next lint",
1010
"test": "vitest",
11-
"test:watch": "vitest -w"
11+
"test:watch": "vitest -w",
12+
"format": "prettier --write .",
13+
"format:check": "prettier --check ."
1214
},
1315
"dependencies": {
1416
"@anthropic-ai/sdk": "^0.54.0",

ui/litellm-dashboard/src/app/globals.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919

2020
body {
2121
color: rgb(var(--foreground-rgb));
22-
background: linear-gradient(
23-
to bottom,
24-
transparent,
25-
rgb(var(--background-end-rgb))
26-
)
27-
rgb(var(--background-start-rgb));
22+
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
2823
}
2924

3025
@layer utilities {

ui/litellm-dashboard/src/app/model_hub/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@ export default function PublicModelHub() {
1919
* populate navbar
2020
*
2121
*/
22-
return (
23-
<PublicModelHubPage accessToken={accessToken} />
24-
);
22+
return <PublicModelHubPage accessToken={accessToken} />;
2523
}

ui/litellm-dashboard/src/app/model_hub_table/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@ export default function PublicModelHubTable() {
1919
* populate navbar
2020
*
2121
*/
22-
return (
23-
<ModelHubTable accessToken={accessToken} publicPage={true} premiumUser={false} userRole={null}/>
24-
);
25-
}
22+
return <ModelHubTable accessToken={accessToken} publicPage={true} premiumUser={false} userRole={null} />;
23+
}

ui/litellm-dashboard/src/app/onboarding/page.tsx

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
"use client";
22
import React, { Suspense, useEffect, useState } from "react";
33
import { useSearchParams } from "next/navigation";
4-
import {
5-
Card,
6-
Title,
7-
Text,
8-
TextInput,
9-
Callout,
10-
Button,
11-
Grid,
12-
Col,
13-
} from "@tremor/react";
4+
import { Card, Title, Text, TextInput, Callout, Button, Grid, Col } from "@tremor/react";
145
import { RiAlarmWarningLine, RiCheckboxCircleLine } from "@remixicon/react";
156
import {
167
invitationClaimCall,
178
userUpdateUserCall,
189
getOnboardingCredentials,
1910
claimOnboardingToken,
2011
getUiConfig,
21-
getProxyBaseUrl
12+
getProxyBaseUrl,
2213
} from "@/components/networking";
2314
import { jwtDecode } from "jwt-decode";
2415
import { Form, Button as Button2, message } from "antd";
@@ -27,7 +18,7 @@ import { getCookie } from "@/utils/cookieUtils";
2718
export default function Onboarding() {
2819
const [form] = Form.useForm();
2920
const searchParams = useSearchParams()!;
30-
const token = getCookie('token');
21+
const token = getCookie("token");
3122
const inviteID = searchParams.get("invitation_id");
3223
const action = searchParams.get("action");
3324
const [accessToken, setAccessToken] = useState<string | null>(null);
@@ -39,14 +30,16 @@ export default function Onboarding() {
3930
const [getUiConfigLoading, setGetUiConfigLoading] = useState<boolean>(true);
4031

4132
useEffect(() => {
42-
getUiConfig().then((data) => { // get the information for constructing the proxy base url, and then set the token and auth loading
33+
getUiConfig().then((data) => {
34+
// get the information for constructing the proxy base url, and then set the token and auth loading
4335
console.log("ui config in onboarding.tsx:", data);
4436
setGetUiConfigLoading(false);
4537
});
4638
}, []);
4739

4840
useEffect(() => {
49-
if (!inviteID || getUiConfigLoading) { // wait for the ui config to be loaded
41+
if (!inviteID || getUiConfigLoading) {
42+
// wait for the ui config to be loaded
5043
return;
5144
}
5245

@@ -72,14 +65,7 @@ export default function Onboarding() {
7265
}, [inviteID, getUiConfigLoading]);
7366

7467
const handleSubmit = (formValues: Record<string, any>) => {
75-
console.log(
76-
"in handle submit. accessToken:",
77-
accessToken,
78-
"token:",
79-
jwtToken,
80-
"formValues:",
81-
formValues
82-
);
68+
console.log("in handle submit. accessToken:", accessToken, "token:", jwtToken, "formValues:", formValues);
8369
if (!accessToken || !jwtToken) {
8470
return;
8571
}
@@ -89,12 +75,7 @@ export default function Onboarding() {
8975
if (!userID || !inviteID) {
9076
return;
9177
}
92-
claimOnboardingToken(
93-
accessToken,
94-
inviteID,
95-
userID,
96-
formValues.password
97-
).then((data) => {
78+
claimOnboardingToken(accessToken, inviteID, userID, formValues.password).then((data) => {
9879
let litellm_dashboard_ui = "/ui/";
9980
litellm_dashboard_ui += "?login=success";
10081

@@ -119,15 +100,14 @@ export default function Onboarding() {
119100
<Card>
120101
<Title className="text-sm mb-5 text-center">🚅 LiteLLM</Title>
121102
<Title className="text-xl">{action === "reset_password" ? "Reset Password" : "Sign up"}</Title>
122-
<Text>{action === "reset_password" ? "Reset your password to access Admin UI." : "Claim your user account to login to Admin UI."}</Text>
103+
<Text>
104+
{action === "reset_password"
105+
? "Reset your password to access Admin UI."
106+
: "Claim your user account to login to Admin UI."}
107+
</Text>
123108

124109
{action !== "reset_password" && (
125-
<Callout
126-
className="mt-4"
127-
title="SSO"
128-
icon={RiCheckboxCircleLine}
129-
color="sky"
130-
>
110+
<Callout className="mt-4" title="SSO" icon={RiCheckboxCircleLine} color="sky">
131111
<Grid numItems={2} className="flex justify-between items-center">
132112
<Col>SSO is under the Enterprise Tier.</Col>
133113

@@ -142,28 +122,16 @@ export default function Onboarding() {
142122
</Callout>
143123
)}
144124

145-
<Form
146-
className="mt-10 mb-5 mx-auto"
147-
layout="vertical"
148-
onFinish={handleSubmit}
149-
>
125+
<Form className="mt-10 mb-5 mx-auto" layout="vertical" onFinish={handleSubmit}>
150126
<>
151127
<Form.Item label="Email Address" name="user_email">
152-
<TextInput
153-
type="email"
154-
disabled={true}
155-
value={userEmail}
156-
defaultValue={userEmail}
157-
className="max-w-md"
158-
/>
128+
<TextInput type="email" disabled={true} value={userEmail} defaultValue={userEmail} className="max-w-md" />
159129
</Form.Item>
160130

161131
<Form.Item
162132
label="Password"
163133
name="password"
164-
rules={[
165-
{ required: true, message: "password required to sign up" },
166-
]}
134+
rules={[{ required: true, message: "password required to sign up" }]}
167135
help={action === "reset_password" ? "Enter your new password" : "Create a password for your account"}
168136
>
169137
<TextInput placeholder="" type="password" className="max-w-md" />

0 commit comments

Comments
 (0)