mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Use jquery ajax rather than d3
This commit is contained in:
parent
42cd6f94a7
commit
66005a2688
@ -477,22 +477,24 @@
|
|||||||
var label = (this.name||this.payload).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
var label = (this.name||this.payload).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||||
if (this.payloadType === "date") { label = "timestamp"; }
|
if (this.payloadType === "date") { label = "timestamp"; }
|
||||||
if (this.payloadType === "none") { label = "blank"; }
|
if (this.payloadType === "none") { label = "blank"; }
|
||||||
d3.xhr("inject/"+this.id).post(function(err,resp) {
|
|
||||||
if (err) {
|
$.ajax({
|
||||||
if (err.status == 404) {
|
url: "inject/"+this.id,
|
||||||
RED.notify("<strong>Error</strong>: inject node not deployed","error");
|
type:"POST",
|
||||||
} else if (err.status == 500) {
|
success: function(resp) {
|
||||||
RED.notify("<strong>Error</strong>: inject failed, see log for details.","error");
|
RED.notify("Successfully injected: "+label,"success");
|
||||||
} else if (err.status == 0) {
|
},
|
||||||
RED.notify("<strong>Error</strong>: no response from server","error");
|
error: function(jqXHR,textStatus,errorThrown) {
|
||||||
} else {
|
if (jqXHR.status == 404) {
|
||||||
RED.notify("<strong>Error</strong>: unexpected error: ("+err.status+")"+err.response,"error");
|
RED.notify("<strong>Error</strong>: inject node not deployed","error");
|
||||||
}
|
} else if (jqXHR.status == 500) {
|
||||||
} else if (resp.status == 200) {
|
RED.notify("<strong>Error</strong>: inject failed, see log for details.","error");
|
||||||
RED.notify("Successfully injected: "+label,"success");
|
} else if (jqXHR.status == 0) {
|
||||||
|
RED.notify("<strong>Error</strong>: no response from server","error");
|
||||||
} else {
|
} else {
|
||||||
RED.notify("<strong>Error</strong>: unexpected response: ("+resp.status+") "+resp.response,"error");
|
RED.notify("<strong>Error</strong>: unexpected error: ("+jqXHR.status+")"+textStatus,"error");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user