Skip to content

Commit 45132f9

Browse files
erangi-arThirunayan22erangi-arnuwangeek
authored
UI bug fixes (buerokratt#219)
* updated docker compose ec2 * integrate streaming endpoint with test prodction connection page * formatted response with markdown * fe logic for the encryption * vault secret update after fixing issues * fixed formatting issue * integration with be * update cron manager vault script * tested integration of vault security update * fix security issues * creation success model changes * clean vite config generated files * fixed issue references are not sending with streming tokens * complete #192 and buerokratt#206 bug fixes * production inference display logic change * change production inference display logic * fixed requested issue * Refactor Docker Compose configuration for vault agents and update CSP settings * Remove obsolete Vite configuration files and associated plugins * bug fixes --------- Co-authored-by: Thiru Dinesh <56014038+Thirunayan22@users.noreply.github.com> Co-authored-by: Thiru Dinesh <thiru.dinesh@rootcodelabs.com> Co-authored-by: erangi-ar <erangika.ariyasena@rootcode.io> Co-authored-by: nuwangeek <charith.bimsara@rootcode.io> Co-authored-by: Charith Nuwan Bimsara <59943919+nuwangeek@users.noreply.github.com>
1 parent 1b28136 commit 45132f9

10 files changed

Lines changed: 202 additions & 150 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ venv/
3636
ENV/
3737
env.bak/
3838
venv.bak/
39+
myenv/
3940

4041
# IDE
4142
.vscode/

DSL/Ruuter.private/rag-search/POST/llm-connections/edit.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,38 @@ check_connection_exists:
119119
validate_connection_exists:
120120
switch:
121121
- condition: "${existing_connection.response.body.length > 0}"
122-
next: update_llm_connection
122+
next: check_deployment_environment
123123
next: return_not_found
124124

125+
check_deployment_environment:
126+
switch:
127+
- condition: ${environment == "production" && existing_connection.response.body[0].environment == "testing"}
128+
next: get_existing_production_connection
129+
next: update_llm_connection
130+
131+
get_existing_production_connection:
132+
call: http.post
133+
args:
134+
url: "[#RAG_SEARCH_RESQL]/get-production-connection"
135+
result: existing_production_result
136+
next: update_existing_production_to_testing
137+
138+
update_existing_production_to_testing:
139+
switch:
140+
- condition: ${existing_production_result.response.body && existing_production_result.response.body.length > 0}
141+
next: update_production_connection
142+
next: update_llm_connection
143+
144+
update_production_connection:
145+
call: http.post
146+
args:
147+
url: "[#RAG_SEARCH_RESQL]/update-llm-connection-environment"
148+
body:
149+
connection_id: ${existing_production_result.response.body[0].id}
150+
environment: "testing"
151+
result: update_result
152+
next: update_llm_connection
153+
125154
update_llm_connection:
126155
call: http.post
127156
args:
@@ -169,4 +198,4 @@ return_invalid_environment:
169198
return_unauthorized:
170199
status: 401
171200
return: "error: unauthorized"
172-
next: end
201+
next: end

GUI/src/components/FormElements/FormSelect/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ const FormSelect = forwardRef<HTMLSelectElement, FormSelectProps>(
8787
itemToString,
8888
selectedItem,
8989
onSelectedItemChange: ({ selectedItem: newSelectedItem }) => {
90-
setSelectedItem(newSelectedItem ?? null);
91-
if (onSelectionChange) onSelectionChange(newSelectedItem ?? null);
90+
if (!disabled) {
91+
setSelectedItem(newSelectedItem ?? null);
92+
if (onSelectionChange) onSelectionChange(newSelectedItem ?? null);
93+
}
9294
},
9395
});
9496

@@ -109,7 +111,7 @@ const FormSelect = forwardRef<HTMLSelectElement, FormSelectProps>(
109111
className={`select__trigger ${
110112
error ? `select__error` : `select__default`
111113
}`}
112-
{...getToggleButtonProps()}
114+
{...getToggleButtonProps({ disabled })}
113115
>
114116
{selectedItem?.label ?? placeholderValue}
115117
<Icon
@@ -145,4 +147,4 @@ const FormSelect = forwardRef<HTMLSelectElement, FormSelectProps>(
145147
}
146148
);
147149

148-
export default FormSelect;
150+
export default FormSelect;

GUI/src/components/molecules/LLMConnectionForm/LLMConnectionForm.scss

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,16 @@
115115
}
116116

