Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorAlgorta committed Jan 8, 2024
1 parent a6eea4b commit 39d5852
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
4 changes: 1 addition & 3 deletions frontend/control-center/src/pages/LLMConsumers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ const LLMConsumers = (props: LLMConsumersProps) => {
const {topics, getSchemas} = props;

const [consumers, setConsumers] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [errorOccurred, setErrorOccurred] = useState(false);
const [notification, setNotification] = useState<NotificationModel>(null);
const [dataFetched, setDataFetched] = useState(false);
const [showSettingsModal, setShowSettingsModal] = useState(false);
Expand All @@ -57,7 +55,6 @@ const LLMConsumers = (props: LLMConsumersProps) => {
.then((response: any) => {
setConsumers(response);
setDataFetched(true);
setIsLoading(false);
})
.catch(() => {
handleNotification(true);
Expand Down Expand Up @@ -200,6 +197,7 @@ const LLMConsumers = (props: LLMConsumersProps) => {
</div>
{notification?.show && (
<NotificationComponent
key={'notificationKey'}
show={notification.show}
successful={notification.successful}
text={notification.text}
Expand Down
11 changes: 2 additions & 9 deletions frontend/control-center/src/pages/LLMs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import React, {useEffect, useState} from 'react';
import {NotificationComponent} from 'components';
import {SettingsModal} from 'components/alerts/SettingsModal';
import {Button} from 'components/cta/Button';
import {Webhook} from 'model/Webhook';
import {useTranslation} from 'react-i18next';
import {connect, ConnectedProps} from 'react-redux';
import {StateModel} from '../../reducers';
import {setPageTitle} from '../../services/pageTitle';
import {NotificationModel} from 'model';
import {AiryLoader} from 'components/loaders/AiryLoader';
import styles from './index.module.scss';
import {EmptyState} from './EmptyState';
import {HttpClientInstance} from '../../httpClient';
import {LLMInfoPayload, LLMSStatsPayload} from 'httpclient/src';
import {LLMSStatsPayload} from 'httpclient/src';
import {LLMInfoItem} from './LLMInfoItem';

type LLMsProps = {} & ConnectedProps<typeof connector>;
Expand All @@ -24,8 +20,6 @@ const connector = connect(null, mapDispatchToProps);
const LLMs = (props: LLMsProps) => {
const [llms, setLlms] = useState([]);
const [embeddings, setEmbeddings] = useState(0);
const [isLoading, setIsLoading] = useState(false);
const [errorOccurred, setErrorOccurred] = useState(false);
const [notification, setNotification] = useState<NotificationModel>(null);
const [dataFetched, setDataFetched] = useState(false);
const {t} = useTranslation();
Expand All @@ -35,12 +29,10 @@ const LLMs = (props: LLMsProps) => {
}, []);

useEffect(() => {
setIsLoading(true);
HttpClientInstance.getLLMInfo()
.then((response: any) => {
setLlms(response);
setDataFetched(true);
setIsLoading(false);
})
.catch(() => {
handleNotification(true);
Expand Down Expand Up @@ -83,6 +75,7 @@ const LLMs = (props: LLMsProps) => {
<div className={styles.embeddingsSection}>Embeddings: {embeddings}</div>
{notification?.show && (
<NotificationComponent
key={'notificationKey'}
show={notification.show}
successful={notification.successful}
text={notification.text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const EnrichedSchemaSection = (props: EnrichedSchemaSectionProps) => {
};

const recalculateContainerHeight = (code: string) => {
let basicHeight = 220;
const basicHeight = 220;
if (wrapperSection && wrapperSection.current) {
wrapperSection.current.style.height = `${calculateHeightOfCodeString(code) + basicHeight}px`;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const SchemaSection = (props: SchemaSectionProps) => {
};

const recalculateContainerHeight = (code: string) => {
let basicHeight = 220;
const basicHeight = 220;
if (wrapperSection && wrapperSection.current) {
wrapperSection.current.style.height = `${calculateHeightOfCodeString(code) + basicHeight}px`;
} else {
Expand Down

0 comments on commit 39d5852

Please sign in to comment.