mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add npm install timeout notification
part of https://github.com/node-red/node-red/issues/4622
This commit is contained in:
		| @@ -668,7 +668,8 @@ | ||||
|                     "remove": "Remove", | ||||
|                     "update": "Update" | ||||
|                 } | ||||
|             } | ||||
|             }, | ||||
|             "timeout": "<p>Install continuing the background, Nodes will appear in palette when complete.</p><p>Or you can monitor the install logs</p>" | ||||
|         } | ||||
|     }, | ||||
|     "sidebar": { | ||||
|   | ||||
| @@ -133,7 +133,7 @@ RED.palette.editor = (function() { | ||||
|         }).done(function(data,textStatus,xhr) { | ||||
|             callback(); | ||||
|         }).fail(function(xhr,textStatus,err) { | ||||
|             callback(xhr); | ||||
|             callback(xhr,textStatus,err); | ||||
|         }); | ||||
|     } | ||||
|     function removeNodeModule(id,callback) { | ||||
| @@ -143,7 +143,7 @@ RED.palette.editor = (function() { | ||||
|         }).done(function(data,textStatus,xhr) { | ||||
|             callback(); | ||||
|         }).fail(function(xhr,textStatus,err) { | ||||
|             callback(xhr); | ||||
|             callback(xhr, textStatus, err); | ||||
|         }) | ||||
|     } | ||||
|  | ||||
| @@ -1270,9 +1270,28 @@ RED.palette.editor = (function() { | ||||
|                     RED.actions.invoke("core:show-event-log"); | ||||
|                 }); | ||||
|                 RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+entry.id+" "+entry.version); | ||||
|                 installNodeModule(entry.id,entry.version,entry.pkg_url,function(xhr) { | ||||
|                 installNodeModule(entry.id,entry.version,entry.pkg_url,function(xhr, textStatus,err) { | ||||
|                     spinner.remove(); | ||||
|                      if (xhr) { | ||||
|                      if (err && xhr.status === 504) { | ||||
|                         var notification = RED.notify(RED._("palette.editor.timeout"), { | ||||
|                             modal: true, | ||||
|                             fixed: true, | ||||
|                             buttons: [ | ||||
|                                 { | ||||
|                                     text: RED._("common.label.close"), | ||||
|                                     click: function() { | ||||
|                                         notification.close(); | ||||
|                                     } | ||||
|                                 },{ | ||||
|                                     text: RED._("eventLog.view"), | ||||
|                                     click: function() { | ||||
|                                         notification.close(); | ||||
|                                         RED.actions.invoke("core:show-event-log"); | ||||
|                                     } | ||||
|                                 } | ||||
|                             ] | ||||
|                         }) | ||||
|                      } else if (xhr) { | ||||
|                          if (xhr.responseJSON) { | ||||
|                              var notification = RED.notify(RED._('palette.editor.errors.installFailed',{module: entry.id,message:xhr.responseJSON.message}),{ | ||||
|                                  type: 'error', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user