-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54b734c
commit dc6eaf2
Showing
22 changed files
with
1,418 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
const API_V1 = 'api/v1'; | ||
|
||
export const HEALTH_LIVENESS_URL = `${API_V1}/liveness`; | ||
|
||
// Streams Management | ||
export const LOG_STREAM_LIST_URL = `${API_V1}/logstream`; | ||
export const LOG_STREAMS_SCHEMA_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/schema`; | ||
export const LOG_QUERY_URL = `${API_V1}/query`; | ||
export const LOG_STREAMS_ALERTS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/alert`; | ||
export const LOG_STREAMS_RETRNTION_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/retention`; | ||
export const LOG_STREAMS_STATS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/stats`; | ||
export const DELETE_STREAMS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}`; | ||
|
||
// About Parsable Instance | ||
export const ABOUT_URL = `${API_V1}/about`; | ||
|
||
// Users Management | ||
export const USERS_LIST_URL = `${API_V1}/user`; | ||
export const USER_URL = (username: string) => `${USERS_LIST_URL}/${username}`; | ||
export const USER_ROLES_URL = (username: string) => `${USER_URL(username)}/role`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Axios } from "./axios"; | ||
import { USERS_LIST_URL, USER_ROLES_URL, USER_URL } from "./constants"; | ||
|
||
export const getUsers = () => { | ||
return Axios().get(USERS_LIST_URL); | ||
} | ||
|
||
export const putUser = (username: string, roles?: object[]) => { | ||
return Axios().put(USER_URL(username), roles ); | ||
} | ||
|
||
export const deleteUser = (username: string) => { | ||
return Axios().delete(USER_URL(username)); | ||
} | ||
|
||
export const putUserRoles = (username: string, roles: object[]) => { | ||
return Axios().put(USER_ROLES_URL(username), roles); | ||
} | ||
|
||
export const getUserRoles = (username: string) => { | ||
return Axios().get(USER_ROLES_URL(username)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Button, Tooltip, px } from '@mantine/core'; | ||
import { IconUserPlus } from '@tabler/icons-react'; | ||
import type { FC } from 'react'; | ||
import { useLogQueryStyles } from './styles'; | ||
import { useHeaderContext } from '@/layouts/MainLayout/Context'; | ||
|
||
const CreateUser: FC = () => { | ||
const { classes } = useLogQueryStyles(); | ||
const { refreshNowBtn } = classes; | ||
const { | ||
state: { subCreateUserModalTogle } | ||
} = useHeaderContext(); | ||
|
||
|
||
const handleOpen = () => { | ||
subCreateUserModalTogle.set(true); | ||
}; | ||
|
||
|
||
return ( | ||
<Tooltip | ||
label={'Create New User'} | ||
sx={{ color: 'white', backgroundColor: 'black' }} | ||
withArrow | ||
onClick={handleOpen} | ||
position="left"> | ||
<Button variant="default" className={refreshNowBtn} aria-label="create user"> | ||
<IconUserPlus size={px('1.2rem')} stroke={1.5} /> | ||
</Button> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default CreateUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Button, Tooltip, px } from '@mantine/core'; | ||
import { IconReload } from '@tabler/icons-react'; | ||
import type { FC } from 'react'; | ||
import { useLogQueryStyles } from './styles'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const ReloadUser: FC = () => { | ||
const navigate = useNavigate(); | ||
const { classes } = useLogQueryStyles(); | ||
const { refreshNowBtn } = classes; | ||
|
||
return ( | ||
<Tooltip label="Refresh" sx={{ color: 'white', backgroundColor: 'black' }} withArrow position="left"> | ||
<Button className={refreshNowBtn} onClick={()=>navigate(0)}> | ||
<IconReload size={px('1.2rem')} stroke={1.5} /> | ||
</Button> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default ReloadUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Button, Tooltip, px } from '@mantine/core'; | ||
import { IconBook2 } from '@tabler/icons-react'; | ||
import type { FC } from 'react'; | ||
import { useLogQueryStyles } from './styles'; | ||
|
||
const DocsUser: FC = () => { | ||
const { classes } = useLogQueryStyles(); | ||
const { refreshNowBtn } = classes; | ||
|
||
return ( | ||
<Tooltip label={'Docs'} sx={{ color: 'white', backgroundColor: 'black' }} withArrow position="left"> | ||
<Button | ||
variant="default" | ||
className={refreshNowBtn} | ||
onClick={() => { | ||
window.open('https://www.parseable.io/docs/rbac', '_blank'); | ||
}}> | ||
<IconBook2 size={px('1.2rem')} stroke={1.5} /> | ||
</Button> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default DocsUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.