Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 377328a

Browse files
Chores: UI Fixes and add default role (#161)
* Add local fonts in build for UI consistency * Reset log page data on sub query log change * Sort stream list in the drop down * Add default oidc role * Rename Logs --> Explore and Query --> SQL * Add * and tool tip in highlight the default oidc role
1 parent ff359ec commit 377328a

Some content is hidden

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

56 files changed

+520
-44
lines changed

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1414
-->
1515
<link rel="manifest" href="/manifest.json" />
16+
17+
<link rel="stylesheet" href="/fonts/inter.css">
18+
1619
</head>
1720
<body>
1821
<div id="root"></div>

public/fonts/Inter-Black.woff

136 KB
Binary file not shown.

public/fonts/Inter-Black.woff2

100 KB
Binary file not shown.

public/fonts/Inter-BlackItalic.woff

143 KB
Binary file not shown.

public/fonts/Inter-BlackItalic.woff2

106 KB
Binary file not shown.

public/fonts/Inter-Bold.woff

140 KB
Binary file not shown.

public/fonts/Inter-Bold.woff2

104 KB
Binary file not shown.

public/fonts/Inter-BoldItalic.woff

148 KB
Binary file not shown.

public/fonts/Inter-BoldItalic.woff2

109 KB
Binary file not shown.

public/fonts/Inter-ExtraBold.woff

140 KB
Binary file not shown.

public/fonts/Inter-ExtraBold.woff2

104 KB
Binary file not shown.
147 KB
Binary file not shown.
109 KB
Binary file not shown.

public/fonts/Inter-ExtraLight.woff

137 KB
Binary file not shown.

public/fonts/Inter-ExtraLight.woff2

102 KB
Binary file not shown.
146 KB
Binary file not shown.
109 KB
Binary file not shown.

public/fonts/Inter-Italic.woff

141 KB
Binary file not shown.

public/fonts/Inter-Italic.woff2

104 KB
Binary file not shown.

public/fonts/Inter-Light.woff

137 KB
Binary file not shown.

public/fonts/Inter-Light.woff2

102 KB
Binary file not shown.

public/fonts/Inter-LightItalic.woff

147 KB
Binary file not shown.

public/fonts/Inter-LightItalic.woff2

109 KB
Binary file not shown.

public/fonts/Inter-Medium.woff

139 KB
Binary file not shown.

public/fonts/Inter-Medium.woff2

103 KB
Binary file not shown.

public/fonts/Inter-MediumItalic.woff

147 KB
Binary file not shown.

public/fonts/Inter-MediumItalic.woff2

110 KB
Binary file not shown.

public/fonts/Inter-Regular.woff

131 KB
Binary file not shown.

public/fonts/Inter-Regular.woff2

96.6 KB
Binary file not shown.

public/fonts/Inter-SemiBold.woff

140 KB
Binary file not shown.

public/fonts/Inter-SemiBold.woff2

103 KB
Binary file not shown.
148 KB
Binary file not shown.
109 KB
Binary file not shown.

public/fonts/Inter-Thin.woff

133 KB
Binary file not shown.

public/fonts/Inter-Thin.woff2

97.3 KB
Binary file not shown.

public/fonts/Inter-ThinItalic.woff

142 KB
Binary file not shown.

public/fonts/Inter-ThinItalic.woff2

104 KB
Binary file not shown.

public/fonts/Inter-italic.var.woff2

239 KB
Binary file not shown.

public/fonts/Inter-roman.var.woff2

222 KB
Binary file not shown.

public/fonts/Inter.var.woff2

317 KB
Binary file not shown.

public/fonts/inter.css

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
@font-face {
2+
font-family: 'Inter';
3+
font-style: normal;
4+
font-weight: 100;
5+
font-display: swap;
6+
src: url("Inter-Thin.woff2?v=3.19") format("woff2"),
7+
url("Inter-Thin.woff?v=3.19") format("woff");
8+
}
9+
@font-face {
10+
font-family: 'Inter';
11+
font-style: italic;
12+
font-weight: 100;
13+
font-display: swap;
14+
src: url("Inter-ThinItalic.woff2?v=3.19") format("woff2"),
15+
url("Inter-ThinItalic.woff?v=3.19") format("woff");
16+
}
17+
18+
@font-face {
19+
font-family: 'Inter';
20+
font-style: normal;
21+
font-weight: 200;
22+
font-display: swap;
23+
src: url("Inter-ExtraLight.woff2?v=3.19") format("woff2"),
24+
url("Inter-ExtraLight.woff?v=3.19") format("woff");
25+
}
26+
@font-face {
27+
font-family: 'Inter';
28+
font-style: italic;
29+
font-weight: 200;
30+
font-display: swap;
31+
src: url("Inter-ExtraLightItalic.woff2?v=3.19") format("woff2"),
32+
url("Inter-ExtraLightItalic.woff?v=3.19") format("woff");
33+
}
34+
35+
@font-face {
36+
font-family: 'Inter';
37+
font-style: normal;
38+
font-weight: 300;
39+
font-display: swap;
40+
src: url("Inter-Light.woff2?v=3.19") format("woff2"),
41+
url("Inter-Light.woff?v=3.19") format("woff");
42+
}
43+
@font-face {
44+
font-family: 'Inter';
45+
font-style: italic;
46+
font-weight: 300;
47+
font-display: swap;
48+
src: url("Inter-LightItalic.woff2?v=3.19") format("woff2"),
49+
url("Inter-LightItalic.woff?v=3.19") format("woff");
50+
}
51+
52+
@font-face {
53+
font-family: 'Inter';
54+
font-style: normal;
55+
font-weight: 400;
56+
font-display: swap;
57+
src: url("Inter-Regular.woff2?v=3.19") format("woff2"),
58+
url("Inter-Regular.woff?v=3.19") format("woff");
59+
}
60+
@font-face {
61+
font-family: 'Inter';
62+
font-style: italic;
63+
font-weight: 400;
64+
font-display: swap;
65+
src: url("Inter-Italic.woff2?v=3.19") format("woff2"),
66+
url("Inter-Italic.woff?v=3.19") format("woff");
67+
}
68+
69+
@font-face {
70+
font-family: 'Inter';
71+
font-style: normal;
72+
font-weight: 500;
73+
font-display: swap;
74+
src: url("Inter-Medium.woff2?v=3.19") format("woff2"),
75+
url("Inter-Medium.woff?v=3.19") format("woff");
76+
}
77+
@font-face {
78+
font-family: 'Inter';
79+
font-style: italic;
80+
font-weight: 500;
81+
font-display: swap;
82+
src: url("Inter-MediumItalic.woff2?v=3.19") format("woff2"),
83+
url("Inter-MediumItalic.woff?v=3.19") format("woff");
84+
}
85+
86+
@font-face {
87+
font-family: 'Inter';
88+
font-style: normal;
89+
font-weight: 600;
90+
font-display: swap;
91+
src: url("Inter-SemiBold.woff2?v=3.19") format("woff2"),
92+
url("Inter-SemiBold.woff?v=3.19") format("woff");
93+
}
94+
@font-face {
95+
font-family: 'Inter';
96+
font-style: italic;
97+
font-weight: 600;
98+
font-display: swap;
99+
src: url("Inter-SemiBoldItalic.woff2?v=3.19") format("woff2"),
100+
url("Inter-SemiBoldItalic.woff?v=3.19") format("woff");
101+
}
102+
103+
@font-face {
104+
font-family: 'Inter';
105+
font-style: normal;
106+
font-weight: 700;
107+
font-display: swap;
108+
src: url("Inter-Bold.woff2?v=3.19") format("woff2"),
109+
url("Inter-Bold.woff?v=3.19") format("woff");
110+
}
111+
@font-face {
112+
font-family: 'Inter';
113+
font-style: italic;
114+
font-weight: 700;
115+
font-display: swap;
116+
src: url("Inter-BoldItalic.woff2?v=3.19") format("woff2"),
117+
url("Inter-BoldItalic.woff?v=3.19") format("woff");
118+
}
119+
120+
@font-face {
121+
font-family: 'Inter';
122+
font-style: normal;
123+
font-weight: 800;
124+
font-display: swap;
125+
src: url("Inter-ExtraBold.woff2?v=3.19") format("woff2"),
126+
url("Inter-ExtraBold.woff?v=3.19") format("woff");
127+
}
128+
@font-face {
129+
font-family: 'Inter';
130+
font-style: italic;
131+
font-weight: 800;
132+
font-display: swap;
133+
src: url("Inter-ExtraBoldItalic.woff2?v=3.19") format("woff2"),
134+
url("Inter-ExtraBoldItalic.woff?v=3.19") format("woff");
135+
}
136+
137+
@font-face {
138+
font-family: 'Inter';
139+
font-style: normal;
140+
font-weight: 900;
141+
font-display: swap;
142+
src: url("Inter-Black.woff2?v=3.19") format("woff2"),
143+
url("Inter-Black.woff?v=3.19") format("woff");
144+
}
145+
@font-face {
146+
font-family: 'Inter';
147+
font-style: italic;
148+
font-weight: 900;
149+
font-display: swap;
150+
src: url("Inter-BlackItalic.woff2?v=3.19") format("woff2"),
151+
url("Inter-BlackItalic.woff?v=3.19") format("woff");
152+
}
153+
154+
/* -------------------------------------------------------
155+
Variable font.
156+
Usage:
157+
158+
html { font-family: 'Inter', sans-serif; }
159+
@supports (font-variation-settings: normal) {
160+
html { font-family: 'Inter var', sans-serif; }
161+
}
162+
*/
163+
@font-face {
164+
font-family: 'Inter var';
165+
font-weight: 100 900;
166+
font-display: swap;
167+
font-style: normal;
168+
font-named-instance: 'Regular';
169+
src: url("Inter-roman.var.woff2?v=3.19") format("woff2");
170+
}
171+
@font-face {
172+
font-family: 'Inter var';
173+
font-weight: 100 900;
174+
font-display: swap;
175+
font-style: italic;
176+
font-named-instance: 'Italic';
177+
src: url("Inter-italic.var.woff2?v=3.19") format("woff2");
178+
}
179+
180+
181+
/* --------------------------------------------------------------------------
182+
[EXPERIMENTAL] Multi-axis, single variable font.
183+
184+
Slant axis is not yet widely supported (as of February 2019) and thus this
185+
multi-axis single variable font is opt-in rather than the default.
186+
187+
When using this, you will probably need to set font-variation-settings
188+
explicitly, e.g.
189+
190+
* { font-variation-settings: "slnt" 0deg }
191+
.italic { font-variation-settings: "slnt" 10deg }
192+
193+
*/
194+
@font-face {
195+
font-family: 'Inter var experimental';
196+
font-weight: 100 900;
197+
font-display: swap;
198+
font-style: oblique 0deg 10deg;
199+
src: url("Inter.var.woff2?v=3.19") format("woff2");
200+
}

src/@types/parseable/api/about.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ export type AboutData = {
1111
llmActive: boolean;
1212
llmProvider: string;
1313
uiVersion: string;
14+
grpcPort: number;
15+
oidcActive: boolean;
1416
};

src/api/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const USERS_LIST_URL = `${API_V1}/user`;
1717
export const USER_URL = (username: string) => `${USERS_LIST_URL}/${username}`;
1818
export const USER_ROLES_URL = (username: string) => `${USER_URL(username)}/role`;
1919
export const USER_PASSWORD_URL = (username: string) => `${USER_URL(username)}/generate-new-password`;
20+
export const DEFAULT_ROLE_URL = `${API_V1}/role/default`;
2021

2122
// Roles Management
2223
export const ROLES_LIST_URL = `${API_V1}/role`;

src/api/roles.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
import { Axios } from "./axios";
2-
import { ROLE_URL, ROLES_LIST_URL } from "./constants";
1+
import { Axios } from './axios';
2+
import { DEFAULT_ROLE_URL, ROLE_URL, ROLES_LIST_URL } from './constants';
33

44
export const getRoles = () => {
5-
return Axios().get(ROLES_LIST_URL);
6-
}
5+
return Axios().get(ROLES_LIST_URL);
6+
};
77

88
export const deleteRole = (roleName: string) => {
9-
return Axios().delete(ROLE_URL(roleName));
10-
}
9+
return Axios().delete(ROLE_URL(roleName));
10+
};
1111

1212
export const putRole = (roleName: string, privilege: object[]) => {
13-
return Axios().put(ROLE_URL(roleName), privilege);
14-
}
13+
return Axios().put(ROLE_URL(roleName), privilege);
14+
};
1515

1616
export const getRole = (roleName: string) => {
17-
return Axios().get(ROLE_URL(roleName));
18-
}
17+
return Axios().get(ROLE_URL(roleName));
18+
};
19+
20+
export const putDeafultRole = (roleName: string) => {
21+
return Axios().put(DEFAULT_ROLE_URL, roleName, { headers: { 'Content-Type': 'application/json' } });
22+
};
23+
24+
export const getDefaultRole = () => {
25+
return Axios().get(DEFAULT_ROLE_URL);
26+
};

src/components/Navbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import { NAVBAR_WIDTH } from '@/constants/theme';
3535
const baseURL = import.meta.env.VITE_PARSEABLE_URL ?? '/';
3636

3737
const links = [
38-
{ icon: IconZoomCode, label: 'Query', pathname: '/query', requiredAccess: ['Query', 'GetSchema'] },
39-
{ icon: IconTableShortcut, label: 'Logs', pathname: '/logs', requiredAccess: ['Query', 'GetSchema'] },
38+
{ icon: IconZoomCode, label: 'SQL', pathname: '/query', requiredAccess: ['Query', 'GetSchema'] },
39+
{ icon: IconTableShortcut, label: 'Explore', pathname: '/logs', requiredAccess: ['Query', 'GetSchema'] },
4040
{ icon: IconReportAnalytics, label: 'Stats', pathname: '/stats', requiredAccess: ['GetStats'] },
4141
{ icon: IconSettings, label: 'Config', pathname: '/config', requiredAccess: ['PutAlert'] },
4242
];

