mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow a project's flow file to be changed
This commit is contained in:
@@ -33,6 +33,7 @@ function handleStatus(event) {
|
||||
publish("status/"+event.id,event.status,true);
|
||||
}
|
||||
function handleRuntimeEvent(event) {
|
||||
log.trace("runtime event: "+JSON.stringify(event));
|
||||
publish("notification/"+event.id,event.payload||{},event.retain);
|
||||
}
|
||||
function init(_server,runtime) {
|
||||
|
@@ -85,7 +85,8 @@
|
||||
"nodeActionDisabled": "node actions disabled within subflow",
|
||||
"missing-types": "Flows stopped due to missing node types. Check logs for details.",
|
||||
"restartRequired": "Node-RED must be restarted to enable upgraded modules",
|
||||
"invalid-credentials-secret": "Flows stopped due to missing or invalid credentialSecret"
|
||||
"credentials_load_failed": "Flows stopped due to missing or invalid credentialSecret",
|
||||
"missing_flow_file": "Could not find the project flow file"
|
||||
},
|
||||
|
||||
"error": "<strong>Error</strong>: __message__",
|
||||
|
@@ -77,14 +77,15 @@ module.exports = {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
res.redirect(303,req.baseUrl + '/');
|
||||
res.redirect(303,req.baseUrl + '/'+ req.params.id);
|
||||
}
|
||||
} else if (req.body.hasOwnProperty('credentialSecret') ||
|
||||
req.body.hasOwnProperty('description') ||
|
||||
req.body.hasOwnProperty('dependencies')||
|
||||
req.body.hasOwnProperty('summary')) {
|
||||
req.body.hasOwnProperty('summary') ||
|
||||
req.body.hasOwnProperty('files')) {
|
||||
runtime.storage.projects.updateProject(req.params.id, req.body).then(function() {
|
||||
res.redirect(303,req.baseUrl + '/');
|
||||
res.redirect(303,req.baseUrl + '/'+ req.params.id);
|
||||
}).catch(function(err) {
|
||||
if (err.code) {
|
||||
res.status(400).json({error:err.code, message: err.message});
|
||||
@@ -92,6 +93,8 @@ module.exports = {
|
||||
res.status(400).json({error:"unexpected_error", message:err.toString()});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
res.status(400).json({error:"unexpected_error", message:"invalid_request"});
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user