Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 24f915ee55 | |||
| 5da67c4c06 | |||
| a21eaa40f2 | |||
| a00e40dbe9 | |||
| fa51914987 | |||
| c8d40c1630 | |||
| f673fe99ef |
@@ -544,6 +544,7 @@ function ActiveJobs(props) {
|
|||||||
<AttachFile
|
<AttachFile
|
||||||
data={props.details}
|
data={props.details}
|
||||||
showOnData={true}
|
showOnData={true}
|
||||||
|
fontSize={'text-lg'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between items-center gap-5">
|
<div className="flex justify-between items-center gap-5">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import axios from 'axios'
|
|||||||
|
|
||||||
import usersService from '../../services/UsersService'
|
import usersService from '../../services/UsersService'
|
||||||
|
|
||||||
export default function AttachFile({data='', showOnData=false}) {
|
export default function AttachFile({data='', fontSize='text-sm', showOnData=false}) {
|
||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
axios.post(`${process.env.REACT_APP_MEDIA_LINK}/upload/task`,formData).then(res => {
|
axios.post(`${process.env.REACT_APP_MEDIA_LINK}/upload/task`,formData).then(res => {
|
||||||
if(res.data.status < 1){
|
if(res.data.internal_return < 0){
|
||||||
inputFile.current.value = null
|
inputFile.current.value = null
|
||||||
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
@@ -84,10 +84,10 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
<span className={`text-[10px] ${requestStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{requestStatus.message}</span>
|
<span className={`text-[10px] ${requestStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{requestStatus.message}</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<label htmlFor='file' className={`dark:text-white cursor-pointer text-[12px] py-1 px-2 rounded-full border ${ requestStatus.loading && 'pointer-events-none'}`}>+ Add</label>
|
<label htmlFor='file' className={`text-black bg-[#f8ffd4] cursor-pointer text-[12px] py-1 px-2 rounded-full border ${ requestStatus.loading && 'pointer-events-none'}`}>+ Add Files</label>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
<div className='text-[12px] w-full h-20 overflow-y-auto flex flex-col gap-1'>
|
<div className='text-[12px] w-full h-20 overflow-y-auto flex flex-col gap-2'>
|
||||||
{uploadedList.loading ?
|
{uploadedList.loading ?
|
||||||
<div className='w-full h-full justify-center items-center'>
|
<div className='w-full h-full justify-center items-center'>
|
||||||
<LoadingSpinner size='6' height='h-full' />
|
<LoadingSpinner size='6' height='h-full' />
|
||||||
@@ -98,7 +98,7 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
uploadedList.data.result_list.map((item, index) => {
|
uploadedList.data.result_list.map((item, index) => {
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
return(
|
return(
|
||||||
<div key={item.file_uid} className='text-sm my-1 flex justify-start gap-2'>
|
<div key={item.file_uid} className={`my-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
<span>{index + 1}:</span>
|
<span>{index + 1}:</span>
|
||||||
<a
|
<a
|
||||||
target='_blank'
|
target='_blank'
|
||||||
@@ -136,11 +136,11 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-1'>
|
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-2'>
|
||||||
{uploadedList.data.result_list.map((item, index) => {
|
{uploadedList.data.result_list.map((item, index) => {
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
return(
|
return(
|
||||||
<div key={item.file_uid} className='flex justify-start gap-2'>
|
<div key={item.file_uid} className={`my-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
<span>{index + 1}:</span>
|
<span>{index + 1}:</span>
|
||||||
<a
|
<a
|
||||||
target='_blank'
|
target='_blank'
|
||||||
|
|||||||
Reference in New Issue
Block a user