dcp-worker 3.2.30-4 → 3.2.30-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/dashboard-tui.js
CHANGED
|
@@ -62,6 +62,47 @@ exports.init = function dashboard$$init(worker, options)
|
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
+
const passwordBox = blessed.textbox({
|
|
66
|
+
parent: screen,
|
|
67
|
+
border: 'line',
|
|
68
|
+
top: 'center',
|
|
69
|
+
left: 'center',
|
|
70
|
+
width: '50%',
|
|
71
|
+
height: 'shrink',
|
|
72
|
+
padding: {
|
|
73
|
+
top: 1
|
|
74
|
+
},
|
|
75
|
+
censor: true,
|
|
76
|
+
inputOnFocus: true,
|
|
77
|
+
label: 'Password Prompt:',
|
|
78
|
+
hidden: true,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
function askPassword(promptMessage)
|
|
82
|
+
{
|
|
83
|
+
return new Promise((resolve, reject) => {
|
|
84
|
+
passwordBox.focus();
|
|
85
|
+
passwordBox.show();
|
|
86
|
+
passwordBox.setLabel(promptMessage);
|
|
87
|
+
|
|
88
|
+
function passwordSubmitFn(value)
|
|
89
|
+
{
|
|
90
|
+
passwordBox.hide();
|
|
91
|
+
passwordBox.removeListener('submit', passwordSubmitFn);
|
|
92
|
+
passwordBox.setValue('');
|
|
93
|
+
resolve(value);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
passwordBox.on('submit', passwordSubmitFn);
|
|
97
|
+
screen.render();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// override wallet.passphrasePrompt with password box
|
|
102
|
+
require('dcp/wallet').passphrasePrompt = (promptMessage) => {
|
|
103
|
+
return askPassword(promptMessage);
|
|
104
|
+
};
|
|
105
|
+
|
|
65
106
|
delete exports.init; /* singleton */
|
|
66
107
|
|
|
67
108
|
if (!usingDebugger)
|
package/lib/default-ui-events.js
CHANGED
|
@@ -112,12 +112,11 @@ exports.hook = function hookWorkerEvents$$hook(worker, options)
|
|
|
112
112
|
options.verbose >= 2 && console.log(' * Submitting results...');
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
workerEventHandlers.result = function resultHandler() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
console.log(' ! Failed to submit results:', ev);
|
|
115
|
+
workerEventHandlers.result = function resultHandler(ev) {
|
|
116
|
+
if (ev instanceof Error)
|
|
117
|
+
console.error(" ! Failed to submit results:", ev);
|
|
118
|
+
else
|
|
119
|
+
options.verbose >= 2 && console.log(' . Submitted');
|
|
121
120
|
};
|
|
122
121
|
|
|
123
122
|
/* Register the appropriate event handlers on the worker and on each sandbox. The handlers are
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcp-worker",
|
|
3
|
-
"version": "3.2.30-
|
|
3
|
+
"version": "3.2.30-6",
|
|
4
4
|
"description": "JavaScript portion of DCP Workers for Node.js",
|
|
5
5
|
"main": "bin/dcp-worker",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"blessed": "^0.1.81",
|
|
38
38
|
"blessed-contrib": "^4.11.0",
|
|
39
39
|
"chalk": "^4.1.0",
|
|
40
|
-
"dcp-client": "
|
|
40
|
+
"dcp-client": "4.3.0-4",
|
|
41
41
|
"semver": "^7.3.8",
|
|
42
42
|
"syslog-client": "1.1.1"
|
|
43
43
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@kingsds/eslint-config": "^1.0.1",
|
|
49
|
-
"eslint": "
|
|
49
|
+
"eslint": ">=8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"node-eventlog": "https://gitpkg.now.sh/Distributive-Network/node-eventlog/package?dcp/0.0.1"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
60
|
+
"node": ">=18",
|
|
61
61
|
"npm": ">=7"
|
|
62
62
|
}
|
|
63
63
|
}
|