Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iot_test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wubi
iot_test
Commits
b9eb138d
Commit
b9eb138d
authored
Jun 06, 2025
by
wubi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化测试模板添加
parent
ff1a29d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
83 deletions
+90
-83
red.min.js
...ode_modules/@node-red/editor-client/public/red/red.min.js
+90
-83
No files found.
nr/node-red/packages/node_modules/@node-red/editor-client/public/red/red.min.js
View file @
b9eb138d
...
@@ -437,6 +437,7 @@ var RED = (function() {
...
@@ -437,6 +437,7 @@ var RED = (function() {
let request_type = "GET";
let request_type = "GET";
const flowId = getId();
const flowId = getId();
RED.nodes.currentNodeId = flowId;
RED.nodes.currentNodeId = flowId;
console.log("#################flowId:",flowId);
if(flowId!=null){
if(flowId!=null){
//load_url = `http://192.168.0.113:1909/getflows?id=${getId()}`
//load_url = `http://192.168.0.113:1909/getflows?id=${getId()}`
...
@@ -75566,9 +75567,10 @@ const getId=()=>{
...
@@ -75566,9 +75567,10 @@ const getId=()=>{
}
}
async function saveNode(){
async function saveNode(){
console.log("save
"
);
console.log("save
:",RED.nodes.currentNodeId
);
const nns = RED.nodes.createCompleteNodeSet();
const nns = RED.nodes.createCompleteNodeSet();
const data = { id:RED.nodes.currentNodeId,label:nns[0].label,flows: nns };
const data = { id:RED.nodes.currentNodeId,label:nns[0].label,flows: nns };
//先查询是否存在
//先查询是否存在
let token = await window.iotAPI.getToken();
let token = await window.iotAPI.getToken();
$.ajax({
$.ajax({
...
@@ -75635,6 +75637,13 @@ async function saveNode(){
...
@@ -75635,6 +75637,13 @@ async function saveNode(){
tmpId = templateIdMatch[1]
tmpId = templateIdMatch[1]
RED.nodes.templateId = tmpId
RED.nodes.templateId = tmpId
console.log(`add id:${tmpId}`);
console.log(`add id:${tmpId}`);
}
var json = JSON.parse(data);
if(json.success){
RED.nodes.dirty(false);
RED.nodes.dirty(false);
//RED.nodes.version(data.rev);
//RED.nodes.version(data.rev);
RED.nodes.originalFlow(nns);
RED.nodes.originalFlow(nns);
...
@@ -75716,10 +75725,8 @@ async function saveNode(){
...
@@ -75716,10 +75725,8 @@ async function saveNode(){
RED.sidebar.config.refresh();
RED.sidebar.config.refresh();
RED.events.emit("deploy");
RED.events.emit("deploy");
}else{
}else{
var json = JSON.parse(data);
window.alert(json.errorMessage);
window.alert(json.errorMessage);
}
}
})
})
}});
}});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment