Save workspace at Backend

This commit is contained in:
Luis Fernando Molina committed 2020-05-11 17:16:46 +02:00
1 parent 1855b1eb7f
commit 99e233cd3f
1 file changed
+13
+13
View File
@@ -170,6 +170,19 @@ function newWorkspace () {
let textToSave = stringifyWorkspace()
window.localStorage.setItem(CANVAS_APP_NAME + '.' + 'Workspace', textToSave)
window.localStorage.setItem('Session Timestamp', sessionTimestamp)
let url = 'SaveWorkspace/' + workspace.name
callServer(textToSave, url, onResponse)
function onResponse (err) {
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
window.localStorage.setItem('Last Used Workspace', workspace.name)
window.localStorage.setItem('Session Timestamp', sessionTimestamp)
canvas.cockpitSpace.setStatus('Workspace Auto-Saved.', 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
} else {
canvas.cockpitSpace.setStatus('Could not save the Workspace at the Backend. Please check the Backend Console for more information.', 150, canvas.cockpitSpace.statusTypes.WARNING)
}
}
return true
}
}