backend-plus 1.13.6 → 1.14.1
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 +23 -11
- package/for-client/my-things.js +19 -17
- package/package.json +6 -6
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';
|
|
@@ -100,7 +111,8 @@ myOwn.wScreens.procAux = {
|
|
|
100
111
|
}
|
|
101
112
|
control.addEventListener('update', function(){
|
|
102
113
|
params[parameterDef.name] = control.getTypedValue();
|
|
103
|
-
myOwn.replaceAddrParams(addrParams);
|
|
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
|
},
|
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.1",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"backend-skins": "^0.1.15",
|
|
33
33
|
"best-globals": "^1.0.0",
|
|
34
34
|
"big.js": "^6.1.1",
|
|
35
|
-
"body-parser": "^1.19.
|
|
35
|
+
"body-parser": "^1.19.1",
|
|
36
36
|
"cast-error": "^0.1.0",
|
|
37
37
|
"castellano": "^0.1.3",
|
|
38
38
|
"connect-pg-simple": "^7.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",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
"kill-9": "~0.4.3",
|
|
100
100
|
"mocha": "^9.1.3",
|
|
101
101
|
"nyc": "^15.1.0",
|
|
102
|
-
"puppeteer": "^
|
|
102
|
+
"puppeteer": "^13.0.0",
|
|
103
103
|
"sinon": "^12.0.1",
|
|
104
104
|
"supertest": "^6.1.6",
|
|
105
|
-
"types.d.ts": "~0.6.
|
|
106
|
-
"typescript": "^4.5.
|
|
105
|
+
"types.d.ts": "~0.6.5",
|
|
106
|
+
"typescript": "^4.5.4",
|
|
107
107
|
"why-is-node-running": "^2.2.0"
|
|
108
108
|
},
|
|
109
109
|
"engines": {
|