Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/update vnv report #7

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
804 commits
Select commit Hold shift + click to select a range
8a86d5e
get schedules filter changed
RishiVaya Mar 5, 2024
bf3cdbd
dummy api
RishiVaya Mar 4, 2024
97c90e1
stash
RishiVaya Mar 5, 2024
faf2dc0
get schedules filter changed
RishiVaya Mar 5, 2024
e9df2f4
dynamically routed noradid for scheudle
quinnha Mar 5, 2024
2313801
added extra use efect
quinnha Mar 5, 2024
f385297
Merge pull request #183 from LowerEarthOrbiters/dynamicSchedule
quinnha Mar 5, 2024
53e5300
Merge branch 'main' of https://github.com/RishiVaya/Lower_Earth_Orbiters
RishiVaya Mar 5, 2024
4871bc7
removing dummy changeds
RishiVaya Mar 5, 2024
5126408
Merge branch 'scheduleChange' of https://github.com/RishiVaya/Lower_E…
RishiVaya Mar 5, 2024
5855cb7
filter changed
RishiVaya Mar 5, 2024
5c9fe7c
cleanup
RishiVaya Mar 5, 2024
38c1c73
Merge pull request #184 from LowerEarthOrbiters/scheduleChange
RishiVaya Mar 5, 2024
b0140e3
Merge branch 'main' of https://github.com/RishiVaya/Lower_Earth_Orbiters
RishiVaya Mar 5, 2024
4c122c8
Added test cases for updating and deleting commands
Umang-Rajkarnikar Mar 5, 2024
0038df9
update test script
Umang-Rajkarnikar Mar 5, 2024
25677fe
update test script
Umang-Rajkarnikar Mar 5, 2024
dc0e452
Fixed update command request test
Umang-Rajkarnikar Mar 5, 2024
0e29fd9
added invalid id check for satellite and schedule reqs
Umang-Rajkarnikar Mar 5, 2024
9a088ad
Merge pull request #185 from LowerEarthOrbiters/testing/schedule-unit…
Umang-Rajkarnikar Mar 5, 2024
d5034ab
fixed log message
DiamondAhuja Mar 5, 2024
9b90ba8
Merge pull request #186 from LowerEarthOrbiters/logs-ui
RishiVaya Mar 5, 2024
ab443dc
added tests
RishiVaya Mar 6, 2024
fa2c202
added tests and fixed some satUser endpoints
RishiVaya Mar 6, 2024
db13531
Merge pull request #187 from LowerEarthOrbiters/satUserTest
RishiVaya Mar 6, 2024
e75cfad
Updated vnv plan
Umang-Rajkarnikar Mar 7, 2024
be5695d
Added vnv report
Umang-Rajkarnikar Mar 7, 2024
a560eb2
Update vnv report to include revision history
Umang-Rajkarnikar Mar 7, 2024
59c3377
updated dynamic noradid
quinnha Mar 8, 2024
bbdb1b4
initial commit
DiamondAhuja Mar 8, 2024
1f31c53
added dependencies
DiamondAhuja Mar 8, 2024
7952e82
made endpoint to start websocket server
DiamondAhuja Mar 8, 2024
b51fb84
Add mockMCTRoute to app.ts
DiamondAhuja Mar 8, 2024
7332cfb
need to fix file location for key and cert
DiamondAhuja Mar 8, 2024
fb7a365
dynamically routed individual schedule via router query
quinnha Mar 8, 2024
f9bc454
removed bloat
quinnha Mar 8, 2024
c5f22b8
dynamically fetched logs
quinnha Mar 8, 2024
5558136
removed old logs page
quinnha Mar 8, 2024
0348c35
tablefied upcoming schedules
quinnha Mar 8, 2024
e6dda03
made future pass into a table
quinnha Mar 8, 2024
7ce9056
Merge branch 'main' of https://github.com/RishiVaya/Lower_Earth_Orbit…
quinnha Mar 8, 2024
13389bb
updated merge conflict
quinnha Mar 8, 2024
df46a72
changed logs
quinnha Mar 8, 2024
58f0428
fixing merge conflict
quinnha Mar 9, 2024
e22a90a
dynamically routed logs again
quinnha Mar 9, 2024
cfe2b21
Update yarn.lock with @types/[email protected]
DiamondAhuja Mar 9, 2024
df8e35e
fixing errors
DiamondAhuja Mar 9, 2024
bcacefa
trying to reset this dumb branch
quinnha Mar 9, 2024
ba70b77
Merge branch 'main' into dynamicSchedule
quinnha Mar 9, 2024
9279bd6
Delete src/leo-client-app/src/components/logs.tsx
quinnha Mar 9, 2024
88609df
removed logs
quinnha Mar 9, 2024
997da94
readded logs tsx
quinnha Mar 9, 2024
070b137
dynamically route logs
quinnha Mar 9, 2024
d529ade
removed logs
quinnha Mar 9, 2024
8a6f803
readded logs
quinnha Mar 9, 2024
2b787b7
Update file paths for key and cert files
DiamondAhuja Mar 9, 2024
18ceec1
commit msgs
quinnha Mar 9, 2024
b7e8c31
Merge pull request #188 from LowerEarthOrbiters/dynamicSchedule
quinnha Mar 9, 2024
783cc47
Merge branch 'main' into satelliteInfoUi
quinnha Mar 9, 2024
e2c1b40
fixed merge issue
quinnha Mar 9, 2024
71ce3d6
Merge pull request #189 from LowerEarthOrbiters/satelliteInfoUi
quinnha Mar 9, 2024
5cee868
Refactored routing to support socket and express connections
Umang-Rajkarnikar Mar 12, 2024
c59d884
Removed mock_mct file
Umang-Rajkarnikar Mar 12, 2024
2a5491d
Update schedule route to use start and end time
DiamondAhuja Mar 12, 2024
32f4996
yarn lock additions
dhruvcheemakurti Mar 12, 2024
b3f5a96
making background dark mode
dhruvcheemakurti Mar 12, 2024
1167256
making background color dark mode + making font color white
dhruvcheemakurti Mar 12, 2024
863c641
changing font to white
dhruvcheemakurti Mar 12, 2024
78b9f62
same as before
dhruvcheemakurti Mar 12, 2024
6054267
created new form pop up for user to add a new satellite to track
dhruvcheemakurti Mar 12, 2024
cb1fe29
addnewsatellite function that touches the endpoint that adds new sate…
dhruvcheemakurti Mar 12, 2024
c964313
code clean up
dhruvcheemakurti Mar 12, 2024
e02225c
clean up
dhruvcheemakurti Mar 13, 2024
1ab3360
fixing e error
dhruvcheemakurti Mar 13, 2024
c717492
fixed error
dhruvcheemakurti Mar 13, 2024
68beb85
Fix endTime calculation in schedule.ts
DiamondAhuja Mar 13, 2024
cda33ba
Add filter functionality to Scheduler component
DiamondAhuja Mar 13, 2024
dc9759f
Refactor Scheduler component to improve filter functionality
DiamondAhuja Mar 13, 2024
73ee50f
added helper fuicntions and new endpoint, needs changes
RishiVaya Mar 13, 2024
352a087
making edit schedules more readable
dhruvcheemakurti Mar 13, 2024
1f4aad0
making edit schedules more readable?
dhruvcheemakurti Mar 13, 2024
551831a
Refactor Scheduler component
DiamondAhuja Mar 13, 2024
78025f0
Fix time conversion issue in schedule route
DiamondAhuja Mar 13, 2024
95607e7
Update Scheduler component styling and layout
DiamondAhuja Mar 13, 2024
8040fdf
Update Scheduler.css styles
DiamondAhuja Mar 13, 2024
69ed352
Refactor EditSchedulePage component
DiamondAhuja Mar 13, 2024
bb9d802
formatted scheduler.tsx
DiamondAhuja Mar 13, 2024
b83491c
updated default behaviour to show all schedules
DiamondAhuja Mar 13, 2024
1242788
changed to table
dhruvcheemakurti Mar 14, 2024
8fb1477
endpoint for get next passes by noraidid and time added
RishiVaya Mar 14, 2024
1895696
code cleanup
RishiVaya Mar 14, 2024
ab57755
bagel nit
RishiVaya Mar 14, 2024
2b38429
added dropdown for filter
DiamondAhuja Mar 14, 2024
ed12b01
Remove unused CSS class in Scheduler.css
DiamondAhuja Mar 14, 2024
40421d5
Fix time conversion based on umang's comments
DiamondAhuja Mar 14, 2024
fe5cd44
Installed react-terminal-ui package
Umang-Rajkarnikar Mar 14, 2024
d436938
Add terminal to scheduler page
Umang-Rajkarnikar Mar 14, 2024
68dc083
changed ui to a table format for scheduled commands
dhruvcheemakurti Mar 14, 2024
a31fba4
Merge pull request #196 from LowerEarthOrbiters/satfilter_endpoint
RishiVaya Mar 14, 2024
6c000cd
Merge pull request #195 from LowerEarthOrbiters/schedule-filter
DiamondAhuja Mar 14, 2024
0571b75
clean up
dhruvcheemakurti Mar 14, 2024
7642345
Merge branch 'main' into edit_schedules
dhruvcheemakurti Mar 14, 2024
906aaea
making it white
dhruvcheemakurti Mar 14, 2024
36b4dbb
made a variable for max days
RishiVaya Mar 15, 2024
ff1b201
Merge pull request #198 from LowerEarthOrbiters/satfilter_endpoint
DiamondAhuja Mar 15, 2024
0be8895
Remove unused state variable and format code
DiamondAhuja Mar 16, 2024
e047346
linted code
DiamondAhuja Mar 16, 2024
f52390e
Refactor FuturePasses component to fetch passes by time
DiamondAhuja Mar 16, 2024
ad4d530
Add filter functionality to FuturePasses component
DiamondAhuja Mar 17, 2024
80068b9
Fix custom date filter in FuturePasses component
DiamondAhuja Mar 17, 2024
ff2dc1c
fixed date selection to local date
DiamondAhuja Mar 17, 2024
45b4bf4
fixing date parsing and formatting
DiamondAhuja Mar 17, 2024
9058799
Separated ports for app and socket
Umang-Rajkarnikar Mar 18, 2024
91465e1
Added endpoint to test socket
Umang-Rajkarnikar Mar 18, 2024
b346354
Added variable for socket port
Umang-Rajkarnikar Mar 19, 2024
3c9ddf2
Fixed error
Umang-Rajkarnikar Mar 19, 2024
9690b8c
Referred to constant socket port
Umang-Rajkarnikar Mar 19, 2024
ada88fe
Merge pull request #190 from LowerEarthOrbiters/websocket-integration
Umang-Rajkarnikar Mar 19, 2024
db49d97
fixed repeating table
dhruvcheemakurti Mar 20, 2024
0439046
clean up
dhruvcheemakurti Mar 20, 2024
9b41210
fixing rerouting
dhruvcheemakurti Mar 21, 2024
cd3c7de
fixing schedule queue
dhruvcheemakurti Mar 21, 2024
df2cfd2
Merge branch 'main' into feat/scheduler-terminal
Umang-Rajkarnikar Mar 21, 2024
17e728f
Merged socket and express servers
Umang-Rajkarnikar Mar 21, 2024
156f9a7
Created an endpoint to send command through socket
Umang-Rajkarnikar Mar 21, 2024
053e1f6
clean up
dhruvcheemakurti Mar 21, 2024
66ad079
changed upcoming schedules to table format for enhanced readability
dhruvcheemakurti Mar 21, 2024
77f3450
clean up
dhruvcheemakurti Mar 21, 2024
e97ff7b
Merge branch 'main' into edit_schedules
dhruvcheemakurti Mar 21, 2024
99a9e36
Add new line character when sending command
Umang-Rajkarnikar Mar 21, 2024
4760132
Add endpoints to get commands and send command
Umang-Rajkarnikar Mar 21, 2024
b3b33bb
Created scheduler terminal component
Umang-Rajkarnikar Mar 21, 2024
dde36f2
Modified api clal to get commands
Umang-Rajkarnikar Mar 21, 2024
7ca5ff3
Created and added next schedule component
Umang-Rajkarnikar Mar 21, 2024
c8e6669
Added page to execute schedule
Umang-Rajkarnikar Mar 21, 2024
06af7d0
Created component to execute schedule
Umang-Rajkarnikar Mar 21, 2024
661ae6b
Created socket.io listener in backend
Umang-Rajkarnikar Mar 21, 2024
e1a93ef
Cleaned up edit schedules
Umang-Rajkarnikar Mar 21, 2024
91c21ca
Added api calls to execute and stop schedules
Umang-Rajkarnikar Mar 21, 2024
4b14a76
Added prop to disable terminal
Umang-Rajkarnikar Mar 21, 2024
4efc927
Integrated socket.io in frontend
Umang-Rajkarnikar Mar 21, 2024
4e99589
fixed styling
dhruvcheemakurti Mar 21, 2024
1021a70
Added executing and empty states
Umang-Rajkarnikar Mar 22, 2024
de36cee
Cancel scheduled job
Umang-Rajkarnikar Mar 22, 2024
2426259
Added flag to cancel and resume jobs
Umang-Rajkarnikar Mar 22, 2024
571ce1e
Added valid commands to terminal
Umang-Rajkarnikar Mar 22, 2024
eb41502
Added checks during execution
Umang-Rajkarnikar Mar 22, 2024
205bc0f
added logic to cancel execution in backend
Umang-Rajkarnikar Mar 22, 2024
85f8f06
Merge pull request #197 from LowerEarthOrbiters/edit_schedules
dhruvcheemakurti Mar 22, 2024
edbc614
Modified log endpoint to return 1
Umang-Rajkarnikar Mar 22, 2024
2bfc5c7
Added api call to fetch log by command
Umang-Rajkarnikar Mar 22, 2024
ee30551
Added log modal to execute schedule card
Umang-Rajkarnikar Mar 22, 2024
f869d78
Fixed ping endpoint
Umang-Rajkarnikar Mar 22, 2024
667872e
Added endpoint to ping socket
Umang-Rajkarnikar Mar 22, 2024
af03d67
Added socket status to card
Umang-Rajkarnikar Mar 22, 2024
08372b7
Forward actual command via terminal
Umang-Rajkarnikar Mar 22, 2024
d3bddc4
Added socket connection component
Umang-Rajkarnikar Mar 22, 2024
c0db81d
Fixed forward endpoint
Umang-Rajkarnikar Mar 22, 2024
15f7241
Merge branch 'main' into feat/scheduler-terminal
Umang-Rajkarnikar Mar 22, 2024
55f148e
Fixed imports in test files
Umang-Rajkarnikar Mar 22, 2024
fae6f32
Disable change stream during test
Umang-Rajkarnikar Mar 22, 2024
c95b91f
Commented util test case
Umang-Rajkarnikar Mar 22, 2024
db48f67
Added comments
Umang-Rajkarnikar Mar 22, 2024
19c55a0
Merge branch 'main' into overpass-filter
DiamondAhuja Mar 23, 2024
a9707cc
Update page layouts for consistency
DiamondAhuja Mar 23, 2024
3a40eeb
Updated text color for the filters
DiamondAhuja Mar 23, 2024
413822f
fixed filter fetching passes based on start time and end time
DiamondAhuja Mar 23, 2024
d6aa625
Update styling in satellite and schedule-commands pages
DiamondAhuja Mar 23, 2024
1b662b8
Refactor date parsing and formatting in Scheduler component
DiamondAhuja Mar 23, 2024
e042ee8
Merge pull request #199 from LowerEarthOrbiters/feat/scheduler-terminal
Umang-Rajkarnikar Mar 23, 2024
6e88134
Merge branch 'main' into overpass-filter
DiamondAhuja Mar 23, 2024
e9af6e4
fixed logs frontend
RishiVaya Mar 23, 2024
2d16c54
Merge pull request #201 from LowerEarthOrbiters/log_fix
RishiVaya Mar 23, 2024
68cfb71
Update height to minHeight in SatelliteInfoPage component
DiamondAhuja Mar 23, 2024
0e861bb
fixed log frontend
RishiVaya Mar 23, 2024
035b491
code cleanup
RishiVaya Mar 23, 2024
32eeba8
Merge pull request #202 from LowerEarthOrbiters/log_front
RishiVaya Mar 23, 2024
b273ddd
Merge branch 'main' into overpass-filter
DiamondAhuja Mar 23, 2024
7387063
dynamically route schedule
quinnha Mar 23, 2024
76d4665
Merge pull request #200 from LowerEarthOrbiters/overpass-filter
DiamondAhuja Mar 23, 2024
86b4f80
modified next schedule
quinnha Mar 23, 2024
1d2fef5
Merge pull request #203 from LowerEarthOrbiters/dynamicMap
quinnha Mar 23, 2024
fcb8624
eidted name
quinnha Mar 23, 2024
1131023
eidted name
quinnha Mar 23, 2024
7c032d1
edited next week passes styling
quinnha Mar 23, 2024
a28294a
Merge branch 'dynamicMap' of https://github.com/RishiVaya/Lower_Earth…
quinnha Mar 23, 2024
3315528
Merge pull request #204 from LowerEarthOrbiters/dynamicMap
quinnha Mar 23, 2024
d3c39cf
Modified models and endpoints to support adding sat to user
Umang-Rajkarnikar Mar 23, 2024
273cba6
Refactored sat of interest
Umang-Rajkarnikar Mar 23, 2024
44e549f
Merge branch 'main' into fix/add-satellite
Umang-Rajkarnikar Mar 23, 2024
8c9a4b4
integrated endpoint to fetch satellites of interest
Umang-Rajkarnikar Mar 23, 2024
003606d
Fixed button styling
Umang-Rajkarnikar Mar 23, 2024
0ae1b03
Merge pull request #205 from LowerEarthOrbiters/fix/add-satellite
Umang-Rajkarnikar Mar 24, 2024
1c291e1
Refactor Scheduler component styling
DiamondAhuja Mar 24, 2024
d05d866
Refactor UpcomingSchedules component and add filter functionality
DiamondAhuja Mar 24, 2024
0d08263
adjusted alignment
DiamondAhuja Mar 24, 2024
719a9a3
Fixed sequence timeout
Umang-Rajkarnikar Mar 24, 2024
eb1f39b
Merge pull request #207 from LowerEarthOrbiters/fix/message-handler
Umang-Rajkarnikar Mar 24, 2024
7d1058f
Merge pull request #206 from LowerEarthOrbiters/overpass-filter
DiamondAhuja Mar 24, 2024
2142d12
added schedule filter
RishiVaya Mar 24, 2024
3646fe2
commented tests
RishiVaya Mar 24, 2024
f69661b
Merge pull request #208 from LowerEarthOrbiters/queue_fix
RishiVaya Mar 24, 2024
4fa168b
Disabled recheduling for now
Umang-Rajkarnikar Mar 24, 2024
0eef023
Commented shceudling job for next overpass
Umang-Rajkarnikar Mar 24, 2024
4dad2e2
Merge pull request #209 from LowerEarthOrbiters/fix/disabled-reschedu…
Umang-Rajkarnikar Mar 24, 2024
b0695d9
Separated http and socket connections to different ports
Umang-Rajkarnikar Mar 25, 2024
6e1bf6e
Merge pull request #210 from LowerEarthOrbiters/refactor/server-ports
Umang-Rajkarnikar Mar 25, 2024
3090f76
resolved issues in Hazard analysis
quinnha Mar 27, 2024
9c3fac3
added edit date
quinnha Mar 27, 2024
467f43d
Added endpoint to fetch user by email
Umang-Rajkarnikar Mar 27, 2024
64f93bc
Merge pull request #215 from LowerEarthOrbiters/haz
quinnha Mar 27, 2024
b76c4c0
Merge pull request #216 from LowerEarthOrbiters/feat/endpoint-get-use…
Umang-Rajkarnikar Mar 27, 2024
2a2d18f
Added endpoint to send test command
Umang-Rajkarnikar Mar 27, 2024
b35c75e
Added page to send test command
Umang-Rajkarnikar Mar 27, 2024
63a222b
Merge pull request #217 from LowerEarthOrbiters/feat/add-playground-f…
Umang-Rajkarnikar Mar 27, 2024
1a9471e
modified vnv plan as per feedback
quinnha Mar 28, 2024
9fb8073
Merge pull request #218 from LowerEarthOrbiters/vnv
quinnha Mar 28, 2024
6f33973
updated gitignore with new certificates
quinnha Mar 28, 2024
8e205ae
modified socket path
quinnha Mar 28, 2024
3a0deee
dynamically routed satellites to user
quinnha Mar 28, 2024
ec0c6e6
Merge pull request #219 from LowerEarthOrbiters/dynamicUsers
quinnha Mar 28, 2024
b72f51a
Added logic to send multiple arguments through react terminal
Umang-Rajkarnikar Mar 29, 2024
d610494
Merge pull request #220 from LowerEarthOrbiters/fix/sending-commands
Umang-Rajkarnikar Mar 29, 2024
aae21fe
updated final documentation
quinnha Mar 29, 2024
cc72829
updated random readmes
quinnha Mar 29, 2024
2baa503
Add satellite commands page
DiamondAhuja Mar 30, 2024
46b9c30
linted code
DiamondAhuja Mar 30, 2024
7625e8e
Add SatelliteCommandsPage component
DiamondAhuja Mar 30, 2024
4f51d41
Add SatelliteCommands component
DiamondAhuja Mar 30, 2024
67f7e93
added satellite name
DiamondAhuja Mar 30, 2024
110e679
Add Commands link to Navbar
DiamondAhuja Mar 30, 2024
7ae7e8d
Add fetchValidCommands function to fetch valid commands for a satellite
DiamondAhuja Mar 30, 2024
a2b8ce6
Added expo poster
Umang-Rajkarnikar Mar 31, 2024
f944b49
Merge pull request #221 from LowerEarthOrbiters/finalDoc
Umang-Rajkarnikar Mar 31, 2024
cf601b5
Add table and functionality for editing and deleting satellite commands
DiamondAhuja Mar 31, 2024
99fd638
testing with editing and deleting commands
DiamondAhuja Mar 31, 2024
a471d57
added functionality to add commands
DiamondAhuja Mar 31, 2024
f12c0ec
Add satelliteCommands CSS file
DiamondAhuja Mar 31, 2024
e517cc4
Update satelliteCommands.css to use flexbox and adjust width
DiamondAhuja Mar 31, 2024
2c48236
Add dialog for editing commands
DiamondAhuja Mar 31, 2024
e9230f7
Update satelliteCommands.css styles
DiamondAhuja Mar 31, 2024
8462df5
Add openAdd state and handle functions for adding commands
DiamondAhuja Mar 31, 2024
c038e05
Add styles for satellite commands
DiamondAhuja Mar 31, 2024
ab5370d
Refactor SatelliteCommands component to improve UI and add functionality
DiamondAhuja Mar 31, 2024
df5b149
Merge pull request #222 from LowerEarthOrbiters/docs/add-poster
Umang-Rajkarnikar Apr 1, 2024
5c660d0
Refactored handling of output messages in frontend
Umang-Rajkarnikar Apr 1, 2024
687c38b
Handled undefined case
Umang-Rajkarnikar Apr 1, 2024
60de2c1
Merge pull request #224 from LowerEarthOrbiters/fix/terminal-output
Umang-Rajkarnikar Apr 1, 2024
2708914
Merge pull request #223 from LowerEarthOrbiters/sat-commands
DiamondAhuja Apr 1, 2024
cb2f2fa
Updated vnv report
Umang-Rajkarnikar Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactored handling of output messages in frontend
  • Loading branch information