117117
.flex-grid {
118-
119118
flex-wrap: wrap;
120119
gap: 8px;
121120
justify-content: flex-end;
122121

123122
button {
124-
flex: 0 1 auto;
125-
126-
min-width: 60px;
127-
max-width: calc(50% - 4px);
128-
padding: 8px 12px;
129-
font-size: 13px;
123+
flex: 1 1 auto;
124+
padding: 6px 8px;
125+
font-size: 12px;
126+
display: inline-flex;
127+
justify-content: center;
130128
}
131129
}
132130
}
@@ -154,12 +152,14 @@
154152
}
155153

156154
.flex-grid {
157-
flex-direction: column-reverse;
155+
flex-direction: column;
158156
gap: 12px;
159157

160158
button {
161-
width: 100%;
162-
min-width: unset;
159+
flex: 0 1 auto;
160+
display: inline-flex;
161+
justify-content: center;
162+
padding: 8px 20px;
163163
}
164164
}
165165
}
@@ -172,9 +172,7 @@
172172
button {
173173
flex: 1 1 auto;
174174
min-width: 70px;
175-
max-width: 200px;
176-
font-size: 14px;
177-
padding: 8px 12px;
175+
padding: 8px 16px;
178176
}
179177
}
180178
}

GUI/src/components/molecules/LLMConnectionForm/index.tsx

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
200200
<Controller
201201
name="accessKey"
202202
control={control}
203-
rules={{ required: t('llmConnectionForm.validationMessages.accessKeyRequiredAws') || 'Access Key is required for AWS Bedrock' }}
203+
rules={{
204+
required: t('llmConnectionForm.validationMessages.accessKeyRequiredAws') || 'Access Key is required for AWS Bedrock',
205+
pattern: {
206+
value: /^\S+$/,
207+
message: t('llmConnectionForm.validationMessages.invalidAccessKey') || 'Access Key cannot contain spaces'
208+
}
209+
}}
204210
render={({ field }) => (
205211
<FormInput
206212
label=""
@@ -225,7 +231,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
225231
<Controller
226232
name="secretKey"
227233
control={control}
228-
rules={{ required: t('llmConnectionForm.validationMessages.secretKeyRequiredAws') || 'Secret Key is required for AWS Bedrock' }}
234+
rules={{
235+
required: t('llmConnectionForm.validationMessages.secretKeyRequiredAws') || 'Secret Key is required for AWS Bedrock',
236+
pattern: {
237+
value: /^\S+$/,
238+
message: t('llmConnectionForm.validationMessages.invalidSecretKey') || 'Secret Key cannot contain spaces'
239+
}
240+
}}
229241
render={({ field }) => (
230242
<FormInput
231243
label=""
@@ -296,7 +308,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
296308
<Controller
297309
name="apiKey"
298310
control={control}
299-
rules={{ required: t('llmConnectionForm.validationMessages.apiKeyRequiredAzure') || 'API Key is required for Azure OpenAI' }}
311+
rules={{
312+
required: t('llmConnectionForm.validationMessages.apiKeyRequiredAzure') || 'API Key is required for Azure OpenAI',
313+
pattern: {
314+
value: /^\S+$/,
315+
message: t('llmConnectionForm.validationMessages.invalidApiKey') || 'API Key cannot contain spaces'
316+
}
317+
}}
300318
render={({ field }) => (
301319
<FormInput
302320
label=""
@@ -319,26 +337,7 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
319337
);
320338

321339
default:
322-
return (
323-
<div className="form-row">
324-
<p className='form-label'>{t('llmConnectionForm.generic.llmApiKey.label') || 'LLM API Key'}</p>
325-
<p className='form-description'>{t('llmConnectionForm.generic.llmApiKey.description') || 'The API key of the LLM model'}</p>
326-
<Controller
327-
name="apiKey"
328-
control={control}
329-
rules={{ required: t('llmConnectionForm.validationMessages.llmApiKeyRequired') || 'LLM API Key is required' }}
330-
render={({ field }) => (
331-
<FormInput
332-
label=""
333-
type={isEditing ? 'text' : 'password'}
334-
placeholder={t('llmConnectionForm.generic.llmApiKey.placeholder') || "Enter your LLM API key"}
335-
error={errors.apiKey?.message}
336-
{...field}
337-
/>
338-
)}
339-
/>
340-
</div>
341-
);
340+
return null;
342341
}
343342
};
344343

@@ -353,7 +352,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
353352
<Controller
354353
name="embeddingAccessKey"
355354
control={control}
356-
rules={{ required: t('llmConnectionForm.validationMessages.embeddingAccessKeyRequiredAws') || 'Embedding Access Key is required for AWS Bedrock' }}
355+
rules={{
356+
required: t('llmConnectionForm.validationMessages.embeddingAccessKeyRequiredAws') || 'Embedding Access Key is required for AWS Bedrock',
357+
pattern: {
358+
value: /^\S+$/,
359+
message: t('llmConnectionForm.validationMessages.invalidEmbeddingAccessKey') || 'Embedding Access Key cannot contain spaces'
360+
}
361+
}}
357362
render={({ field }) => (
358363
<FormInput
359364
label=""
@@ -378,7 +383,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
378383
<Controller
379384
name="embeddingSecretKey"
380385
control={control}
381-
rules={{ required: t('llmConnectionForm.validationMessages.embeddingSecretKeyRequiredAws') || 'Embedding Secret Key is required for AWS Bedrock' }}
386+
rules={{
387+
required: t('llmConnectionForm.validationMessages.embeddingSecretKeyRequiredAws') || 'Embedding Secret Key is required for AWS Bedrock',
388+
pattern: {
389+
value: /^\S+$/,
390+
message: t('llmConnectionForm.validationMessages.invalidEmbeddingSecretKey') || 'Embedding Secret Key cannot contain spaces'
391+
}
392+
}}
382393
render={({ field }) => (
383394
<FormInput
384395
label=""
@@ -448,7 +459,13 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
448459
<Controller
449460
name="embeddingAzureApiKey"
450461
control={control}
451-
rules={{ required: t('llmConnectionForm.validationMessages.embeddingApiKeyRequiredAzure') || 'Embedding API Key is required for Azure OpenAI' }}
462+
rules={{
463+
required: t('llmConnectionForm.validationMessages.embeddingApiKeyRequiredAzure') || 'Embedding API Key is required for Azure OpenAI',
464+
pattern: {
465+
value: /^\S+$/,
466+
message: t('llmConnectionForm.validationMessages.invalidEmbeddingApiKey') || 'Embedding API Key cannot contain spaces'
467+
}
468+
}}
452469
render={({ field }) => (
453470
<FormInput
454471
label=""
@@ -471,33 +488,7 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
471488
);
472489

473490
default:
474-
return (
475-
<div className="form-row">
476-
<p className='form-label'>{t('llmConnectionForm.generic.embeddingApiKey.label') || 'Embedding Model API Key'}</p>
477-
<p className='form-description'>{t('llmConnectionForm.generic.embeddingApiKey.description') || 'API key of your embedding model'}</p>
478-
<Controller
479-
name="embeddingModelApiKey"
480-
control={control}
481-
rules={{ required: t('llmConnectionForm.validationMessages.embeddingApiKeyRequired') || 'Embedding API Key is required' }}
482-
render={({ field }) => (
483-
<FormInput
484-
label=""
485-
type={isEditing ? 'text' : 'password'}
486-
placeholder={t('llmConnectionForm.generic.embeddingApiKey.placeholder') || "Enter your Embedding API key"}
487-
error={errors.embeddingModelApiKey?.message}
488-
readOnly={embeddingApiKeyReplaceMode}
489-
showEndButton={embeddingApiKeyReplaceMode}
490-
onEndButtonClick={() => {
491-
setEmbeddingApiKeyReplaceMode(false);
492-
setValue('embeddingModelApiKey', '');
493-
}}
494-
endButtonText={t('global.change') || "Change"}
495-
{...field}
496-
/>
497-
)}
498-
/>
499-
</div>
500-
);
491+
return null;
501492
}
502493
};
503494

@@ -523,13 +514,20 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
523514
<Controller
524515
name="connectionName"
525516
control={control}
526-
rules={{ required: t('llmConnectionForm.validationMessages.connectionNameRequired') || 'Connection Name is required' }}
517+
rules={{
518+
required: t('llmConnectionForm.validationMessages.connectionNameRequired') || 'Connection Name is required',
519+
maxLength: {
520+
value: 100,
521+
message: t('llmConnectionForm.validationMessages.connectionNameMaxLength') || 'Connection Name must not exceed 100 characters'
522+
}
523+
}}
527524
render={({ field }) => (
528525
<FormInput
529526
label=""
530527
placeholder={t('llmConnectionForm.fields.connectionName.placeholder') || "Enter connection name (e.g., Azure GPT-4 Production)"}
531528
error={errors.connectionName?.message}
532529
disabled={readOnly}
530+
//maxLength={100}
533531
{...field}
534532
/>
535533
)}
@@ -881,4 +879,4 @@ const embeddingModelOptions = toOptions(embeddingModelsData);
881879
);
882880
};
883881

884-
export default LLMConnectionForm;
882+
export default LLMConnectionForm;

0 commit comments

Comments
 (0)