Skip to content

Commit 58fa536

Browse files
committed
Merge branch 'develop'
2 parents baa78b8 + 4874a77 commit 58fa536

File tree

58 files changed

+1432
-848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1432
-848
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- "widget/**"
1111
- "Dogefile"
1212
branches:
13-
- "master"
13+
- "production"
1414
- "develop"
1515
# - "feature/**caps**"
1616
# - "feature/**withmadrid**"

Dogefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ name: ChatFAQ
44
# for now, we share the database cluster between envs
55
databases:
66
- name: psql
7-
cluster_name: 'chatfaq-psql-{{ production("dev", default="dev") }}'
7+
cluster_name: 'chatfaq-psql-{{ production("prod", default="dev") }}'
88
db_name: "{{ deployment_key }}"
99
db_user: "{{ deployment_key }}"
1010
engine: pg
1111
version: "15"
1212
- name: redis
13-
cluster_name: 'chatfaq-redis-{{ production("dev", default="dev") }}'
13+
cluster_name: 'chatfaq-redis-{{ production("prod", default="dev") }}'
1414
engine: redis
1515
version: "7"
1616

@@ -40,14 +40,14 @@ env:
4040
OPENAI_API_KEY: '{{ secret("OPENAI_API_KEY") }}'
4141
TOGETHER_API_KEY: '{{ secret("TOGETHER_API_KEY") }}'
4242
SENTRY_DSN: '{{ secret("SENTRY_DSN_BACK") }}'
43-
USE_RAY: 'True'
44-
- name: ray_worker
45-
variables:
46-
BACKEND_HOST: "{{ back.PRIVATE_URL }}"
47-
BACKEND_TOKEN: '{{ secret("CHATFAQ_TOKEN") }}'
48-
- name: ray_build
49-
variables:
50-
INSTALL_CHAT_RAG: 'true'
43+
USE_RAY: 'False'
44+
# - name: ray_worker
45+
# variables:
46+
# BACKEND_HOST: "{{ back.PRIVATE_URL }}"
47+
# BACKEND_TOKEN: '{{ secret("CHATFAQ_TOKEN") }}'
48+
# - name: ray_build
49+
# variables:
50+
# INSTALL_CHAT_RAG: 'true'
5151
- name: widget
5252
variables:
5353
BASE_URL: "/demo"
@@ -101,7 +101,7 @@ services:
101101
envs: [ django ]
102102
port: 8000
103103
internal_ports: [8265, 6375, 9090]
104-
instance_size: M
104+
instance_size: XXS
105105
route_prefixes:
106106
- "/back"
107107

admin/assets/styles/_mixins.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
}
88

99
@mixin scroll-style($color: $chatfaq-color-scrollBar-dark) {
10+
scrollbar-color: $color transparent;
11+
scrollbar-width: thin;
12+
1013
&::-webkit-scrollbar {
1114
width: 6px;
1215
}

admin/components/ai_config/AIConfig.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
'updated_date': {'name': $t('updateddate'), 'sortable': true},
2020
}"
2121
:defaultSort="{'prop': 'name'}">
22+
<template v-slot:write-api_key="props">
23+
<SecretInput :form="props.form" fieldName="api_key" placeholder="Please input API Key"/>
24+
</template>
2225
</ReadWriteView>
2326
</el-tab-pane>
2427
<el-tab-pane v-if="$useRay" :lazy="true" :label="$t('retriever')" name="retriever-configs">
@@ -102,6 +105,7 @@ import ReadWriteView from "~/components/generic/ReadWriteView.vue";
102105
import {useItemsStore} from "~/store/items.js";
103106
import {useI18n} from "vue-i18n";
104107
import {callRetrieverReindex} from "~/utils/index.js";
108+
import SecretInput from "~/components/generic/fields/SecretInput.vue";
105109
106110
const {$axios} = useNuxtApp();
107111
const itemsStore = useItemsStore()
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<template>
2+
<el-form-item :label="$t(fieldName)"
3+
:prop="fieldName"
4+
class="secret-wrapper">
5+
<el-input
6+
v-model="form[fieldName]"
7+
:type="inputType"
8+
:placeholder="$t(placeholder)"
9+
:disabled="!editingSecret && oldEncryptedValue"
10+
show-password
11+
/>
12+
<el-button v-if="oldEncryptedValue" type="primary" @click="toggleEditingSecret">
13+
<el-icon>
14+
<EditPen v-if="!editingSecret"/>
15+
<Close v-else/>
16+
</el-icon>
17+
</el-button>
18+
</el-form-item>
19+
</template>
20+
21+
<script setup>
22+
import { ref, watch, computed } from 'vue';
23+
24+
const editingSecret = ref(false);
25+
26+
const props = defineProps({
27+
form: {
28+
type: Object,
29+
required: true,
30+
},
31+
fieldName: {
32+
type: String,
33+
required: true,
34+
},
35+
placeholder: {
36+
type: String,
37+
default: "Please input value",
38+
},
39+
inputType: {
40+
type: String,
41+
default: "password"
42+
}
43+
});
44+
45+
const oldEncryptedValue = ref();
46+
47+
watch(() => props.form, () => {
48+
oldEncryptedValue.value = props.form[props.fieldName];
49+
}, { deep: true, immediate: true });
50+
51+
52+
function toggleEditingSecret(ev) {
53+
editingSecret.value = !editingSecret.value;
54+
if (editingSecret.value) {
55+
props.form[props.fieldName] = "";
56+
} else {
57+
props.form[props.fieldName] = oldEncryptedValue.value;
58+
}
59+
ev.preventDefault();
60+
}
61+
62+
const submit = () => {
63+
if (!editingSecret.value) {
64+
delete props.form[props.fieldName];
65+
}
66+
};
67+
68+
defineExpose({
69+
submit,
70+
});
71+
72+
</script>
73+
74+
<style lang="scss">
75+
.secret-wrapper {
76+
.el-input {
77+
width: 328px;
78+
}
79+
.el-form-item__content {
80+
display: flex;
81+
width: unset !important;
82+
}
83+
}
84+
</style>
85+
86+
<style lang="scss" scoped>
87+
.secret-wrapper {
88+
button {
89+
margin-left: 8px;
90+
height: 40px;
91+
width: 40px;
92+
}
93+
}
94+
.el-form-item__content {
95+
.el-input {
96+
flex-grow: 1;
97+
width: unset !important;
98+
}
99+
}
100+
</style>

