pywebexec 2.2.7__py3-none-any.whl → 2.2.9__py3-none-any.whl
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.
- pywebexec/static/js/schemaform.js +8 -11
- pywebexec/version.py +2 -2
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/METADATA +1 -1
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/RECORD +8 -8
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/WHEEL +0 -0
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/entry_points.txt +0 -0
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/licenses/LICENSE +0 -0
- {pywebexec-2.2.7.dist-info → pywebexec-2.2.9.dist-info}/top_level.txt +0 -0
@@ -92,18 +92,19 @@ function convertTextareaToArray(values, formDesc, schema) {
|
|
92
92
|
return values;
|
93
93
|
}
|
94
94
|
|
95
|
-
function validateSchemaForm(form, formDesc, schema, values) {
|
96
|
-
|
97
|
-
|
98
|
-
convertTextareaToArray(values, formDesc, schema);
|
95
|
+
function validateSchemaForm(form, formDesc, schema, values, schemaName) {
|
96
|
+
schemaValues[schemaName] = convertTextareaToArray(values, formDesc, schema);
|
97
|
+
localStorage.setItem('schemaValues', JSON.stringify(schemaValues));
|
99
98
|
env = JSV.createEnvironment();
|
100
99
|
report = env.validate(values, schema);
|
101
100
|
errors = report.errors;
|
101
|
+
err = form.querySelector('.alert');
|
102
102
|
if (errors.length > 0) {
|
103
103
|
err.innerText = errors[0].uri.split('#')[1].slice(1).replaceAll('/', '.') + ': ' + errors[0].message + ': ' + errors[0].details;
|
104
104
|
err.style.display = 'block';
|
105
105
|
return false;
|
106
106
|
}
|
107
|
+
err.style.display = 'none';
|
107
108
|
return true;
|
108
109
|
}
|
109
110
|
function createSchemaForm($form, schema, onSubmit, schemaName) {
|
@@ -230,7 +231,7 @@ function createSchemaForm($form, schema, onSubmit, schemaName) {
|
|
230
231
|
jsform = $form.jsonForm({
|
231
232
|
schema: schema,
|
232
233
|
onSubmit: function (errors, values) {
|
233
|
-
if (! validateSchemaForm(event.target, formDesc, schema, values)) {
|
234
|
+
if (! validateSchemaForm(event.target, formDesc, schema, values, schemaName)) {
|
234
235
|
event.preventDefault();
|
235
236
|
event.stopPropagation();
|
236
237
|
event.stopImmediatePropagation();
|
@@ -250,7 +251,7 @@ function createSchemaForm($form, schema, onSubmit, schemaName) {
|
|
250
251
|
err.classList.add('alert');
|
251
252
|
err.style.display = 'none';
|
252
253
|
schemaForm.appendChild(err);
|
253
|
-
validateSchemaForm(schemaForm, formDesc, schema,
|
254
|
+
validateSchemaForm(schemaForm, formDesc, schema, jsform.root.getFormValues(), schemaName);
|
254
255
|
schemaForm.querySelectorAll('textarea').forEach(txt => {
|
255
256
|
txt.style.height = "0";
|
256
257
|
setTimeout(() => adjustTxtHeight(txt), 1);
|
@@ -258,15 +259,11 @@ function createSchemaForm($form, schema, onSubmit, schemaName) {
|
|
258
259
|
txt.addEventListener("input", () => adjustTxtHeight(txt));
|
259
260
|
});
|
260
261
|
schemaForm.addEventListener('input', (e) => {
|
261
|
-
|
262
|
-
localStorage.setItem('schemaValues', JSON.stringify(schemaValues));
|
262
|
+
validateSchemaForm(schemaForm, formDesc, schema, jsform.root.getFormValues(), schemaName);
|
263
263
|
if (e.target.tagName === 'INPUT' && e.target.type === 'text') {
|
264
264
|
adjustInputWidth(e.target);
|
265
265
|
}
|
266
266
|
});
|
267
|
-
schemaForm.addEventListener('change', (e) => {
|
268
|
-
validateSchemaForm(schemaForm, formDesc, schema, jsform.root.getFormValues());
|
269
|
-
});
|
270
267
|
formInputHandle();
|
271
268
|
return jsform;
|
272
269
|
}
|
pywebexec/version.py
CHANGED
@@ -2,7 +2,7 @@ pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
|
|
2
2
|
pywebexec/host_ip.py,sha256=Ud_HTflWVQ8789aoQ2RZdT1wGI-ccvrwSWGz_c7T3TI,1241
|
3
3
|
pywebexec/pywebexec.py,sha256=R-jp9BiUMJZW7m9N9kQC6dpIueUgFVDo4n9_GFb1rOs,45734
|
4
4
|
pywebexec/swagger.yaml,sha256=I_oLpp7Hqel8SDEEykvpmCT-Gv3ytGlziq9bvQOrtZY,7598
|
5
|
-
pywebexec/version.py,sha256=
|
5
|
+
pywebexec/version.py,sha256=vfAUNhf_nRXyidROZBr9-mByYfQRM-Vg2szu6KEhvHY,511
|
6
6
|
pywebexec/static/css/form.css,sha256=XC_0ES5yMHYz0S2OHR0RAboQN7fBUmg5ZIq8Qm5rHP0,5806
|
7
7
|
pywebexec/static/css/markdown.css,sha256=br4-iK9wigTs54N2KHtjgZ4KLH0THVSvJo-XZAdMHiE,1970
|
8
8
|
pywebexec/static/css/style.css,sha256=R1VOPNV2ztROKy9Fgf3tvUrtuKagY027tFJ8C866yWU,9991
|
@@ -35,7 +35,7 @@ pywebexec/static/images/success.svg,sha256=NVwezvVMplt46ElW798vqGfrL21Mw_DWHUp_q
|
|
35
35
|
pywebexec/static/images/swagger-ui.svg,sha256=FR0yeOVwe4zCYKZAjCGcT_m0Mf25NexIVaSXifIkoU0,2117
|
36
36
|
pywebexec/static/js/executables.js,sha256=jB4QqWi4Qeq1uJflTSqqjsZy-ec9iy5ZmFvfNWMzXq4,11913
|
37
37
|
pywebexec/static/js/popup.js,sha256=O3DEWnyb5yGW9tjODYycc-ujWndyAfnJMxulaQeogtc,9700
|
38
|
-
pywebexec/static/js/schemaform.js,sha256=
|
38
|
+
pywebexec/static/js/schemaform.js,sha256=NlFXFKJI53izxPXct3a5XiB1RhWGt0_EIp6o1HfsryU,9624
|
39
39
|
pywebexec/static/js/script.js,sha256=yQP2dWwTObWbg6ROeKFxwYi1NfDd2gxEn2e3oL-FWL8,18379
|
40
40
|
pywebexec/static/js/swagger-form.js,sha256=CLcSHMhk5P4-_2MIRBoJLgEnIj_9keDDSzUugXHZjio,4565
|
41
41
|
pywebexec/static/js/js-yaml/LICENSE,sha256=oHvCRGi5ZUznalR9R6LbKC0HcztxXbTHOpi9Y5YflVA,1084
|
@@ -67,9 +67,9 @@ pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
67
67
|
pywebexec/templates/index.html,sha256=w18O2plH_yS8bqlPsu5hwFFmCj9H2hWLSV8B6ADcSwU,3900
|
68
68
|
pywebexec/templates/popup.html,sha256=3kpMccKD_OLLhJ4Y9KRw6Ny8wQWjVaRrUfV9y5-bDiQ,1580
|
69
69
|
pywebexec/templates/swagger_ui.html,sha256=MAPr-z96VERAecDvX37V8q2Nxph-O0fNDBul1x2w9SI,1147
|
70
|
-
pywebexec-2.2.
|
71
|
-
pywebexec-2.2.
|
72
|
-
pywebexec-2.2.
|
73
|
-
pywebexec-2.2.
|
74
|
-
pywebexec-2.2.
|
75
|
-
pywebexec-2.2.
|
70
|
+
pywebexec-2.2.9.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
71
|
+
pywebexec-2.2.9.dist-info/METADATA,sha256=1a8pUASu6I7njLd3y1krziCRCMjotkdEG3NXGjzbgOA,12832
|
72
|
+
pywebexec-2.2.9.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
73
|
+
pywebexec-2.2.9.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
74
|
+
pywebexec-2.2.9.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
75
|
+
pywebexec-2.2.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|