Skip to content

Commit

Permalink
fix: bug credentialSecret often is empty
Browse files Browse the repository at this point in the history
ui: adjust tray icon for mac
refactor: logging
  • Loading branch information
sakazuki committed May 19, 2019
1 parent 7cfb545 commit fa94dfc
Showing 6 changed files with 15 additions and 11 deletions.
Binary file added images/node-red-tray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "node-red-desktop",
"productName": "Node-RED-Desktop",
"version": "0.8.7-beta.4",
"version": "0.8.7-beta.5",
"description": "Node-RED Desktop",
"main": "main/main.js",
"scripts": {
4 changes: 2 additions & 2 deletions src/main/config-manager.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ export class ConfigManager {
constructor(name: string) {
this.name = name;
this.data = this.load();
// log.info(">>>>config loaded", this.data);
log.debug(">>>>config loaded", this.data);
}

public getName(): string {
@@ -55,7 +55,7 @@ export class ConfigManager {

public save(): boolean {
const res = storage.set(this.getName(), this.data);
// log.info(">>>>config saved", res);
log.debug(">>>>config saved", res);
if (res.status) {
return true;
} else {
16 changes: 10 additions & 6 deletions src/main/node-red.ts
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ export class NodeREDApp {
userDir: this.status.userDir,
flowFile: this.status.currentFile,
storageModule: CustomStorage,
credentialSecret: app.getName(),
credentialSecret: this.status.credentialSecret,
httpNodeCors: {
origin: "*",
methods: "GET,PUT,POST,DELETE"
@@ -103,17 +103,21 @@ export class NodeREDApp {
level: "debug",
metrics: true,
handler(){
return function(msg: any) {
var m = ({
const electronLogLevel = function(noderedLevel: number): string {
const levelMap: any = {
10: "error",
20: "error",
30: "warn",
40: "info",
60: "verbose",
50: "debug",
// 60: "debug",
60: "verbose",
98: "info",
99: "info"
} as any)[msg.level];
};
return levelMap[noderedLevel];
};
return function(msg: {level: number, msg?: {stack?: object}, type?: string}) {
var m = electronLogLevel(msg.level);
if(m && msg.msg) (log as any)[m](msg.msg);
}
}
2 changes: 1 addition & 1 deletion src/main/tray.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ export class CustomTray {
private red: NodeREDApp;
constructor(red: NodeREDApp) {
this.red = red;
this.tray = new Tray(path.join(__dirname, "..", "images", "node-red-icon.png"));
this.tray = new Tray(path.join(__dirname, "..", "images", "node-red-tray.png"));
const contextMenu = Menu.buildFromTemplate([
{
label: 'Show App',
2 changes: 1 addition & 1 deletion src/renderer/settings.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ ipc.on("settings:set", (event, settings) => {
$("#button-submit").on("click", function(event) {
const data = {
userDir: $("#userdir").val(),
credentailSecret: $("#credentialsecret").val(),
credentialSecret: $("#credentialsecret").val(),
nodesExcludes: $("#nodesexcludes").val(),
projectsEnabled: $("#projects").prop("checked"),
hideOnMinimize: $("#hideonminimize").prop("checked"),

0 comments on commit fa94dfc

Please sign in to comment.