From e3f42cbc20ecec8b4e0ed8d453d12ae31197a1d6 Mon Sep 17 00:00:00 2001 From: Martin Alexander Neumann Date: Sat, 11 Apr 2020 20:45:28 +0200 Subject: [PATCH 1/4] Allow config.defaultStorageLimit to be zero bytes --- lib/historyKeeper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/historyKeeper.js b/lib/historyKeeper.js index f70dba006..1fc2a2f2f 100644 --- a/lib/historyKeeper.js +++ b/lib/historyKeeper.js @@ -98,7 +98,7 @@ module.exports.create = function (config, cb) { paths.staging = keyOrDefaultString('blobStagingPath', './blobstage'); paths.blob = keyOrDefaultString('blobPath', './blob'); - Env.defaultStorageLimit = typeof(config.defaultStorageLimit) === 'number' && config.defaultStorageLimit > 0? + Env.defaultStorageLimit = typeof(config.defaultStorageLimit) === 'number' && config.defaultStorageLimit >= 0? config.defaultStorageLimit: Core.DEFAULT_LIMIT; From ca2dc85b3407d63d5fc4b24e55e557ef02479a0c Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 14 Apr 2020 15:17:41 -0400 Subject: [PATCH 2/4] reduce eye-bleed with gentler styles for mermaid charts --- www/common/diffMarked.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index f53828e17..0f0e4a092 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -23,8 +23,17 @@ define([ init: function () {} }; + var mermaidThemeCSS = ".node rect { fill: #DDD; stroke: #AAA; } " + + "rect.task, rect.task0, rect.task2 { stroke-width: 1 !important; rx: 0 !important; } " + + "g.grid g.tick line { opacity: 0.25; }" + + "g.today line { stroke: red; stroke-width: 1; stroke-dasharray: 3; opacity: 0.5; }"; + require(['mermaid', 'css!/code/mermaid-new.css'], function (_Mermaid) { Mermaid = _Mermaid; + Mermaid.initialize({ + gantt: { axisFormat: '%m-%d', }, + "themeCSS": mermaidThemeCSS, + }); }); var highlighter = function () { From 9a7681dc5d6f157e8a99af324cd32c29ddf7474e Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 14 Apr 2020 15:18:20 -0400 Subject: [PATCH 3/4] add a note about handling syntax errors in mermaid --- www/common/diffMarked.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 0f0e4a092..c964ee63e 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -360,6 +360,12 @@ define([ // retrieve the attached source code which it was drawn var src = el.getAttribute('mermaid-source'); +/* The new source might have syntax errors that will prevent rendering. + It might be preferable to keep the existing state instead of removing it + if you don't have something better to display. Ideally we should display + the cause of the syntax error so that the user knows what to correct. */ + //if (!Mermaid.parse(src)) { } // TODO + // check if that source exists in the set of charts which are about to be rendered if (mermaid_source.indexOf(src) === -1) { // if it's not, then you can remove it From 74567e0cf4e90f7abaa5e75ea647e965e3bd331f Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 14 Apr 2020 15:53:58 -0400 Subject: [PATCH 4/4] return process memory usage in GET CACHE STATS RPC --- lib/commands/admin-rpc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/commands/admin-rpc.js b/lib/commands/admin-rpc.js index ed1d5b8a4..db2413518 100644 --- a/lib/commands/admin-rpc.js +++ b/lib/commands/admin-rpc.js @@ -50,6 +50,7 @@ var getCacheStats = function (env, server, cb) { metaSize: metaSize, channel: channelCount, channelSize: channelSize, + memoryUsage: process.memoryUsage(), }); };