mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Provide feedback when enable/disable node fails
This commit is contained in:
		| @@ -690,8 +690,13 @@ RED.palette.editor = (function() { | ||||
|                             if (object.setUseCount[setName] === 0) { | ||||
|                                 var currentSet = RED.nodes.registry.getNodeSet(set.id); | ||||
|                                 shade.show(); | ||||
|                                 changeNodeState(set.id,!currentSet.enabled,shade,function(xhr){ | ||||
|                                     console.log(xhr) | ||||
|                                 var newState = !currentSet.enabled | ||||
|                                 changeNodeState(set.id,newState,shade,function(xhr){ | ||||
|                                     if (xhr) { | ||||
|                                         if (xhr.responseJSON) { | ||||
|                                             RED.notify(RED._('palette.editor.errors.'+(newState?'enable':'disable')+'Failed',{module: id,message:xhr.responseJSON.message})); | ||||
|                                         } | ||||
|                                     } | ||||
|                                 }); | ||||
|                             } | ||||
|                         }) | ||||
| @@ -706,7 +711,11 @@ RED.palette.editor = (function() { | ||||
|                         evt.preventDefault(); | ||||
|                         if (object.totalUseCount === 0) { | ||||
|                             changeNodeState(entry.name,(container.hasClass('disabled')),shade,function(xhr){ | ||||
|                                 console.log(xhr) | ||||
|                                 if (xhr) { | ||||
|                                     if (xhr.responseJSON) { | ||||
|                                         RED.notify(RED._('palette.editor.errors.installFailed',{module: id,message:xhr.responseJSON.message})); | ||||
|                                     } | ||||
|                                 } | ||||
|                             }); | ||||
|                         } | ||||
|                     }) | ||||
|   | ||||
| @@ -316,7 +316,9 @@ | ||||
|                 "catalogLoadFailed": "Failed to load node catalogue.<br>Check the browser console for more information", | ||||
|                 "installFailed": "Failed to install: __module__<br>__message__<br>Check the log for more information", | ||||
|                 "removeFailed": "Failed to remove: __module__<br>__message__<br>Check the log for more information", | ||||
|                 "updateFailed": "Failed to update: __module__<br>__message__<br>Check the log for more information" | ||||
|                 "updateFailed": "Failed to update: __module__<br>__message__<br>Check the log for more information", | ||||
|                 "enableFailed": "Failed to enable: __module__<br>__message__<br>Check the log for more information", | ||||
|                 "disableFailed": "Failed to disable: __module__<br>__message__<br>Check the log for more information" | ||||
|             }, | ||||
|             "confirm": { | ||||
|                 "install": { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user