code7-leia 0.1.175 → 0.1.177

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.
@@ -6,4 +6,5 @@ export interface FileData {
6
6
  name: string;
7
7
  tags: [tag];
8
8
  trained: boolean;
9
+ link: string;
9
10
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.175",
2
+ "version": "0.1.177",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -2,7 +2,7 @@ import React, { useEffect, useState} from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
3
  import { renderToString } from 'react-dom/server';
4
4
 
5
- import { FaUpload, FaList, FaPlus, FaCheck } from 'react-icons/fa';
5
+ import { FaUpload, FaList, FaPlus, FaCheck, FaFile } from 'react-icons/fa';
6
6
  import { GiWeightLiftingUp } from "react-icons/gi";
7
7
  import { TiDelete } from "react-icons/ti";
8
8
 
@@ -125,6 +125,14 @@ export const FileArea = () => {
125
125
  setPresset([])
126
126
  };
127
127
 
128
+ const viewFile = (link: string) => {
129
+ if(link){
130
+ const checkIcon = renderToString(<FaFile size={14} />);
131
+ return `<a href='${link}' target='_blank'>${checkIcon}</a>`;
132
+ }
133
+ return null
134
+ };
135
+
128
136
  const renderFiles = () => {
129
137
  return (
130
138
  <S.Container isloading={isloading}>
@@ -174,7 +182,7 @@ export const FileArea = () => {
174
182
  <tbody>
175
183
  {files.map((object) => (
176
184
  <tr>
177
- <td>{object.name}</td>
185
+ <td> {viewFile(object.link)} {object.name}</td>
178
186
  <td>{object.trained ? <FaCheck size={14} style={{ color: 'green' }} /> : <TiDelete size={14} style={{ color: 'red' }} />}</td>
179
187
  <td className='tags' dangerouslySetInnerHTML={{ __html: pressetTag(object.tags) }} />
180
188
  <td>
@@ -67,7 +67,7 @@ export const SelectedValues = styled.div`
67
67
  `;
68
68
 
69
69
  export const SelectedValue = styled.div`
70
- background-color: #6690ff;
70
+ background-color: #254EDB;
71
71
  color: white;
72
72
  border-radius: 15px;
73
73
  padding: 5px 10px;
@@ -7,4 +7,5 @@ export interface FileData {
7
7
  name: string,
8
8
  tags: [tag]
9
9
  trained: boolean,
10
+ link: string,
10
11
  }
@@ -92,7 +92,7 @@ export function* TrainingSaga(action: any) {
92
92
 
93
93
  const queryParams = new URLSearchParams({ tag }).toString();
94
94
 
95
- yield call(api.post, `/training?${queryParams}`,{ files_directory: id });
95
+ yield call(api.post, pressets.length > 0 ? `/training?${queryParams}` : `/training`,{ files_directory: id });
96
96
 
97
97
  const { data } = yield call(api.get, `/training/${id}`);
98
98
  yield put(uploadFilesActionSuccess({ files: data.files }));