-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for HTTP Send devices
- Loading branch information
Alex Van Camp
committed
May 5, 2022
1 parent
b06371f
commit 32a7695
Showing
19 changed files
with
264 additions
and
51 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
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
1 change: 1 addition & 0 deletions
1
apps/app/src/react/components/pages/homePage/deviceIcon/style.scss
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.device-icon { | ||
display: flex; | ||
align-items: center; | ||
width: 40px; | ||
|
||
img { | ||
max-height: 2rem; | ||
|
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
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
116 changes: 113 additions & 3 deletions
116
apps/app/src/react/components/sidebar/timelineObj/timelineObjs/httpSend.tsx
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 |
---|---|---|
@@ -1,14 +1,124 @@ | ||
import { Button, Stack, Typography } from '@mui/material' | ||
import React from 'react' | ||
import { TimelineObjHTTPSendAny } from 'timeline-state-resolver-types' | ||
import { EditWrapper, NOT_IMPLEMENTED_SETTINGS, OnSave } from './lib' | ||
import { TimelineContentTypeHTTP, TimelineObjHTTPSendAny } from 'timeline-state-resolver-types' | ||
import { IntInput } from '../../../inputs/IntInput' | ||
import { SelectEnum } from '../../../inputs/SelectEnum' | ||
import { TextInput } from '../../../inputs/TextInput' | ||
import { TrashBtn } from '../../../inputs/TrashBtn' | ||
import { EditWrapper, OnSave } from './lib' | ||
|
||
export const EditTimelineObjHTTPSendAny: React.FC<{ obj: TimelineObjHTTPSendAny; onSave: OnSave }> = ({ | ||
obj, | ||
onSave, | ||
}) => { | ||
return ( | ||
<EditWrapper obj={obj} onSave={onSave}> | ||
{NOT_IMPLEMENTED_SETTINGS} | ||
<div className="setting"> | ||
<SelectEnum | ||
label="Request Type" | ||
fullWidth | ||
currentValue={obj.content.type} | ||
options={TimelineContentTypeHTTP} | ||
onChange={(v: TimelineContentTypeHTTP) => { | ||
obj.content.type = v | ||
onSave(obj) | ||
}} | ||
allowUndefined={false} | ||
/> | ||
</div> | ||
|
||
<div className="setting"> | ||
<TextInput | ||
label="URL" | ||
fullWidth | ||
currentValue={obj.content.url} | ||
onChange={(v) => { | ||
obj.content.url = v | ||
onSave(obj) | ||
}} | ||
allowUndefined={false} | ||
/> | ||
</div> | ||
|
||
{Object.entries(obj.content.params).map(([key, value], index) => ( | ||
<React.Fragment key={index}> | ||
<Stack direction="row" justifyContent="space-between"> | ||
<Typography variant="body2">Param #{index}</Typography> | ||
<TrashBtn | ||
onClick={() => { | ||
delete obj.content.params[key] | ||
onSave(obj) | ||
}} | ||
title="Delete parameter" | ||
/> | ||
</Stack> | ||
|
||
<div className="setting"> | ||
<TextInput | ||
label="Key" | ||
fullWidth | ||
currentValue={key} | ||
onChange={(v) => { | ||
obj.content.params[v] = value | ||
delete obj.content.params[key] | ||
onSave(obj) | ||
}} | ||
allowUndefined={false} | ||
/> | ||
</div> | ||
|
||
<div className="setting"> | ||
<TextInput | ||
label="Value" | ||
fullWidth | ||
currentValue={value} | ||
onChange={(v) => { | ||
obj.content.params[key] = v | ||
onSave(obj) | ||
}} | ||
allowUndefined={false} | ||
/> | ||
</div> | ||
</React.Fragment> | ||
))} | ||
|
||
<Button | ||
style={{ marginBottom: '1rem' }} | ||
variant="contained" | ||
onClick={() => { | ||
const numParams = Object.keys(obj.content.params).length | ||
obj.content.params[`param${numParams}`] = 'value' | ||
onSave(obj) | ||
}} | ||
> | ||
Add Parameter | ||
</Button> | ||
|
||
<div className="setting"> | ||
<IntInput | ||
label="Temporal Priority" | ||
fullWidth | ||
currentValue={obj.content.temporalPriority} | ||
onChange={(v) => { | ||
obj.content.temporalPriority = v | ||
onSave(obj) | ||
}} | ||
allowUndefined={true} | ||
/> | ||
</div> | ||
|
||
<div className="setting"> | ||
<TextInput | ||
label="Queue ID" | ||
fullWidth | ||
currentValue={obj.content.queueId} | ||
onChange={(v) => { | ||
obj.content.queueId = v | ||
onSave(obj) | ||
}} | ||
allowUndefined={true} | ||
/> | ||
</div> | ||
</EditWrapper> | ||
) | ||
} |
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
Oops, something went wrong.