Pluging Multi Project

This commit is contained in:
Luis Fernando Molina committed 2020-10-15 18:52:12 +02:00
1 parent 272ef96415
commit b552807208
3 files changed
+9 -11

No files matched your search

@@ -10,7 +10,7 @@ function newPluginsFunctions() {
return thisObject
function getPluginFileNames(pluginType, callBack) {
callWebServer(undefined, 'PluginFileNames/' + pluginType, onResponse)
callWebServer(undefined, 'PluginFileNames/' + 'Superalgos' + '/' + pluginType, onResponse)
function onResponse(err, data) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
@@ -91,12 +91,12 @@ function newUiObjectsFromNodes() {
for (let i = 0; i < pluginFiles.length; i++) {
let pluginFile = pluginFiles[i]
let name = pluginFile.name
blobService.getFileFromHost(pluginType + '/' + name + '.json', onFileReceived, true)
callWebServer(undefined, 'LoadPlugin' + '/' + 'Superalgos' + '/' + pluginType + '/' + name + '.json', onFileReceived)
function onFileReceived(err, text, response) {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('[WARN] Cannot load plugin ' + pluginType + ' ' + name + '. The workspace will be loaded with this plugin file missing.')
console.log('[WARN] Cannot load plugin ' + pluginType + ' ' + name + '. The Workspace will be loaded with this plugin file missing.')
} else {
let receivedNode = JSON.parse(text)
/*
+6 -8
View File
@@ -100,8 +100,7 @@ function newWorkspace() {
let lastUsedWorkspace = window.localStorage.getItem('Last Used Workspace')
if (lastUsedWorkspace !== 'undefined' && lastUsedWorkspace !== null && lastUsedWorkspace !== undefined) {
let blobService = newFileStorage()
blobService.getFileFromHost('LoadWorkspace' + '/' + lastUsedWorkspace, onFileReceived, true)
callWebServer(undefined, 'LoadMyWorkspace' + '/' + lastUsedWorkspace, onFileReceived)
function onFileReceived(err, text, response) {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
canvas.cockpitSpace.setStatus('Could not load the last Workspace used, called "' + lastUsedWorkspace + '". Will switch to the default Workspace instead.', 500, canvas.cockpitSpace.statusTypes.WARNING)
@@ -142,9 +141,9 @@ function newWorkspace() {
functionLibraryUiObjectsFromNodes.syncronizeTasksFoundAtWorkspaceWithBackEnd(functionLibraryTaskFunctions)
functionLibraryUiObjectsFromNodes.syncronizeSessionsFoundAtWorkspaceWithBackEnd(functionLibrarySessionFunctions)
setTimeout(functionLibraryUiObjectsFromNodes.playTutorials, 1000)
}
function setupEventsServerClients() {
@@ -417,13 +416,12 @@ function newWorkspace() {
let webCommand
if (name.indexOf('Plugin \u2192 ') >= 0) {
name = name.replace('Plugin \u2192 ', '')
webCommand = 'LoadPluginWorkspace'
webCommand = 'LoadPlugin' + '/' + 'Superalgos' + '/' + 'Workspaces' + '/' + name + '.json'
} else {
webCommand = 'LoadWorkspace'
webCommand = 'LoadMyWorkspace' + '/' + name
}
let blobService = newFileStorage()
blobService.getFileFromHost(webCommand + '/' + name, onFileReceived, true)
callWebServer(undefined, webCommand, onFileReceived)
function onFileReceived(err, text, response) {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
canvas.cockpitSpace.setStatus('Could not load the Workspace called "' + name + '". ', 500, canvas.cockpitSpace.statusTypes.WARNING)