admin/components/user_management/UserManagement.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}"
3232
>
3333
<template v-slot:write-password="props">
34-
<Password :form="props.form" :fieldName="props.fieldName" ref="password"/>
34+
<SecretInput :form="props.form" fieldName="password" placeholder="Please input password"/>
3535
</template>
3636
</ReadWriteView>
3737
</el-tab-pane>
@@ -50,7 +50,7 @@
5050
<script setup>
5151
import ReadWriteView from "~/components/generic/ReadWriteView.vue";
5252
import { useItemsStore } from "~/store/items.js";
53-
import Password from "~/components/user_management/fields/Password.vue";
53+
import SecretInput from "~/components/generic/fields/SecretInput.vue";
5454
5555
const password = ref(null)
5656

admin/components/widget_config/WidgetConfig.vue

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
'fsm_def': {'name': $t('fsmdef')},
1717
}"
1818
@submitFormStart="submitMessageLayout"
19-
@initializedFormValues="initializedFormValues"
2019
:sections="{
2120
[$t('general')]: [
2221
'name',
@@ -39,9 +38,20 @@
3938
'stick_input_prompt',
4039
'fit_to_parent',
4140
'stick_input_prompt',
41+
'allow_attachments',
42+
],
43+
[$t('interfacing')]: [
4244
'speech_recognition',
45+
'speech_recognition_lang',
4346
'speech_recognition_auto_send',
44-
'allow_attachments',
47+
'speech_recognition_always_on',
48+
'speech_recognition_phrase_activation',
49+
'speech_recognition_beep',
50+
'speech_synthesis',
51+
'speech_synthesis_pitch',
52+
'speech_synthesis_rate',
53+
'speech_synthesis_voices',
54+
'speech_synthesis_enabled_by_default'
4555
],
4656
[$t('advanced')]: [
4757
'custom_css',
@@ -159,20 +169,6 @@ await itemsStore.loadSchema()
159169
function submitFieldData() {
160170
fieldData.value.submit()
161171
}
162-
function initializedFormValues(form) {
163-
if(form.custom_i_framed_msgs)
164-
form.custom_i_framed_msgs = JSON.stringify(form.custom_i_framed_msgs, null, 4)
165-
if(form.initial_conversation_metadata)
166-
form.initial_conversation_metadata = JSON.stringify(form.initial_conversation_metadata, null, 4)
167-
// displayingOrder.value = form.sources_first
168-
// elementsShown.value = form.display_generation.toString()[0] + form.display_sources.toString()[0]
169-
}
170-
function submitMessageLayout(_, form) {
171-
return
172-
form.display_generation = elementsShown.value[0] === 't'
173-
form.display_sources = elementsShown.value[1] === 't'
174-
form.sources_first = displayingOrder.value
175-
}
176172
177173
function getCss(formObj) {
178174
let css = ":root {";

admin/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,5 +301,6 @@
301301
"sourcesfirst": "Sources First",
302302
"messagelayout": "Message Layout",
303303
"close": "Close",
304-
"withuserfeedback": "With User Feedback"
304+
"withuserfeedback": "With User Feedback",
305+
"api_key": "API Key"
305306
}

admin/locales/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,6 @@
299299
"sourcesfirst": "Fuentes Primero",
300300
"messagelayout": "Diseño de Mensaje",
301301
"close": "Cerrar",
302-
"withuserfeedback": "Con comentario de Usuario"
302+
"withuserfeedback": "Con comentario de Usuario",
303+
"api_key": "API Key"
303304
}

admin/locales/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,6 @@
299299
"sourcesfirst": "Sources en premier",
300300
"messagelayout": "Mise en page du message",
301301
"close": "Fermer",
302-
"withuserfeedback": "Avec le commentaire de l'utilisateur"
302+
"withuserfeedback": "Avec le commentaire de l'utilisateur",
303+
"api_key": "API Key"
303304
}

0 commit comments

Comments
 (0)