-
Notifications
You must be signed in to change notification settings - Fork 44
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
70890f8
commit c83f5aa
Showing
36 changed files
with
1,088 additions
and
11 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
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
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
52 changes: 52 additions & 0 deletions
52
frontend/control-center/src/pages/LLMConsumers/EmptyState/index.module.scss
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,52 @@ | ||
@import 'assets/scss/colors.scss'; | ||
@import 'assets/scss/fonts.scss'; | ||
|
||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: calc(100% - 88px); | ||
} | ||
|
||
.contentContainer { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
h1 { | ||
@include font-m; | ||
font-weight: 800; | ||
color: var(--color-text-contrast); | ||
margin: 31px 0; | ||
} | ||
|
||
span { | ||
@include font-base; | ||
color: var(--color-text-gray); | ||
} | ||
|
||
.subscribeButton { | ||
color: var(--color-airy-blue); | ||
&:hover { | ||
cursor: pointer; | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
|
||
.iconContainer { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: var(--color-background-gray); | ||
height: 95px; | ||
width: 105px; | ||
} | ||
|
||
.searchIcon { | ||
height: 45px; | ||
width: 45px; | ||
color: var(--color-airy-blue); | ||
} |
30 changes: 30 additions & 0 deletions
30
frontend/control-center/src/pages/LLMConsumers/EmptyState/index.tsx
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,30 @@ | ||
import React, {Dispatch, SetStateAction} from 'react'; | ||
import styles from './index.module.scss'; | ||
import {ReactComponent as SearchIcon} from 'assets/images/icons/search.svg'; | ||
import {useTranslation} from 'react-i18next'; | ||
|
||
type EmptyStateProps = { | ||
createNewLLM: Dispatch<SetStateAction<boolean>>; | ||
}; | ||
|
||
export const EmptyState = (props: EmptyStateProps) => { | ||
const {createNewLLM} = props; | ||
const {t} = useTranslation(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.contentContainer}> | ||
<div className={styles.iconContainer}> | ||
<SearchIcon className={styles.searchIcon} /> | ||
</div> | ||
<h1>{t('noLLMConsumers')}</h1> | ||
<span> | ||
{t('noLLMConsumersText')} | ||
<span onClick={() => createNewLLM(true)} className={styles.subscribeButton}> | ||
{t('create') + ' one'} | ||
</span> | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; |
47 changes: 47 additions & 0 deletions
47
frontend/control-center/src/pages/LLMConsumers/LLMConsumerItem/index.module.scss
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,47 @@ | ||
@import 'assets/scss/fonts.scss'; | ||
@import 'assets/scss/colors.scss'; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: row; | ||
height: 50px; | ||
align-items: center; | ||
justify-content: flex-start; | ||
|
||
p { | ||
@include font-base; | ||
color: var(--color-text-contrast); | ||
font-weight: bold; | ||
width: 25%; | ||
} | ||
|
||
p:first-child { | ||
width: 30%; | ||
} | ||
|
||
p:nth-child(4) { | ||
width: 15%; | ||
} | ||
} | ||
|
||
.actionButton { | ||
width: 2%; | ||
outline: none; | ||
cursor: pointer; | ||
border: none; | ||
background: none; | ||
padding: 0; | ||
} | ||
|
||
.actionSVG { | ||
width: 16px; | ||
height: 18px; | ||
path { | ||
fill: var(--color-dark-elements-gray); | ||
} | ||
&:hover { | ||
path { | ||
fill: var(--color-airy-blue); | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
frontend/control-center/src/pages/LLMConsumers/LLMConsumerItem/index.tsx
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,39 @@ | ||
import React from 'react'; | ||
import {ReactComponent as TrashIcon} from 'assets/images/icons/trash.svg'; | ||
import {useTranslation} from 'react-i18next'; | ||
import {HttpClientInstance} from '../../../httpClient'; | ||
import styles from './index.module.scss'; | ||
import {NotificationModel} from 'model'; | ||
import {set} from 'lodash-es'; | ||
|
||
type EmptyStateProps = { | ||
item: {name: string; topic: string; status: string; lag: number}; | ||
setNotification: (object: NotificationModel) => void; | ||
}; | ||
|
||
export const LLMConsumerItem = (props: EmptyStateProps) => { | ||
const {item, setNotification} = props; | ||
const {t} = useTranslation(); | ||
|
||
const deleteConsumer = () => { | ||
HttpClientInstance.deleteLLMConsumer({name: item.name}) | ||
.then(() => { | ||
setNotification({show: true, successful: true, text: 'Consumer Deleted'}); | ||
}) | ||
.catch(() => { | ||
setNotification({show: true, successful: false, text: t('errorOccurred')}); | ||
}); | ||
}; | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<p>{item.name}</p> | ||
<p>{item.topic}</p> | ||
<p>{item.status}</p> | ||
<p>{item.lag}</p> | ||
<button type="button" className={styles.actionButton} onClick={deleteConsumer}> | ||
<TrashIcon className={styles.actionSVG} title={t('delete')} /> | ||
</button> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.