backend-plus 1.13.8 → 1.14.2
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/for-client/my-menu.js +28 -20
- package/for-client/my-things.js +19 -17
- package/package.json +4 -4
package/for-client/my-menu.js
CHANGED
|
@@ -66,10 +66,21 @@ myOwn.wScreens.table = function(addrParams){
|
|
|
66
66
|
|
|
67
67
|
myOwn.wScreens.procAux = {
|
|
68
68
|
showParams:function(formDef, main_layout, addrParams, mainAction){
|
|
69
|
-
|
|
69
|
+
var autoproced = addrParams.autoproced || false
|
|
70
70
|
addrParams.up=addrParams.up||{};
|
|
71
71
|
var params=addrParams.up;
|
|
72
|
-
var button = html.button(formDef.proceedLabel||my.messages.proceed).create();
|
|
72
|
+
// var button = html.button(formDef.proceedLabel||my.messages.proceed).create();
|
|
73
|
+
var label = formDef.proceedLabel||my.messages.proceed;
|
|
74
|
+
var button = my.createForkeableButton({}, label);
|
|
75
|
+
var setHref = function(){
|
|
76
|
+
button.setForkeableHref({
|
|
77
|
+
...addrParams,
|
|
78
|
+
autoproced:true,
|
|
79
|
+
directUrl:true,
|
|
80
|
+
...(formDef?.proceedLabel ? {label} : {}),
|
|
81
|
+
...params
|
|
82
|
+
})
|
|
83
|
+
}
|
|
73
84
|
var divResult = html.div({class:formDef.resultClass||'result-pre'}).create();
|
|
74
85
|
var id='progress'+Math.random();
|
|
75
86
|
var toggleProgress = html.input({type:'checkbox', id:id, checked:true, disabled:true}).create();
|
|
@@ -78,7 +89,7 @@ myOwn.wScreens.procAux = {
|
|
|
78
89
|
var divProgress = html.div().create();
|
|
79
90
|
var divProgressOutside = html.div({class:'result-progress', style:'opacity:0'},[toggleProgress,labelProgress,divProgress]).create();
|
|
80
91
|
var controls = [];
|
|
81
|
-
|
|
92
|
+
var parameterForm = html.table({class:"table-param-screen"},formDef.parameters.map(function(parameterDef){
|
|
82
93
|
var control = html.td({"typed-controls-direct-input":true}).create();
|
|
83
94
|
control.style.minWidth='200px';
|
|
84
95
|
control.style.backgroundColor='white';
|
|
@@ -101,6 +112,7 @@ myOwn.wScreens.procAux = {
|
|
|
101
112
|
control.addEventListener('update', function(){
|
|
102
113
|
params[parameterDef.name] = control.getTypedValue();
|
|
103
114
|
myOwn.replaceAddrParams(addrParams);
|
|
115
|
+
setHref();
|
|
104
116
|
});
|
|
105
117
|
controls.push(control);
|
|
106
118
|
return html.tr({"parameter-name":parameterDef.name},[
|
|
@@ -110,9 +122,8 @@ myOwn.wScreens.procAux = {
|
|
|
110
122
|
]);
|
|
111
123
|
}).concat(
|
|
112
124
|
html.tr([html.td(), html.td([button])])
|
|
113
|
-
))
|
|
114
|
-
|
|
115
|
-
main_layout.appendChild(divProgressOutside);
|
|
125
|
+
));
|
|
126
|
+
setHref();
|
|
116
127
|
var proceed = function proceed(){
|
|
117
128
|
button.disabled=true;
|
|
118
129
|
divResult.innerHTML="";
|
|
@@ -135,12 +146,13 @@ myOwn.wScreens.procAux = {
|
|
|
135
146
|
divProgress.textContent=err.message;
|
|
136
147
|
});
|
|
137
148
|
}
|
|
138
|
-
|
|
139
|
-
proceed();
|
|
140
|
-
}
|
|
141
|
-
if(addrParams.autoproced){
|
|
149
|
+
if(autoproced){
|
|
142
150
|
proceed();
|
|
151
|
+
}else{
|
|
152
|
+
main_layout.appendChild(parameterForm.create());
|
|
143
153
|
}
|
|
154
|
+
main_layout.appendChild(divResult);
|
|
155
|
+
main_layout.appendChild(divProgressOutside);
|
|
144
156
|
},
|
|
145
157
|
mainAction:function(){
|
|
146
158
|
},
|
|
@@ -287,16 +299,12 @@ myOwn.showPage = function showPage(pageDef){
|
|
|
287
299
|
}else if(typeof my.wScreens[w] === 'object'){
|
|
288
300
|
wScreen = my.wScreens[w];
|
|
289
301
|
if(wScreen.parameters){
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
resultClass:wScreen.resultClass,
|
|
297
|
-
proceedLabel:wScreen.proceedLabel,
|
|
298
|
-
}, main_layout, addrParams, wScreen.mainAction);
|
|
299
|
-
}
|
|
302
|
+
wScreen.mainFunction=wScreen.mainFunction||function(addrParams){
|
|
303
|
+
my.wScreens.procAux.showParams({
|
|
304
|
+
parameters:wScreen.parameters,
|
|
305
|
+
resultClass:wScreen.resultClass,
|
|
306
|
+
proceedLabel:wScreen.proceedLabel,
|
|
307
|
+
}, main_layout, addrParams, wScreen.mainAction);
|
|
300
308
|
}
|
|
301
309
|
}
|
|
302
310
|
}else{
|
package/for-client/my-things.js
CHANGED
|
@@ -228,24 +228,26 @@ myOwn.log = function log(severity, message){
|
|
|
228
228
|
clientMessage = message;
|
|
229
229
|
}
|
|
230
230
|
consoleMessage = consoleMessage || clientMessage;
|
|
231
|
-
var status = document.getElementById('mini-console');
|
|
232
231
|
console.log(severity, consoleMessage);
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
232
|
+
var statuses = [...document.querySelectorAll('#mini-console')];
|
|
233
|
+
if(statuses.length==0) statuses = [document.body];
|
|
234
|
+
statuses.forEach(status=>{
|
|
235
|
+
var divMessage = html.div({"class": ["status-"+severity]}, clientMessage).create();
|
|
236
|
+
if(status.firstChild){
|
|
237
|
+
status.insertBefore(divMessage, status.firstChild);
|
|
238
|
+
}else{
|
|
239
|
+
status.appendChild(divMessage);
|
|
240
|
+
}
|
|
241
|
+
if(!this["log-severities"][severity].permanent){
|
|
242
|
+
setTimeout(function(){
|
|
243
|
+
my.fade(divMessage);
|
|
244
|
+
},3000);
|
|
245
|
+
}else{
|
|
246
|
+
setTimeout(function(){
|
|
247
|
+
my.fade(divMessage);
|
|
248
|
+
},30000);
|
|
249
|
+
}
|
|
250
|
+
})
|
|
249
251
|
};
|
|
250
252
|
|
|
251
253
|
myOwn.fade = function fade(element, options){
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backend-plus",
|
|
3
3
|
"description": "Backend for typed controls",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"cookie-parser": "^1.4.6",
|
|
40
40
|
"dialog-promise": "^0.9.14",
|
|
41
41
|
"discrepances": "^0.2.6",
|
|
42
|
-
"express": "^4.17.
|
|
42
|
+
"express": "^4.17.2",
|
|
43
43
|
"express-session": "^1.17.2",
|
|
44
44
|
"express-useragent": "^1.0.15",
|
|
45
45
|
"fs-extra": "^10.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/mocha": "^9.0.0",
|
|
84
84
|
"@types/nodemailer": "^6.4.4",
|
|
85
85
|
"@types/multiparty": "~0.0.33",
|
|
86
|
-
"@types/node": "^
|
|
86
|
+
"@types/node": "^17.0.0",
|
|
87
87
|
"@types/numeral": "~2.0.2",
|
|
88
88
|
"@types/session-file-store": "^1.2.2",
|
|
89
89
|
"@types/stack-trace": "~0.0.29",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"puppeteer": "^13.0.0",
|
|
103
103
|
"sinon": "^12.0.1",
|
|
104
104
|
"supertest": "^6.1.6",
|
|
105
|
-
"types.d.ts": "~0.6.
|
|
105
|
+
"types.d.ts": "~0.6.5",
|
|
106
106
|
"typescript": "^4.5.4",
|
|
107
107
|
"why-is-node-running": "^2.2.0"
|
|
108
108
|
},
|