Commit b9eb138d authored by wubi's avatar wubi

优化测试模板添加

parent ff1a29d6
......@@ -437,6 +437,7 @@ var RED = (function() {
let request_type = "GET";
const flowId = getId();
RED.nodes.currentNodeId = flowId;
console.log("#################flowId:",flowId);
if(flowId!=null){
//load_url = `http://192.168.0.113:1909/getflows?id=${getId()}`
......@@ -75566,9 +75567,10 @@ const getId=()=>{
}
async function saveNode(){
console.log("save");
console.log("save:",RED.nodes.currentNodeId);
const nns = RED.nodes.createCompleteNodeSet();
const data = { id:RED.nodes.currentNodeId,label:nns[0].label,flows: nns };
//先查询是否存在
let token = await window.iotAPI.getToken();
$.ajax({
......@@ -75635,6 +75637,13 @@ async function saveNode(){
tmpId = templateIdMatch[1]
RED.nodes.templateId = tmpId
console.log(`add id:${tmpId}`);
}
var json = JSON.parse(data);
if(json.success){
RED.nodes.dirty(false);
//RED.nodes.version(data.rev);
RED.nodes.originalFlow(nns);
......@@ -75716,10 +75725,8 @@ async function saveNode(){
RED.sidebar.config.refresh();
RED.events.emit("deploy");
}else{
var json = JSON.parse(data);
window.alert(json.errorMessage);
}
})
}});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment