forked from KathiraveluLab/DHGWorkflow
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from ControlCore-Project/main
Attempt ot merge main to dev
- Loading branch information
Showing
21 changed files
with
2,267 additions
and
45 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import './logs.css'; | ||
import { actionType as T } from '../reducer'; | ||
|
||
const Logs = ({ superState, dispatcher }) => { | ||
const [output, setOutput] = useState(''); | ||
|
||
const clearTerminal = () => { | ||
setOutput(''); | ||
dispatcher({ type: T.SET_LOGS_MESSAGE, payload: '' }); | ||
}; | ||
|
||
const closeTerminal = () => { | ||
dispatcher({ type: T.SET_LOGS, payload: false }); | ||
}; | ||
|
||
useEffect(() => { | ||
if (superState.logs) { | ||
document.getElementById('terminal').style.display = 'block'; | ||
setOutput(superState.logsmessage); | ||
} else { | ||
document.getElementById('terminal').style.display = 'none'; | ||
setOutput(superState.logsmessage); | ||
} | ||
}, [superState.logs]); | ||
|
||
return ( | ||
<> | ||
<div className="terminal" id="terminal"> | ||
<div className="terminal-header"> | ||
Logs | ||
<button type="button" className="clear" onClick={clearTerminal}>Clear</button> | ||
<button type="button" className="closelogs" onClick={closeTerminal}>X</button> | ||
</div> | ||
<div className="terminal-body"> | ||
{output.split('\n').map((line) => ( | ||
<div className="terminal-line"> | ||
{line} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Logs; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.terminal { | ||
display: none; | ||
position: absolute; | ||
top: 10%; | ||
left: 50%; | ||
right: auto; | ||
bottom: auto; | ||
margin-right: -50%; | ||
transform: translateX(-50%); | ||
width: 500px; | ||
height: 350px; | ||
border: 1px solid #ccc; | ||
background-color: #000; | ||
color: #fff; | ||
font-family: monospace; | ||
margin: 20px auto; | ||
z-index: 10000; | ||
} | ||
|
||
.terminal-header { | ||
padding: 5px; | ||
background-color: #333; | ||
text-align: center; | ||
} | ||
|
||
.clear { | ||
background-color: rgb(187, 184, 184); | ||
border-radius: 20px; | ||
position: absolute; | ||
right: 30px; | ||
} | ||
|
||
.closelogs { | ||
background-color: rgba(249, 37, 37, 0.575); | ||
color: white; | ||
position: absolute; | ||
right: 1px; | ||
} | ||
|
||
.terminal-body { | ||
padding: 10px; | ||
height: 300px; | ||
overflow-y: auto; | ||
} | ||
|
||
.terminal-line { | ||
padding: 5px 0; | ||
} |
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.