Skip to content

Commit d55df8b

Browse files
authored
feature/profile-system (#1513)
* chore: merge every pr * chore: added use query to system and profile
1 parent 274a2d0 commit d55df8b

18 files changed

+229
-84
lines changed

src/controllers/sys_info_controller.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub struct LoginRequest {
192192
pub password: String,
193193
}
194194

195-
#[derive(Debug, Serialize, Deserialize, Clone)]
195+
#[derive(Debug, Serialize, Deserialize, Clone, ToSchema)]
196196
pub struct VersionInfo {
197197
pub version: &'static str,
198198
pub r#ref: &'static str,
@@ -206,7 +206,7 @@ pub struct VersionInfo {
206206
get,
207207
path="/info",
208208
responses(
209-
(status = 200, description = "Gets the info of the server")),
209+
(status = 200, description = "Gets the info of the server", body=VersionInfo)),
210210
tag="info"
211211
)]
212212
pub async fn get_info() -> Json<VersionInfo> {

ui/components.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {}
22+
}

ui/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@
3535
"@tanstack/react-query": "^5.89.0",
3636
"@types/uuid": "^11.0.0",
3737
"chart.js": "^4.5.0",
38+
"class-variance-authority": "^0.7.1",
39+
"clsx": "^2.1.1",
3840
"copy-text-to-clipboard": "^3.2.1",
3941
"csstype": "^3.1.3",
4042
"framer-motion": "^12.23.16",
4143
"i18next": "^25.5.2",
4244
"i18next-browser-languagedetector": "^8.2.0",
4345
"javascript-time-ago": "^2.5.12",
46+
"lucide-react": "^0.544.0",
4447
"material-symbols": "^0.35.2",
4548
"notistack": "^3.0.2",
4649
"oidc-client-ts": "^3.3.0",
@@ -57,6 +60,7 @@
5760
"react-waypoint": "^10.3.0",
5861
"sanitize-html": "^2.17.0",
5962
"socket.io-client": "^4.8.1",
63+
"tailwind-merge": "^3.3.1",
6064
"uuid": "^13.0.0",
6165
"zustand": "^5.0.8"
6266
},
@@ -76,6 +80,7 @@
7680
"openapi-typescript": "^7.9.1",
7781
"postcss": "^8.5.6",
7882
"tailwindcss": "^4.1.13",
83+
"tw-animate-css": "^1.3.8",
7984
"typescript": "^5.9.2",
8085
"vite": "npm:rolldown-vite@7.1.11",
8186
"vitest": "^3.2.4"

ui/pnpm-lock.yaml

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

ui/schema.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,14 @@ export interface components {
13211321
role: string;
13221322
username: string;
13231323
};
1324+
VersionInfo: {
1325+
ci: string;
1326+
commit: string;
1327+
os: string;
1328+
ref: string;
1329+
time: string;
1330+
version: string;
1331+
};
13241332
};
13251333
responses: never;
13261334
parameters: never;
@@ -1386,7 +1394,9 @@ export interface operations {
13861394
headers: {
13871395
[name: string]: unknown;
13881396
};
1389-
content?: never;
1397+
content: {
1398+
"application/json": components["schemas"]["VersionInfo"];
1399+
};
13901400
};
13911401
};
13921402
};

ui/src/components/CustomInput.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import {ChangeEventHandler, FC, InputHTMLAttributes} from 'react'
2+
import {LoadingSkeletonSpan} from "./ui/LoadingSkeletonSpan";
23

34

4-
export const CustomInput: FC<InputHTMLAttributes<HTMLInputElement>> = ({ autoComplete, onBlur, className = '', id, name, onChange, disabled, placeholder, required, type = 'text', value, ...props }) => {
5+
export const CustomInput: FC<InputHTMLAttributes<HTMLInputElement> & {
6+
loading?: boolean
7+
}> = ({ autoComplete, onBlur, className = '', id, name, onChange, disabled, placeholder, required, type = 'text', value, ...props }) => {
8+
if (props.loading) {
9+
console.log("Loading")
10+
return <LoadingSkeletonSpan text={""} loading={props.loading}/>
11+
}
512
return (
613
<input onBlur={onBlur} autoComplete={autoComplete} disabled={disabled} className={"bg-(--input-bg-color)" +
714
" px-4 py-2 rounded-lg text-sm text-(--input-fg-color) placeholder:text-(--input-fg-color-disabled) " + className} id={id} name={name} placeholder={placeholder} onChange={onChange} value={value} type={type} required={required} {...props} />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {Skeleton} from "./skeleton";
2+
3+
export const ChartLoadingSkeleton = ()=>{
4+
return <Skeleton className="h-[20px] w-[100px] rounded-full" />
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {FC} from "react";
2+
import {Skeleton} from "./skeleton";
3+
4+
type LoadingSkeletonProps = {
5+
loading?: boolean,
6+
text: string| undefined|number
7+
}
8+
9+
export const LoadingSkeletonDD: FC<LoadingSkeletonProps> = ({
10+
loading,
11+
text
12+
}) => {
13+
return (
14+
<dd className="text-(--fg-secondary-color)">{loading == true ? <Skeleton style={{height: '100%'}}/>: text}</dd>
15+
)
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {FC} from "react";
2+
import {Skeleton} from "./skeleton";
3+
4+
type LoadingSkeletonProps = {
5+
loading?: boolean,
6+
text: string| undefined
7+
}
8+
9+
export const LoadingSkeletonSpan: FC<LoadingSkeletonProps> = ({
10+
loading,
11+
text
12+
}) => {
13+
return (
14+
<span className="text-(--fg-secondary-color)">{loading == true ? <Skeleton style={{height: '100%'}}/>: text}</span>
15+
)
16+
}

ui/src/components/ui/skeleton.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { cn } from "../../lib/utils"
2+
3+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4+
return (
5+
<div
6+
data-slot="skeleton"
7+
className={cn("bg-(--input-bg-color) animate-pulse rounded-md", className)}
8+
{...props}
9+
/>
10+
)
11+
}
12+
13+
export { Skeleton }

0 commit comments

Comments
 (0)