src/components/Navbar/infoModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type InfoModalProps = {
5959
const InfoModal: FC<InfoModalProps> = (props) => {
6060
const { opened, close } = props;
6161
const {
62-
state: { subLLMActive },
62+
state: { subInstanceConfig },
6363
} = useHeaderContext();
6464

6565
const { data, loading, error, getAbout, resetData } = useGetAbout();
@@ -83,9 +83,9 @@ const InfoModal: FC<InfoModalProps> = (props) => {
8383

8484
useEffect(() => {
8585
if (data) {
86-
subLLMActive.set(data.llmActive);
86+
subInstanceConfig.set(data);
8787
}
88-
}, [data?.llmActive]);
88+
}, [data]);
8989

9090
const { classes } = useInfoModalStyles();
9191
const {

src/hooks/useGetDefaultRole.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { StatusCodes } from 'http-status-codes';
2+
import useMountedState from './useMountedState';
3+
import { getDefaultRole } from '@/api/roles';
4+
import { notifications } from '@mantine/notifications';
5+
import { IconFileAlert } from '@tabler/icons-react';
6+
7+
export const useGetDefaultRole = () => {
8+
const [data, setData] = useMountedState<string | null>(null);
9+
const [error, setError] = useMountedState<string | null>(null);
10+
const [loading, setLoading] = useMountedState<boolean>(false);
11+
12+
const getDefaultOidc = async () => {
13+
try {
14+
setLoading(true);
15+
setError(null);
16+
const res = await getDefaultRole();
17+
18+
switch (res.status) {
19+
case StatusCodes.OK: {
20+
const streams = res.data;
21+
22+
setData(streams);
23+
break;
24+
}
25+
default: {
26+
setError('Failed to get default role');
27+
notifications.show({
28+
id: 'get-default-role',
29+
color: 'red',
30+
title: 'Error occurred',
31+
message: 'Failed to get default role',
32+
icon: <IconFileAlert size="1rem" />,
33+
autoClose: 2000,
34+
});
35+
}
36+
}
37+
} catch {
38+
setError('Failed to get default role');
39+
notifications.show({
40+
id: 'get-default-role',
41+
color: 'red',
42+
title: 'Error occurred',
43+
message: 'Failed to get default role',
44+
icon: <IconFileAlert size="1rem" />,
45+
autoClose: 2000,
46+
});
47+
} finally {
48+
setLoading(false);
49+
}
50+
};
51+
52+
const resetData = () => {
53+
setData(null);
54+
};
55+
56+
return { data, error, loading, getDefaultOidc, resetData };
57+
};

src/hooks/useGetLogStreamList.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ export const useGetLogStreamList = () => {
3535

3636
switch (res.status) {
3737
case StatusCodes.OK: {
38-
const streams = res.data;
38+
const streams = res.data.sort((a, b) => {
39+
const nameA = a.name.toUpperCase();
40+
const nameB = b.name.toUpperCase();
41+
if (nameA < nameB) {
42+
return -1;
43+
}
44+
if (nameA > nameB) {
45+
return 1;
46+
}
47+
return 0;
48+
});
3949

4050
setData(streams);
4151
if (streams && Boolean(streams.length)) {
@@ -65,7 +75,7 @@ export const useGetLogStreamList = () => {
6575
setError('Unauthorized');
6676
Cookies.remove('session');
6777
Cookies.remove('username');
68-
78+
6979
notifications.update({
7080
id: 'load-data',
7181
color: 'red',

0 commit comments

Comments
 (0)