Fixed bug

This commit is contained in:
Luis Fernando Molina committed 2020-09-21 09:36:39 +02:00
1 parent 93e924beb0
commit 243feb43d0
2 files changed
+49 -24

No files matched your search

+4 -4
View File
@@ -11,10 +11,10 @@
<script src="externalScripts/CCapture.all.min.js"></script>
<!-- Documentation Style Sheets -->
<!--
<!-- -->
<link rel="stylesheet" type="text/css"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
-->
<script type="text/javascript">
function loadCanvas() {
try {
@@ -42,9 +42,9 @@
<div id="masterApp"></div>
<div id="canvasApp"></div>
<div id="docApp" style="position:fixed; top:100000px; left:100000px">
<iframe id="docIFrame" style="border:none; " height="2000"
<iframe id="docIFrame" style="border:none; " height="2000" src="https://julian-molina.github.io/Documentation/"
width="900" ></iframe>
</div> <!-- src="https://julian-molina.github.io/Documentation/" -->
</div> <!-- -->
<div id="textAreaDiv"></div>
<div id="inputDiv" style="font-family:saira condensed;">&nbsp;</div>
+45 -20
View File
@@ -518,7 +518,7 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
let fs = require('fs')
try {
let filePath = process.env.WORKSPACE_PATH + 'Workspace.json'
let filePath = process.env.DEFAULT_WORKSPACE_PATH + '/Default.json'
fs.readFile(filePath, onFileRead)
} catch (e) {
console.log('[ERROR] Error reading the Workspace.', e)
@@ -537,30 +537,55 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
case 'ListWorkspaces':
{
let dirPath = process.env.MY_WORKSPACES_PATH
let allWorkspaces = []
readIncludedWorkspaces()
function readIncludedWorkspaces() {
let dirPath = process.env.WORKSPACES_PATH
try {
let fs = require('fs')
fs.readdir(dirPath, onDirRead)
try {
let fs = require('fs')
fs.readdir(dirPath, onDirRead)
function onDirRead(err, fileList) {
if (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
} else {
respondWithContent(JSON.stringify(fileList), response)
return
function onDirRead(err, fileList) {
if (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
} else {
allWorkspaces = allWorkspaces.concat(fileList)
readMyWorkspaces()
return
}
}
} catch (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
}
} catch (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
}
function readMyWorkspaces() {
let dirPath = process.env.MY_WORKSPACES_PATH
try {
let fs = require('fs')
fs.readdir(dirPath, onDirRead)
function onDirRead(err, fileList) {
if (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
} else {
allWorkspaces = allWorkspaces.concat(fileList)
respondWithContent(JSON.stringify(allWorkspaces), response)
return
}
}
} catch (err) {
if (CONSOLE_LOG === true) { console.log('[ERROR] Error reading a directory content. filePath = ' + dirPath) }
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), response)
return
}
}
}
break