mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
ac884bfdf3
commit
4fff3ce448
@ -19,11 +19,15 @@ var RED = function() {
|
|||||||
|
|
||||||
function save(force) {
|
function save(force) {
|
||||||
if (RED.view.dirty()) {
|
if (RED.view.dirty()) {
|
||||||
|
|
||||||
if (!force) {
|
if (!force) {
|
||||||
var invalid = false;
|
var invalid = false;
|
||||||
RED.nodes.eachNode(function(node) {
|
RED.nodes.eachNode(function(node) {
|
||||||
invalid = invalid || !node.valid;
|
invalid = invalid || !node.valid;
|
||||||
|
if (node.type === "unknown") {
|
||||||
|
RED.notify('Unknown node type <b>'+node.name+'</b> found',"error");
|
||||||
|
invalid = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
$( "#node-dialog-confirm-deploy" ).dialog( "open" );
|
$( "#node-dialog-confirm-deploy" ).dialog( "open" );
|
||||||
@ -98,13 +102,13 @@ var RED = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showHelp() {
|
function showHelp() {
|
||||||
|
|
||||||
var dialog = $('#node-help');
|
var dialog = $('#node-help');
|
||||||
|
|
||||||
//$("#node-help").draggable({
|
//$("#node-help").draggable({
|
||||||
// handle: ".modal-header"
|
// handle: ".modal-header"
|
||||||
//});
|
//});
|
||||||
|
|
||||||
dialog.on('show',function() {
|
dialog.on('show',function() {
|
||||||
RED.keyboard.disable();
|
RED.keyboard.disable();
|
||||||
});
|
});
|
||||||
@ -114,8 +118,7 @@ var RED = function() {
|
|||||||
|
|
||||||
dialog.modal();
|
dialog.modal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
RED.keyboard.add(/* ? */ 191,{shift:true},function(){showHelp();d3.event.preventDefault();});
|
RED.keyboard.add(/* ? */ 191,{shift:true},function(){showHelp();d3.event.preventDefault();});
|
||||||
loadNodes();
|
loadNodes();
|
||||||
@ -124,4 +127,3 @@ var RED = function() {
|
|||||||
return {
|
return {
|
||||||
};
|
};
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ RED.nodes = function() {
|
|||||||
}
|
}
|
||||||
return {nodes:removedNodes,links:removedLinks};
|
return {nodes:removedNodes,links:removedLinks};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllFlowNodes(node) {
|
function getAllFlowNodes(node) {
|
||||||
var visited = {};
|
var visited = {};
|
||||||
visited[node.id] = true;
|
visited[node.id] = true;
|
||||||
@ -148,7 +149,6 @@ RED.nodes = function() {
|
|||||||
node.x = n.x;
|
node.x = n.x;
|
||||||
node.y = n.y;
|
node.y = n.y;
|
||||||
node.z = n.z;
|
node.z = n.z;
|
||||||
|
|
||||||
node.wires = [];
|
node.wires = [];
|
||||||
for(var i=0;i<n.outputs;i++) {
|
for(var i=0;i<n.outputs;i++) {
|
||||||
node.wires.push([]);
|
node.wires.push([]);
|
||||||
@ -227,11 +227,14 @@ RED.nodes = function() {
|
|||||||
// TODO: remove workspace in next release+1
|
// TODO: remove workspace in next release+1
|
||||||
if (n.type != "workspace" && n.type != "tab" && !getType(n.type)) {
|
if (n.type != "workspace" && n.type != "tab" && !getType(n.type)) {
|
||||||
// TODO: get this UI thing out of here! (see below as well)
|
// TODO: get this UI thing out of here! (see below as well)
|
||||||
RED.notify("<strong>Failed to import node</strong>: unrecognised type '"+n.type+"'<br/>DO NOT DEPLOY while in this state.<br/>Either, add missing types to Node-RED, restart and then reload page,<br/>or delete unknown ( "+n.type+" ), rewire as required, and then deploy.","error","true");
|
|
||||||
//return null; //
|
//return null; //
|
||||||
n.name = "( "+n.type+" )"; // DCJ - mod to make it load, but will lose all "self knowledge".
|
n.name = "( "+n.type+" )"; // DCJ - mod to make it load, but will lose all "self knowledge".
|
||||||
n.type = "unknown"; //
|
n.type = "unknown"; //
|
||||||
}
|
} //
|
||||||
|
if (n.type == "unknown") { //
|
||||||
|
RED.notify("<strong>Failed to import node</strong>: unrecognised type <b>'"+n.name+"'</b><br/>DO NOT DEPLOY while in this state.<br/>Either, add missing types to Node-RED, restart and then reload page,<br/>or delete unknown "+n.name+", rewire as required, and then deploy.","error");
|
||||||
|
} //
|
||||||
|
|
||||||
}
|
}
|
||||||
for (var i in newNodes) {
|
for (var i in newNodes) {
|
||||||
var n = newNodes[i];
|
var n = newNodes[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user