code7-leia 0.2.25 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code7-leia.cjs.development.js +12 -12
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +12 -12
- package/dist/code7-leia.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Select/styles.tsx +1 -0
- package/src/components/TestArea/styles.tsx +3 -1
- package/src/contexts/SharedPropsProvider.tsx +2 -2
- package/src/store/modules/sagas.ts +8 -8
package/package.json
CHANGED
|
@@ -59,9 +59,11 @@ export const Header = styled.div`
|
|
|
59
59
|
`
|
|
60
60
|
|
|
61
61
|
export const Inputs = styled.div`
|
|
62
|
-
display: inline-flex
|
|
62
|
+
display: inline-flex;
|
|
63
63
|
justify-content: space-between;
|
|
64
64
|
margin-bottom: 10px;
|
|
65
|
+
width: 725px;
|
|
66
|
+
margin-right: 500px;
|
|
65
67
|
|
|
66
68
|
button {
|
|
67
69
|
background: #102693;
|
|
@@ -34,7 +34,7 @@ export const SharedPropsProvider: React.FC<Props> = ({ children, ...props }) =>
|
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
const fetchData = async () => {
|
|
36
36
|
try {
|
|
37
|
-
const { data } = env.toLowerCase() === '
|
|
37
|
+
const { data } = env.toLowerCase() === 'dev' ? await api.get(`/tags/${id}`) : await apiHml.get(`/tags/${id}`);
|
|
38
38
|
|
|
39
39
|
if (data) {
|
|
40
40
|
setTags(data);
|
|
@@ -48,7 +48,7 @@ export const SharedPropsProvider: React.FC<Props> = ({ children, ...props }) =>
|
|
|
48
48
|
|
|
49
49
|
const personas = async () => {
|
|
50
50
|
try {
|
|
51
|
-
const { data } = env.toLowerCase() === '
|
|
51
|
+
const { data } = env.toLowerCase() === 'dev' ? await api.get(`/personas?language=${language}`) : await apiHml.get(`/personas?language=${language}`);
|
|
52
52
|
|
|
53
53
|
if (data) {
|
|
54
54
|
setPersonas(data);
|
|
@@ -15,7 +15,7 @@ export function* getFilesSaga(action: any) {
|
|
|
15
15
|
try {
|
|
16
16
|
yield put(commonLoadingStart());
|
|
17
17
|
const { id, token, env } = action.payload
|
|
18
|
-
const { data } = yield call(env.toLowerCase() === '
|
|
18
|
+
const { data } = yield call(env.toLowerCase() === 'dev' ? api.get : apiHml.get, `/training/${id}?token=${token}`);
|
|
19
19
|
yield put(getFilesActionSuccess({ files: data.files}));
|
|
20
20
|
} catch (error) {
|
|
21
21
|
console.log('-----------getFiles.error------------------->', error);
|
|
@@ -30,8 +30,8 @@ export function* deleteFilesSaga(action: any) {
|
|
|
30
30
|
yield put(commonLoadingStart());
|
|
31
31
|
const { id, name, token, env } = action.payload
|
|
32
32
|
|
|
33
|
-
yield call(env.toLowerCase() === '
|
|
34
|
-
const { data } = yield call(env.toLowerCase() === '
|
|
33
|
+
yield call(env.toLowerCase() === 'dev' ? api.delete : apiHml.delete, `/delete/${id}/${name}?token=${token}`);
|
|
34
|
+
const { data } = yield call(env.toLowerCase() === 'dev' ? api.get : apiHml.get, `/training/${id}?token=${token}`);
|
|
35
35
|
yield put(deleteFilesActionSuccess({ files: data.files, success: true }));
|
|
36
36
|
} catch (error) {
|
|
37
37
|
toast.error({title: t.toast.deleteFile.fail.title, description: t.toast.deleteFile.fail.description});
|
|
@@ -45,7 +45,7 @@ export function* testSaga(action: any) {
|
|
|
45
45
|
try {
|
|
46
46
|
yield put(commonLoadingStart());
|
|
47
47
|
const { question, prompt, profile, presset, files_directory, token, env } = action.payload
|
|
48
|
-
const { data } = yield call(env.toLowerCase() === '
|
|
48
|
+
const { data } = yield call(env.toLowerCase() === 'dev' ? api.post : apiHml.post, `/ask`, { question, description: prompt, profile, tag: presset, files_directory, token });
|
|
49
49
|
yield put(testActionSuccess({ message: data.message }));
|
|
50
50
|
} catch (error) {
|
|
51
51
|
console.log('-----------testSaga.error------------------->', error);
|
|
@@ -73,13 +73,13 @@ export function* uploadFilesSaga(action: any) {
|
|
|
73
73
|
? `/upload/${id}?token=${token}&${queryParams}`
|
|
74
74
|
: `/upload/${id}?token=${token}`;
|
|
75
75
|
|
|
76
|
-
yield call(env.toLowerCase() === '
|
|
76
|
+
yield call(env.toLowerCase() === 'dev' ? api.post : apiHml.post, url, formData, {
|
|
77
77
|
headers: {
|
|
78
78
|
'Content-Type': 'multipart/form-data',
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
const { data } = yield call(env.toLowerCase() === '
|
|
82
|
+
const { data } = yield call(env.toLowerCase() === 'dev' ? api.get : apiHml.get, `/training/${id}?token=${token}`);
|
|
83
83
|
yield put(uploadFilesActionSuccess({ files: data.files }));
|
|
84
84
|
} catch (error) {
|
|
85
85
|
toast.error({
|
|
@@ -102,9 +102,9 @@ export function* TrainingSaga(action: any) {
|
|
|
102
102
|
|
|
103
103
|
const queryParams = new URLSearchParams({ tag }).toString();
|
|
104
104
|
|
|
105
|
-
yield call(env.toLowerCase() === '
|
|
105
|
+
yield call(env.toLowerCase() === 'dev' ? api.post : apiHml.post, pressets.length > 0 ? `/training?${queryParams}` : `/training`,{ files_directory: id, token });
|
|
106
106
|
|
|
107
|
-
const { data } = yield call(env.toLowerCase() === '
|
|
107
|
+
const { data } = yield call(env.toLowerCase() === 'dev' ? api.get : apiHml.get, `/training/${id}?token=${token}`);
|
|
108
108
|
yield put(uploadFilesActionSuccess({ files: data.files }));
|
|
109
109
|
toast.success({title: t.toast.Train.success.title, description: t.toast.Train.success.description});
|
|
110
110
|
} catch (error) {
|