-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: async parser workers (#3834) --------- Co-authored-by: Anoop M D <[email protected]>
- Loading branch information
Showing
35 changed files
with
962 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/bruno-app/src/components/CollectionSettings/Overview/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledWrapper = styled.div` | ||
.partial { | ||
color: ${(props) => props.theme.colors.text.yellow}; | ||
opacity: 0.8; | ||
} | ||
.loading { | ||
color: ${(props) => props.theme.colors.text.muted}; | ||
opacity: 0.8; | ||
} | ||
.completed { | ||
color: ${(props) => props.theme.colors.text.green}; | ||
opacity: 0.8; | ||
} | ||
.failed { | ||
color: ${(props) => props.theme.colors.text.danger}; | ||
opacity: 0.8; | ||
} | ||
`; | ||
|
||
export default StyledWrapper; |
63 changes: 63 additions & 0 deletions
63
packages/bruno-app/src/components/CollectionSettings/Overview/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { flattenItems } from "utils/collections/index"; | ||
import StyledWrapper from "./StyledWrapper"; | ||
import Docs from "../Docs/index"; | ||
import Info from "../Info/index"; | ||
|
||
const Overview = ({ collection }) => { | ||
const flattenedItems = flattenItems(collection.items); | ||
const itemsFailedLoading = flattenedItems?.filter(item => item?.partial && !item?.loading); | ||
return ( | ||
<StyledWrapper className="flex flex-col h-full relative px-4 py-4 gap-4"> | ||
<div className="flex flex-row grid grid-cols-5 w-full gap-8"> | ||
<div className="col-span-2 flex flex-col gap-12"> | ||
<Info collection={collection} /> | ||
{ | ||
itemsFailedLoading?.length ? | ||
<div className="w-full border border-opacity-50 border-yellow-500 rounded-md"> | ||
<div className="my-2 mx-2 pb-2 font-medium"> | ||
Following requests were not loaded | ||
</div> | ||
<table className="w-full border-collapse mt-2"> | ||
<thead> | ||
<tr> | ||
<td> | ||
<div className="ml-2"> | ||
Pathname | ||
</div> | ||
</td> | ||
<td> | ||
<div className="ml-2"> | ||
Size | ||
</div> | ||
</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{flattenedItems?.map(item => ( | ||
<> | ||
{ | ||
item?.partial && !item?.loading ? | ||
<tr className=""> | ||
<td className="py-2 px-2">{item?.pathname?.split(`${collection?.pathname}/`)?.[1]}</td> | ||
<td className="py-2 px-2 text-left">{item?.size?.toFixed?.(2)} MB</td> | ||
</tr> | ||
: null | ||
} | ||
</> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
: | ||
null | ||
} | ||
</div> | ||
<div className="col-span-3"> | ||
<Docs collection={collection} /> | ||
</div> | ||
</div> | ||
</StyledWrapper> | ||
); | ||
} | ||
|
||
export default Overview; |
2 changes: 1 addition & 1 deletion
2
packages/bruno-app/src/components/CollectionSettings/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/bruno-app/src/components/RequestTabPanel/RequestIsLoading/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { IconLoader2 } from '@tabler/icons'; | ||
|
||
const RequestIsLoading = ({ item }) => { | ||
return <> | ||
<div className='flex flex-col gap-6 w-fit pt-4 pb-3 px-4'> | ||
<div className='flex flex-col gap-1'> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Name</div> | ||
<div>{item?.name}</div> | ||
</div> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Size</div> | ||
<div>{item?.size?.toFixed?.(2)} MB</div> | ||
</div> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Path</div> | ||
<div>{item?.pathname}</div> | ||
</div> | ||
<div className='flex flex-col gap-6 w-fit justify-start'> | ||
<IconLoader2 className="animate-spin" size={18} strokeWidth={1.5} /> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
} | ||
|
||
export default RequestIsLoading; |
55 changes: 55 additions & 0 deletions
55
packages/bruno-app/src/components/RequestTabPanel/RequestNotLoaded/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { IconLoader2 } from '@tabler/icons'; | ||
import { loadRequest, loadRequestSync } from 'providers/ReduxStore/slices/collections/actions'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
const RequestNotLoaded = ({ collection, item }) => { | ||
const dispatch = useDispatch(); | ||
const handleLoadRequest = () => { | ||
!item?.loading && dispatch(loadRequest({ collectionUid: collection?.uid, pathname: item?.pathname })); | ||
} | ||
|
||
const handleLoadRequestSync = () => { | ||
!item?.loading && dispatch(loadRequestSync({ collectionUid: collection?.uid, pathname: item?.pathname })); | ||
} | ||
|
||
return <> | ||
<div className='flex flex-col gap-6 w-fit pt-4 pb-3 px-4'> | ||
<div className='flex flex-col gap-1'> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Name</div> | ||
<div>{item?.name}</div> | ||
</div> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Size</div> | ||
<div>{item?.size?.toFixed?.(2)} MB</div> | ||
</div> | ||
<div className='flex flex-row gap-1'> | ||
<div className='opacity-70 min-w-[50px]'>Path</div> | ||
<div>{item?.pathname}</div> | ||
</div> | ||
</div> | ||
<div className='flex flex-col gap-6 w-fit justify-start'> | ||
<div className='flex flex-col'> | ||
<button className={`submit btn btn-sm btn-secondary w-fit h-fit flex flex-row gap-2 ${item?.loading? 'opacity-50 cursor-blocked': ''}`} onClick={handleLoadRequestSync}> | ||
{item?.loading ? `Loading Request` : `Load Request`} | ||
{item?.loading ? <IconLoader2 className="animate-spin" size={18} strokeWidth={1.5} /> : null} | ||
</button> | ||
<small className='text-muted mt-1'> | ||
May cause the app to freeze temporarily while it runs. | ||
</small> | ||
</div> | ||
<div className='flex flex-col'> | ||
<button className={`submit btn btn-sm btn-secondary w-fit h-fit flex flex-row gap-2 ${item?.loading? 'opacity-50 cursor-blocked': ''}`} onClick={handleLoadRequest}> | ||
{item?.loading ? `Loading Request` : `Load Request in Background`} | ||
{item?.loading ? <IconLoader2 className="animate-spin" size={18} strokeWidth={1.5} /> : null} | ||
</button> | ||
<small className='text-muted mt-1'> | ||
Runs in background. | ||
</small> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
} | ||
|
||
export default RequestNotLoaded; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.