Umang-Rajkarnikar committed Apr 1, 2024
commit 5c660d022ff51c6aa724780c31b8598803c80584
56 changes: 42 additions & 14 deletions src/leo-client-app/src/components/SchedulerTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,47 @@ const SchedulerTerminal = ({ disabled = false }: Props) => {
});
};

const commandSendingHandler = async (...args: string[]) => {
let commandReq = "";

// Iterate through each command separated by space
for (const message of args) {
commandReq += message + " ";
}

// Remove trailing white spaces
commandReq = commandReq.trim();

// Check if command is valid
const isValid = validCommands.data?.record[0]?.validCommands.some(
(cmd: string) => cmd === commandReq
);

if (!isValid) {
return "Invalid command sequence";
}

const res = await sendCommand(commandReq);

// Refetch commands scheduled
await queryClient.invalidateQueries({
queryKey: ["useGetCommandsBySchedule"],
});

// Split string by lines
const messages = res.output?.toString().split("\n") ?? "";

return (
<Stack gap={1}>
{!messages?.length && <Typography>Error</Typography>}
{messages?.length &&
messages.map((msg: string, index: number) => (
<p key={"terminal-message " + index}>{msg}</p>
))}
</Stack>
);
};

const commands = {
help: (
<Stack flexWrap={"wrap"} direction={"row"} spacing={4}>
Expand Down Expand Up @@ -70,20 +111,7 @@ const SchedulerTerminal = ({ disabled = false }: Props) => {
},
}}
theme="my-custom-theme"
defaultHandler={async (request: any) => {
const isValid = validCommands.data?.record[0]?.validCommands.some(
(cmd: string) => cmd === request
);
if (!isValid) {
return "Invalid command sequence";
}

const res = await sendCommand(request);
await queryClient.invalidateQueries({
queryKey: ["useGetCommandsBySchedule"],
});
return res?.output ?? "Error";
}}
defaultHandler={commandSendingHandler}
/>
</Box>
</Stack>
Expand Down
2 changes: 0 additions & 2 deletions src/leo-client-app/src/constants/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,5 @@ export const useGetPingSocket = () => {
return useQuery({
queryKey: ["useGetPingSocket"],
queryFn: () => getPingSocket(),
// Refetch every 5 seconds
refetchInterval: 5000,
});
};
17 changes: 14 additions & 3 deletions src/leo-client-app/src/pages/test-playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import { withPageAuthRequired } from "@auth0/nextjs-auth0/client";
import Navbar from "@/components/navbar/Navbar";
import EditScheduler from "@/components/EditSchedules";
import { Box, Stack } from "@mui/material";
import { Box, Stack, Typography } from "@mui/material";
import { useRouter } from "next/router";
import ExecuteScheduleCard from "@/components/ExecuteScheduleCard";
import SchedulerTerminal from "@/components/SchedulerTerminal";
import { ReactTerminal } from "react-terminal";
import { sendCommandToTestForwarder } from "@/constants/api";
import { useState } from "react";
import { Key, useState } from "react";
import SocketConnection from "@/components/SocketConnection";
import { useGetPingSocket } from "@/constants/hooks";

Expand Down Expand Up @@ -52,7 +52,18 @@ function TestPlayground() {
commandReq = commandReq.trim();

const res = await sendCommand(commandReq);
return res?.output ?? "Error";

const messages = res.output?.toString().split("\n") ?? "";

return (
<Stack gap={1}>
{!messages?.length && <Typography>Error</Typography>}
{messages?.length &&
messages.map((msg: string, index: number) => (
<p key={"terminal-message " + index}>{msg}</p>
))}
</Stack>
);
};

return (
Expand Down