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 5cadc84 commit a6eea4b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,7 @@ const ConnectorWrapper = (props: ConnectorWrapperProps) => {
<div className={styles.componentTitle}>
<h1 className={styles.headlineText}>{connectorInfo && connectorInfo?.displayName}</h1>
<ConfigStatusButton
// REMOVE THIS. TEMPORARY FIX FOR LLM CONNECTOR
componentStatus={
connectorInfo?.name === 'llm-connector'
? getComponentStatus(isHealthy, isInstalled, isConfigured, isEnabled)
: getComponentStatus(true, true, true, true)
}
componentStatus={getComponentStatus(isHealthy, isInstalled, isConfigured, isEnabled)}
customStyle={styles.configStatusButton}
/>
</div>
Expand All @@ -209,14 +204,7 @@ const ConnectorWrapper = (props: ConnectorWrapperProps) => {
</div>
{isConfigured && (
<SmartButton
// REMOVE THIS. TEMPORARY FIX FOR LLM CONNECTOR
title={
connectorInfo?.name !== 'llm-connector'
? t('disableComponent')
: isEnabled
? t('disableComponent')
: t('enableComponent')
}
title={isEnabled ? t('disableComponent') : t('enableComponent')}
height={40}
width={132}
pending={isPending}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,18 @@ const TopicDescription = (props: TopicDescriptionProps) => {
} else {
wrapperSection.current.style.height = `${basicHeight}px`;
}
if ((wrapperSection.current.style.height.replace('px', '') as number) > 700) {
wrapperSection.current.style.height = '640px';
}
}
};

const recalculateCodeHeight = (code: string) => {
const codeHeight = calculateHeightOfCodeString(code);
if (codeHeight > 478) {
return 478;
}
return codeHeight;
};

const calculateRetentionTime = (_jsonCode): string => {
Expand Down Expand Up @@ -87,7 +98,7 @@ const TopicDescription = (props: TopicDescriptionProps) => {
</div>
{expanded && (
<MonacoEditor
height={calculateHeightOfCodeString(code)}
height={recalculateCodeHeight(code)}
language="yaml"
value={code}
options={{
Expand Down
2 changes: 1 addition & 1 deletion frontend/control-center/src/pages/Topics/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

h2:first-of-type {
width: 90%;
width: 100%;
padding-left: 70px;
margin-right: 70px;
}
Expand Down
19 changes: 0 additions & 19 deletions frontend/control-center/src/selectors/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ export const getMergedConnectors = createSelector(
connectedChannels: connectedChannels,
};

//REMOVE THIS. TESTING ONLY
if (name === 'llm-controller') {
structuredCatalog = {
...structuredCatalog,
isConfigured: true,
isHealthy: true,
isEnabled: true,
};
}

if (isApp) {
structuredCatalog = {
...structuredCatalog,
Expand All @@ -88,15 +78,6 @@ export const getMergedConnectors = createSelector(
isConfigured: isConfigured,
};

//REMOVE THIS. TESTING ONLY
if (connector[0] === 'llm-controller') {
structuredCatalog = {
name: connector[0],
configureValues: connector[1],
isConfigured: true,
};
}

connectorsList[structuredConnector.name] = structuredConnector;
});

Expand Down
35 changes: 0 additions & 35 deletions lib/typescript/model/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,13 @@ export enum Language {

export const getComponents = (config: Config) => {
const {services} = config;

// REMOVE THIS. TESTING ONLY
services['faiss'] = {
enabled: true,
healthy: true,
component: 'faiss',
};

services['faiss-connector'] = {
enabled: true,
healthy: true,
component: 'faiss-connector',
};

services['openai-connector'] = {
enabled: true,
healthy: true,
component: 'openai-connector',
};

const servicesSorted = Object.fromEntries(
Object.entries(services).sort((a, b) => a[1].component.localeCompare(b[1].component))
);

return Object.keys(servicesSorted).reduce((agg, key) => {
const {healthy, enabled, component} = services[key];

// REMOVE THIS. TESTING ONLY
if (key === 'frontend-copilot') {
return {
...agg,
[component]: {
enabled,
// A component is only healthy if all its services are healthy
healthy: true,
services: agg[component]
? [...agg[component].services, {name: key, healthy: true}]
: [{name: key, healthy: true}],
},
};
}

return {
...agg,
[component]: {
Expand Down

0 comments on commit a6eea4b

Please sign in to comment.