Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4175] UI improvements control center #4176

Merged
merged 11 commits into from
Jun 25, 2024
1 change: 0 additions & 1 deletion frontend/control-center/src/actions/streams/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const getTopicInfo = (topicName: string) => async (dispatch: Dispatch<any

export const getSchemas = () => async (dispatch: Dispatch<any>) => {
return getData('schemas.list').then(response => {
console.log(response);
dispatch(setTopicSchemasAction(response));
return Promise.resolve(true);
});
Expand Down
31 changes: 21 additions & 10 deletions frontend/control-center/src/components/ChannelAvatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ import {ReactComponent as MetaAvatar} from 'assets/images/icons/meta.svg';
import {ReactComponent as OpenaiAvatar} from 'assets/images/icons/openai.svg';
import {ReactComponent as PineconeAvatar} from 'assets/images/icons/pinecone.svg';
import {ReactComponent as ChromaAvatar} from 'assets/images/icons/chroma.svg';
import {ReactComponent as MosaicAvatar} from 'assets/images/icons/mosaic.svg';
import {ReactComponent as WeaviateAvatar} from 'assets/images/icons/weaviate.svg';
import {ReactComponent as GmailAvatar} from 'assets/images/icons/gmail.svg';
import {ReactComponent as SlackAvatar} from 'assets/images/icons/slack.svg';
import {ReactComponent as FlinkAvatar} from 'assets/images/icons/flink.svg';
import {ReactComponent as AnthropicAvatar} from 'assets/images/icons/anthropic.svg';
import {ReactComponent as MistralAvatar} from 'assets/images/icons/mistral-ai.svg';
import {ReactComponent as GoogleAIAvatar} from 'assets/images/icons/google-ai.svg';
import {ReactComponent as GroqAvatar} from 'assets/images/icons/groq.svg';
import {ReactComponent as AWSBedrockAvatar} from 'assets/images/icons/aws.svg';

import {Channel, Source} from 'model';
import styles from './index.module.scss';
Expand Down Expand Up @@ -114,30 +118,37 @@ export const getChannelAvatar = (source: string) => {
case 'FAISS connector':
return <MetaAvatar />;
case Source.llama2:
case 'LLama2':
case 'Llama2':
return <MetaAvatar />;
case Source.openaiConnector:
case 'OpenAI connector':
case 'OpenAI':
return <OpenaiAvatar />;
case Source.pineconeConnector:
case 'Pinecone connector':
case 'Pinecone':
return <PineconeAvatar />;
case Source.chroma:
case 'Chroma':
return <ChromaAvatar />;
case Source.mosaic:
case 'Mosaic':
return <MosaicAvatar />;
case Source.weaviate:
case 'Weaviate':
return <WeaviateAvatar />;
case Source.gmail:
case 'GMail connector':
case 'Gmail':
return <GmailAvatar />;
case 'Slack connector':
case 'Slack':
return <SlackAvatar />;
case 'Flink connector':
case 'Flink':
return <FlinkAvatar />;
case 'Anthropic':
return <AnthropicAvatar />;
case 'Mistral AI':
return <MistralAvatar />;
case 'Google AI Studio':
return <GoogleAIAvatar />;
case 'groq':
return <GroqAvatar />;
case 'AWS Bedrock':
return <AWSBedrockAvatar />;

default:
return <AiryAvatar />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@
height: 80px;
margin-right: 24px;
}

.dropdownTitle {
font-family: 'Lato', sans-serif;
font-size: 14px;
font-weight: bold;
display: flex;
color: var(--color-text-contrast);
height: 20px;
display: flex;
align-items: center;
margin-bottom: 4px;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Input} from 'components';
import {Dropdown, Input} from 'components';
import {Source} from 'model';
import React, {Dispatch, SetStateAction, useEffect, useState} from 'react';
import {useTranslation} from 'react-i18next';
Expand Down Expand Up @@ -59,26 +59,44 @@ export const SetConfigInputs = (props: SetConfigInputsProps) => {
const sensitive = label.includes('Token') || label.includes('Password') || label.includes('Secret');
const placeholder = source === 'rasa' ? t(`rasaPlaceholder`) : hasSteps ? stepPlaceholder : defaultPlaceholder;

inputArr.push(
<div key={index} className={styles.input}>
<Input
type={sensitive ? 'password' : isUrl ? 'url' : hasSteps ? 'number' : 'text'}
step={hasSteps ? 0.01 : undefined}
min={hasSteps ? 0.1 : undefined}
max={hasSteps ? 0.9 : undefined}
name={key}
value={valueTyped === 'string' || valueTyped === 'optionalString' ? '' : valueTyped}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setInput({...input, [keyTyped]: e.target.value})}
label={label}
placeholder={placeholder}
showLabelIcon
tooltipText={t(`inputTooltip${capitalSource}${toolTip}`)}
required={valueTyped !== 'optionalString'}
height={32}
fontClass="font-base"
/>
</div>
);
if (configurationValues[key].split('/')[0] === 'dropdown') {
const dropdownOptions = configurationValues[key].replace('dropdown/', '').split('/');
const [option, setOption] = useState(dropdownOptions[0]);
inputArr.push(
<div key={index} className={styles.input}>
<div className={styles.dropdownTitle}>{key}</div>
<Dropdown
text={option}
variant="normal"
options={dropdownOptions}
onClick={(option: string) => {
setOption(option);
}}
/>
</div>
);
} else {
inputArr.push(
<div key={index} className={styles.input}>
<Input
type={sensitive ? 'password' : isUrl ? 'url' : hasSteps ? 'number' : 'text'}
step={hasSteps ? 0.01 : undefined}
min={hasSteps ? 0.1 : undefined}
max={hasSteps ? 0.9 : undefined}
name={key}
value={valueTyped === 'string' || valueTyped === 'optionalString' ? '' : valueTyped}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setInput({...input, [keyTyped]: e.target.value})}
label={label}
placeholder={placeholder}
showLabelIcon
tooltipText={t(`inputTooltip${capitalSource}${toolTip}`)}
required={valueTyped !== 'optionalString'}
height={32}
fontClass="font-base"
/>
</div>
);
}
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const EnrichedSchemaSection = (props: EnrichedSchemaSectionProps) => {

// Use map to create an array of promises
const promises = (enrichedCode.fields || []).map(async field => {
console.log(typeof field.type);
if (typeof field.type === 'object' && !Array.isArray(field.type)) {
if (!field.type.doc) {
const doc = await generateDocForField(field);
Expand Down
15 changes: 15 additions & 0 deletions lib/typescript/assets/images/icons/anthropic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions lib/typescript/assets/images/icons/aws.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/typescript/assets/images/icons/google-ai.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions lib/typescript/assets/images/icons/groq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions lib/typescript/assets/images/icons/mistral-ai.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading