',{class:"palette_node palette_node_small"}).appendTo(div);
+ var colour = configNode._def.color;
+ var icon_url = RED.utils.getNodeIcon(configNode._def);
+ nodeDiv.css({'backgroundColor':colour, "cursor":"pointer"});
+ var iconContainer = $('
',{class:"palette_icon_container"}).appendTo(nodeDiv);
+ $('
',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
+ var nodeContainer = $('
').css({"verticalAlign":"top","marginLeft":"6px"}).html(configLabel).appendTo(container);
+
+ nodeDiv.on('dblclick',function() {
+ RED.editor.editConfig("", configNode.type, configNode.id);
+ })
+
+ }
+ } else {
+ RED.utils.createObjectElement(val).appendTo(propRow.children()[1]);
+ }
+ }
+ }
+ if (count > 0) {
+ $('
'+RED._("sidebar.info.showMore")+''+RED._("sidebar.info.showLess")+' |
').appendTo(tableBody);
+ }
+ }
+ }
+ if (node.type !== 'tab') {
+ if (m) {
+ $('
'+RED._("sidebar.info.subflow")+' |
---|
').appendTo(tableBody);
+ $('
'+RED._("common.label.name")+' | '+subflowNode.name+' |
').appendTo(tableBody);
+ }
+ }
+ }
+ if (m) {
+ $('
'+RED._("sidebar.info.instances")+" | "+subflowUserCount+' |
').appendTo(tableBody);
+ }
+
+ var infoText = "";
+ if (!subflowNode && node.type !== "comment" && node.type !== "tab") {
+ infoSection.title.html(RED._("sidebar.info.nodeHelp"));
+ var helpText = $("script[data-help-name='"+node.type+"']").html()||('
'+RED._("sidebar.info.none")+'');
+ infoText = helpText;
+ } else if (node.type === "tab") {
+ infoSection.title.html(RED._("sidebar.info.flowDesc"));
+ infoText = marked(node.info||"")||('
'+RED._("sidebar.info.none")+'');
+ }
+
+ if (subflowNode) {
+ infoText = infoText + (marked(subflowNode.info||"")||('
'+RED._("sidebar.info.none")+''));
+ infoSection.title.html(RED._("sidebar.info.subflowDesc"));
+ } else if (node._def && node._def.info) {
+ infoSection.title.html(RED._("sidebar.info.nodeHelp"));
+ var info = node._def.info;
+ var textInfo = (typeof info === "function" ? info.call(node) : info);
+ // TODO: help
+ infoText = infoText + marked(textInfo);
+ }
+ if (infoText) {
+ setInfoText(infoText);
+ }
+
+
+ $(".node-info-property-header").click(function(e) {
+ e.preventDefault();
+ expandedSections["property"] = !expandedSections["property"];
+ $(this).toggleClass("expanded",expandedSections["property"]);
+ $(".node-info-property-row").toggle(expandedSections["property"]);
+ });
}
- $(table).appendTo(nodeSection.content);
-
- var infoText = "";
-
- if (!subflowNode && node.type !== "comment" && node.type !== "tab") {
- var helpText = $("script[data-help-name='"+node.type+"']").html()||"";
- infoText = helpText;
- } else if (node.type === "tab") {
- infoText = marked(node.info||"");
- }
-
- if (subflowNode) {
- infoText = infoText + marked(subflowNode.info||"");
- } else if (node._def && node._def.info) {
- var info = node._def.info;
- var textInfo = (typeof info === "function" ? info.call(node) : info);
- // TODO: help
- infoText = infoText + marked(textInfo);
- }
- if (infoText) {
- setInfoText(infoText);
- }
-
-
- $(".node-info-property-header").click(function(e) {
- e.preventDefault();
- expandedSections["property"] = !expandedSections["property"];
- $(this).toggleClass("expanded",expandedSections["property"]);
- $(".node-info-property-row").toggle(expandedSections["property"]);
- });
}
function setInfoText(infoText) {
var info = addTargetToExternalLinks($('
'+infoText+'
')).appendTo(infoSection.content);
@@ -342,14 +356,16 @@ RED.sidebar.info = (function() {
})();
function clear() {
- sections.hide();
- //
+ // sections.hide();
+ refresh();
}
- function set(html) {
+ function set(html,title) {
// tips.stop();
- sections.show();
- nodeSection.container.hide();
+ // sections.show();
+ // nodeSection.container.hide();
+ infoSection.title.text(title||"");
+ refresh();
$(infoSection.content).empty();
setInfoText(html);
$(".sidebar-node-info-stack").scrollTop(0);
@@ -366,6 +382,8 @@ RED.sidebar.info = (function() {
} else {
refresh(node);
}
+ } else {
+ refresh(selection.nodes);
}
} else {
var activeWS = RED.workspaces.active();
@@ -378,7 +396,8 @@ RED.sidebar.info = (function() {
if (workspace && workspace.info) {
refresh(workspace);
} else {
- clear();
+ refresh()
+ // clear();
}
}
}
diff --git a/editor/js/ui/view.js b/editor/js/ui/view.js
index 453066f58..c83abf9d2 100644
--- a/editor/js/ui/view.js
+++ b/editor/js/ui/view.js
@@ -396,10 +396,10 @@ RED.view = (function() {
}
});
$("#chart").focus(function() {
- $("#workspace-tabs").addClass("workspace-focussed")
+ $("#workspace-tabs").addClass("workspace-focussed");
});
$("#chart").blur(function() {
- $("#workspace-tabs").removeClass("workspace-focussed")
+ $("#workspace-tabs").removeClass("workspace-focussed");
});
RED.actions.add("core:copy-selection-to-internal-clipboard",copySelection);
diff --git a/editor/js/ui/workspaces.js b/editor/js/ui/workspaces.js
index 3d880e2a2..1f3b3c52e 100644
--- a/editor/js/ui/workspaces.js
+++ b/editor/js/ui/workspaces.js
@@ -244,10 +244,16 @@ RED.workspaces = (function() {
if (tab.disabled) {
$("#red-ui-tab-"+(tab.id.replace(".","-"))).addClass('workspace-disabled');
}
- RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() == 1);
+ RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() <= 1);
+ if (workspace_tabs.count() === 1) {
+ showWorkspace();
+ }
},
onremove: function(tab) {
- RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() == 1);
+ RED.menu.setDisabled("menu-item-workspace-delete",workspace_tabs.count() <= 1);
+ if (workspace_tabs.count() === 0) {
+ hideWorkspace();
+ }
},
onreorder: function(oldOrder, newOrder) {
RED.history.push({t:'reorder',order:oldOrder,dirty:RED.nodes.dirty()});
@@ -261,6 +267,16 @@ RED.workspaces = (function() {
}
});
}
+ function showWorkspace() {
+ $("#workspace .red-ui-tabs").show()
+ $("#chart").show()
+ $("#workspace-footer").children().show()
+ }
+ function hideWorkspace() {
+ $("#workspace .red-ui-tabs").hide()
+ $("#chart").hide()
+ $("#workspace-footer").children().hide()
+ }
function init() {
createWorkspaceTabs();
@@ -280,6 +296,8 @@ RED.workspaces = (function() {
RED.actions.add("core:add-flow",addWorkspace);
RED.actions.add("core:edit-flow",editWorkspace);
RED.actions.add("core:remove-flow",removeWorkspace);
+
+ hideWorkspace();
}
function editWorkspace(id) {
diff --git a/editor/sass/notifications.scss b/editor/sass/notifications.scss
index 80640dd28..7f1fe4f43 100644
--- a/editor/sass/notifications.scss
+++ b/editor/sass/notifications.scss
@@ -15,7 +15,7 @@
**/
#notifications {
- z-index: 10000;
+ z-index: 100;
width: 500px;
margin-left: -250px;
left: 50%;
diff --git a/editor/sass/palette-editor.scss b/editor/sass/palette-editor.scss
index 48e007e10..0c83071b3 100644
--- a/editor/sass/palette-editor.scss
+++ b/editor/sass/palette-editor.scss
@@ -95,29 +95,6 @@
.palette-module-shade-status {
color: #666;
}
-
- .palette-module-meta {
- color: #666;
- position: relative;
- &.disabled {
- color: #ccc;
- }
-
- .fa {
- width: 15px;
- text-align: center;
- margin-right: 5px;
- }
- }
- .palette-module-name {
- white-space: nowrap;
- @include enable-selection;
- }
- .palette-module-version, .palette-module-updated, .palette-module-link {
- font-style:italic;
- font-size: 0.8em;
- @include enable-selection;
- }
.palette-module-updated {
margin-left: 10px;
}
@@ -224,3 +201,32 @@
}
}
+.palette-module-meta {
+ color: #666;
+ position: relative;
+ &.disabled {
+ color: #ccc;
+ }
+
+ .fa {
+ width: 15px;
+ text-align: center;
+ margin-right: 5px;
+ }
+}
+.palette-module-name {
+ white-space: nowrap;
+ @include enable-selection;
+}
+.palette-module-version, .palette-module-updated, .palette-module-link {
+ font-style:italic;
+ font-size: 0.8em;
+ @include enable-selection;
+}
+.palette-module-section {
+ padding:0 !important;
+ background: #f9f9f9 !important;
+ font-size: 0.9em;
+ color: #666;
+
+}
diff --git a/editor/sass/projects.scss b/editor/sass/projects.scss
new file mode 100644
index 000000000..e0ee31cf6
--- /dev/null
+++ b/editor/sass/projects.scss
@@ -0,0 +1,233 @@
+/**
+ * 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.
+ **/
+
+#projects-dialog {
+ .red-ui-editableList-container {
+ padding: 0px;
+ }
+
+}
+.projects-edit-form form {
+ margin: 0;
+ .form-row {
+ margin-bottom: 20px;
+ label {
+ width: auto;
+ display: block;
+ }
+ input[type=text], input[type=password],textarea {
+ width: 100%;
+ }
+ input[type=checkbox], input[type=radio] {
+ width: auto;
+ vertical-align: top;
+ } }
+}
+.projects-dialog-spinner {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ text-align: center;
+ padding: 40px;
+ background: white;
+ &:before {
+ content: '';
+ display: inline-block;
+ height: 100%;
+ vertical-align: middle;
+ margin-right: -0.25em;
+ }
+ img {
+ display: inline-block;
+ vertical-align: middle;
+ width: 80px;
+ }
+ &.projects-dialog-spinner-sidebar {
+ padding: 20px;
+ background: $shade-color;
+ img {
+ width: 50px;
+ }
+ }
+
+
+}
+.projects-dialog-screen-start {
+ button.editor-button {
+ width: calc(50% - 40px);
+ margin: 20px;
+ height: 200px;
+ line-height: 2em;
+ font-size: 1.5em !important;
+ i {
+ color: #ccc;
+ }
+ &:hover i {
+ color: #aaa;
+ }
+ }
+ .button-group {
+ text-align: center;
+ }
+}
+.projects-dialog-screen-create {
+ min-height: 500px;
+ button.editor-button {
+ height: auto;
+ padding: 10px;
+
+ }
+ .button-group {
+ text-align: center;
+ }
+}
+
+.projects-dialog-screen-secret {
+ min-height: auto;
+}
+.projects-dialog-project-list {
+ li {
+ padding: 0 !important;
+ }
+ &.projects-dialog-project-list-small {
+ .projects-dialog-project-list-entry {
+ padding: 6px 0;
+ i {
+ font-size: 1em;
+ }
+ }
+ .projects-dialog-project-list-entry-name {
+ font-size: 1em;
+ }
+ .projects-dialog-project-list-entry-current {
+ margin-right: 10px;
+ padding-top: 2px;
+ }
+ }
+
+}
+.projects-dialog-project-list-entry {
+ padding: 12px 0;
+ border-left: 3px solid #fff;
+ border-right: 3px solid #fff;
+ &.projects-list-entry-current {
+ &:not(.selectable) {
+ background: #f9f9f9;
+ }
+ i {
+ color: #999;
+ }
+ }
+ &.selectable {
+ cursor: pointer;
+ &:hover {
+ background: #f3f3f3;
+ border-left-color: #aaa;
+ border-right-color: #aaa;
+ }
+ }
+
+ i {
+ color: #ccc;
+ font-size: 2em;
+
+ }
+ &.selected {
+ background: #efefef;
+ border-left-color:#999;
+ border-right-color:#999;
+ }
+ span {
+ display: inline-block;
+ vertical-align:middle;
+ }
+ .projects-dialog-project-list-entry-icon {
+ margin: 0 10px 0 5px;
+ }
+ .projects-dialog-project-list-entry-name {
+ font-size: 1.2em;
+ }
+ .projects-dialog-project-list-entry-current {
+ float: right;
+ margin-right: 20px;
+ font-size: 0.9em;
+ color: #999;
+ padding-top: 4px;
+ }
+}
+
+
+.sidebar-projects {
+ height: 100%;
+}
+.sidebar-projects-stack-info {
+ height: 100px;
+ box-sizing: border-box;
+ border-bottom: 1px solid $secondary-border-color;
+ color: #333;
+ i {
+ color: #999;
+ }
+}
+.sidebar-projects-stack {
+ position: absolute;
+ top: 100px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ overflow-y: scroll;
+
+ .palette-category {
+ &:not(.palette-category-expanded) button {
+ display: none;
+ }
+ }
+}
+
+.sidebar-projects-dependencies {
+ position: relative;
+ height: 100%;
+ .red-ui-editableList-container {
+ padding: 0;
+ }
+ .red-ui-editableList-border {
+ border: none;
+ border-radius: 0;
+ }
+ .red-ui-editableList-item-content {
+ padding: 0px 6px;
+ }
+ .palette-module-header {
+ padding: 6px 4px;
+ }
+ .palette-module-button {
+ float: right;
+ }
+ .palette-module-unused {
+ & > * {
+ color: #bbb;
+ }
+ // border: 1px dashed #bbb;
+ }
+ .palette-module-unknown {
+ // border: 1px dashed #b72828;
+ i.fa-warning {
+ color: #b07575; //#b72828;
+ }
+ }
+}
diff --git a/editor/sass/style.scss b/editor/sass/style.scss
index ed683bb8c..5d536c742 100644
--- a/editor/sass/style.scss
+++ b/editor/sass/style.scss
@@ -48,12 +48,15 @@
@import "userSettings";
+@import "projects";
+
@import "ui/common/editableList";
@import "ui/common/searchBox";
@import "ui/common/typedInput";
@import "ui/common/nodeList";
@import "ui/common/checkboxSet";
+@import "ui/common/stack";
@import "dragdrop";
diff --git a/editor/sass/tab-info.scss b/editor/sass/tab-info.scss
index 8b8e0377c..cd278e445 100644
--- a/editor/sass/tab-info.scss
+++ b/editor/sass/tab-info.scss
@@ -87,12 +87,16 @@ table.node-info tr.blank {
padding-left: 5px;
}
}
-
+.node-info-none {
+ font-style: italic;
+ color: #aaa;
+}
table.node-info tr:not(.blank) td:first-child{
- color: #666;
+ color: #444;
vertical-align: top;
width: 90px;
padding: 3px 3px 3px 6px;
+ background:#f9f9f9;
border-right: 1px solid #ddd;
}
table.node-info tr:not(.blank) td:last-child{
diff --git a/editor/sass/ui/common/stack.scss b/editor/sass/ui/common/stack.scss
new file mode 100644
index 000000000..96a5798d6
--- /dev/null
+++ b/editor/sass/ui/common/stack.scss
@@ -0,0 +1,22 @@
+/**
+ * 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-stack {
+ background: white;
+ .palette-category {
+ background: white;
+ }
+}
diff --git a/editor/templates/index.mst b/editor/templates/index.mst
index 21c5a6376..4a8abe80b 100644
--- a/editor/templates/index.mst
+++ b/editor/templates/index.mst
@@ -209,6 +209,14 @@
+
+
diff --git a/nodes/core/io/10-mqtt.js b/nodes/core/io/10-mqtt.js
index b01df652b..f57e8cc79 100644
--- a/nodes/core/io/10-mqtt.js
+++ b/nodes/core/io/10-mqtt.js
@@ -120,6 +120,8 @@ module.exports = function(RED) {
tlsNode.addTLSOptions(this.options);
}
}
+ console.log(this.brokerurl,this.options);
+
// If there's no rejectUnauthorized already, then this could be an
// old config where this option was provided on the broker node and
// not the tls node
@@ -164,6 +166,7 @@ module.exports = function(RED) {
};
this.connect = function () {
+ console.log("CONNECT");
if (!node.connected && !node.connecting) {
node.connecting = true;
node.client = mqtt.connect(node.brokerurl ,node.options);
diff --git a/red/api/admin/info.js b/red/api/admin/info.js
index 83b16210f..8a5efa0ff 100644
--- a/red/api/admin/info.js
+++ b/red/api/admin/info.js
@@ -20,7 +20,6 @@ var settings;
module.exports = {
init: function(_runtime) {
- console.log("info.init");
runtime = _runtime;
settings = runtime.settings;
},
diff --git a/red/api/editor/index.js b/red/api/editor/index.js
index c236bbb26..20461ee52 100644
--- a/red/api/editor/index.js
+++ b/red/api/editor/index.js
@@ -66,10 +66,10 @@ module.exports = {
editorApp.use("/theme",theme.app());
editorApp.use("/",ui.editorResources);
- // //Projects
- // var projects = require("./projects");
- // projects.init(runtime);
- // editorApp.get("/projects",projects.app());
+ //Projects
+ var projects = require("./projects");
+ projects.init(runtime);
+ editorApp.use("/projects",projects.app());
// Locales
var locales = require("./locales");
diff --git a/red/api/editor/locales/en-US/editor.json b/red/api/editor/locales/en-US/editor.json
index 4fd50f177..7ed7f574f 100644
--- a/red/api/editor/locales/en-US/editor.json
+++ b/red/api/editor/locales/en-US/editor.json
@@ -84,7 +84,8 @@
"undeployedChanges": "node has undeployed changes",
"nodeActionDisabled": "node actions disabled within subflow",
"missing-types": "Flows stopped due to missing node types. Check logs for details.",
- "restartRequired": "Node-RED must be restarted to enable upgraded modules"
+ "restartRequired": "Node-RED must be restarted to enable upgraded modules",
+ "invalid-credentials-secret": "Flows stopped due to missing or invalid credentialSecret"
},
"error": "