Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 2e1a42f

Browse files
committed
Disable the toolbar and display devtool if DIGEXP_DEBUG is set
1 parent 09936d6 commit 2e1a42f

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

digexp-dashboard/js/dashConfig.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ var dashConfig = (function(){
4848
setConfigInfo: function(newConfig) {
4949
configInfo = configInfo || getConfigInfo();
5050

51-
fs.exists("./dashboard-config.json", function (exists) {
52-
if (exists) {
53-
copyObj(configInfo, newConfig);
54-
configInfo.servers.forEach(function(server){
55-
if(server.password)
56-
server.password = encrypt( server.password );
57-
});
58-
fs.writeFile("./dashboard-config.json", JSON.stringify(configInfo, null, ' '));
59-
}
60-
});
51+
if(fs.existsSync("./dashboard-config.json")) {
52+
copyObj(configInfo, newConfig);
53+
configInfo.servers.forEach(function(server){
54+
if(server.password)
55+
server.password = encrypt( server.password );
56+
});
57+
fs.writeFileSync("./dashboard-config.json", JSON.stringify(configInfo, null, ' '));
58+
configInfo.servers.forEach(function(server){
59+
if(server.password)
60+
server.password = decrypt( server.password );
61+
});
62+
};
6163
}
6264
,getServerInfo: function(name){
6365
if(configInfo == "")

digexp-dashboard/js/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ var tracer = require("tracer"),
1313
debugEnvironmentVar = process.env.DIGEXP_DEBUG || '',
1414
debugNames = debugEnvironmentVar.toUpperCase().split(','),
1515
debugFunctions = {};
16+
if(debugEnvironmentVar.length != 0)
17+
require('nw.gui').Window.get().showDevTools();
1618

1719
function debugLogger(moduleName) {
1820
moduleName = moduleName.toUpperCase();

digexp-dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"window": {
1010
"show": true,
11-
"toolbar": true,
11+
"toolbar": false,
1212
"frame": true,
1313
"position": "center",
1414
"title": "Web Developer Dashboard for IBM Digital Experience",

0 commit comments

Comments
 (0)