Skip to content

Commit 4f2e6c8

Browse files
authored
Merge pull request #181 from ControlCore-Project/main
Merge main back to dev.
2 parents a57e054 + 7b30f08 commit 4f2e6c8

6 files changed

Lines changed: 38 additions & 15 deletions

File tree

src/component/Logs.jsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,32 @@ const Logs = ({ superState, dispatcher }) => {
1616

1717
useEffect(() => {
1818
if (superState.logs) {
19+
document.getElementById('outlay').style.display = 'block';
1920
document.getElementById('terminal').style.display = 'block';
2021
setOutput(superState.logsmessage);
2122
} else {
2223
document.getElementById('terminal').style.display = 'none';
24+
document.getElementById('outlay').style.display = 'none';
2325
setOutput(superState.logsmessage);
2426
}
2527
}, [superState.logs]);
2628

2729
return (
2830
<>
29-
<div className="terminal" id="terminal">
30-
<div className="terminal-header">
31-
Logs
32-
<button type="button" className="clear" onClick={clearTerminal}>Clear</button>
33-
<button type="button" className="closelogs" onClick={closeTerminal}>X</button>
34-
</div>
35-
<div className="terminal-body">
36-
{output.split('\n').map((line) => (
37-
<div className="terminal-line">
38-
{line}
39-
</div>
40-
))}
31+
<div className="outlay" id="outlay">
32+
<div className="terminal" id="terminal">
33+
<div className="terminal-header">
34+
Logs
35+
<button type="button" className="clear" onClick={clearTerminal}>Clear</button>
36+
<button type="button" className="closelogs" onClick={closeTerminal}>X</button>
37+
</div>
38+
<div className="terminal-body">
39+
{output.split('\n').map((line) => (
40+
<div className="terminal-line">
41+
{line}
42+
</div>
43+
))}
44+
</div>
4145
</div>
4246
</div>
4347
</>

src/component/logs.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
margin: 20px auto;
1717
z-index: 10000;
1818
}
19+
20+
.outlay {
21+
position: absolute;
22+
width: 100vw;
23+
height: 100vh;
24+
z-index: 999;
25+
display: none;
26+
}
1927

2028
.terminal-header {
2129
padding: 5px;

src/component/modals/GraphCompDetails.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ const ModalComp = ({ closeModal, superState, dispatcher }) => {
109109
}
110110
};
111111

112-
const createLibrary = () => {
112+
const createLibrary = (e) => {
113113
const fileName = data.label.split(':')[1];
114114
if (fileName === undefined || fileName === '') {
115115
toast.error('Enter File Name');
116116
return;
117117
}
118118
superState.curGraphInstance.library(fileName);
119+
submit(e);
119120
};
120121

121122
return (

src/config/defaultValidators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ edges.forEach((e) => {
4343
break;
4444
}
4545
}
46-
if (numE === numEdge && numE != "0") {
46+
if (numE === numEdge && numE != "0" && numE !== "") {
4747
message = {
4848
ok: false,
4949
err: '2 edges cannot have same prefixes if they are number',

src/graph-builder/graph-core/5-load-save.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ class GraphLoadSave extends GraphUndoRedo {
121121
const stream = await handle.createWritable();
122122
await stream.write(blob);
123123
await stream.close();
124+
const fileData = await handle.getFile();
125+
let fS = this.superState.fileState;
126+
fS = fS.concat([{
127+
key: `${this.superState.uploadedDirName}/${handle.name}`,
128+
modified: fileData.lastModified,
129+
size: fileData.size,
130+
fileObj: fileData,
131+
fileHandle: handle,
132+
}]);
133+
this.dispatcher({ type: T.SET_FILE_STATE, payload: fS });
124134
} else {
125135
// eslint-disable-next-line no-alert
126136
const fileName = prompt('Filename:');

src/graph-builder/graph-core/6-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GraphServer extends GraphLoadSave {
7979
this.dispatcher({
8080
type: T.SET_FUNCTIONS,
8181
payload: {
82-
built: false, ran: false, debugged: true, cleared: false, stopped: false, destroyed: true,
82+
built: false, ran: true, debugged: true, cleared: false, stopped: false, destroyed: true,
8383
},
8484
});
8585
this.dispatcher({ type: T.SET_LOGS_MESSAGE, payload: this.superState.logsmessage + res.data.output });

0 commit comments

Comments
 (0)