diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
index e3028272b..b25885e21 100755
--- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
+++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
@@ -288,6 +288,17 @@
"copyMessageValue": "Value copied",
"copyMessageValue_truncated": "Truncated value copied"
},
+ "stopstart":{
+ "status": {
+ "state_changed": "Flows runtime has been changed to '__state__' state"
+ },
+ "errors": {
+ "notAllowed": "Method not allowed",
+ "notAuthorized": "Not authorized",
+ "notFound": "Not found",
+ "noResponse": "No response from server"
+ }
+ },
"deploy": {
"deploy": "Deploy",
"full": "Full",
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js
index 3766763c7..46408cb6c 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js
@@ -297,41 +297,51 @@ RED.deploy = (function() {
$(".red-ui-deploy-button-spinner").hide();
}
function stopStartFlows(state) {
- const startTime = Date.now();
- const deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled");
- deployInflight = true;
- deployButtonSetBusy();
- shadeShow();
- RED.runtime.updateState(state);
+ const startTime = Date.now()
+ const deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled")
+ deployInflight = true
+ deployButtonSetBusy()
+ shadeShow()
+ RED.runtime.updateState(state)
$.ajax({
url:"flows/state",
type: "POST",
data: {state: state}
}).done(function(data,textStatus,xhr) {
if (deployWasEnabled) {
- $("#red-ui-header-button-deploy").removeClass("disabled");
+ $("#red-ui-header-button-deploy").removeClass("disabled")
}
- RED.runtime.updateState((data && data.state) || "unknown" )
- RED.notify('
Done
',"success");
+ RED.runtime.updateState((data && data.state) || "unknown")
+ RED.notify(RED._("stopstart.status.state_changed", data), "success")
}).fail(function(xhr,textStatus,err) {
if (deployWasEnabled) {
- $("#red-ui-header-button-deploy").removeClass("disabled");
+ $("#red-ui-header-button-deploy").removeClass("disabled")
}
if (xhr.status === 401) {
- RED.notify("Not authorized" ,"error");
+ RED.notify(RED._("notification.error", { message: RED._("stopstart.errors.notAuthorized") }), "error")
+ } else if (xhr.status === 404) {
+ RED.notify(RED._("notification.error", { message: RED._("stopstart.errors.notFound") }), "error")
+ } else if (xhr.status === 405) {
+ RED.notify(RED._("notification.error", { message: RED._("stopstart.errors.notAllowed") }), "error")
} else if (xhr.responseText) {
- RED.notify("Operation failed: " + xhr.responseText,"error");
+ const errorDetail = { message: err ? (err + "") : "" }
+ try {
+ errorDetail.message = JSON.parse(xhr.responseText).message
+ } finally {
+ errorDetail.message = errorDetail.message || xhr.responseText
+ }
+ RED.notify(RED._("notification.error", errorDetail), "error")
} else {
- RED.notify("Operation failed: no response","error");
+ RED.notify(RED._("notification.error", { message: RED._("stopstart.errors.noResponse") }), "error")
}
RED.runtime.requestState()
}).always(function() {
- const delta = Math.max(0,300-(Date.now()-startTime));
- setTimeout(function() {
- deployButtonClearBusy();
+ const delta = Math.max(0, 300 - (Date.now() - startTime))
+ setTimeout(function () {
+ deployButtonClearBusy()
shadeHide()
- deployInflight = false;
- },delta);
+ deployInflight = false
+ }, delta);
});
}
function restart() {
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view_copy.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view_copy.js
new file mode 100644
index 000000000..569fee1d5
--- /dev/null
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view_copy.js
@@ -0,0 +1,6287 @@
+/**
+ * Copyright JS Foundation and other contributors, http://js.foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+
+ /* #red-ui-workspace-chart
+ * \-