pywebexec 2.2.1__tar.gz → 2.2.3__tar.gz

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.
Files changed (83) hide show
  1. {pywebexec-2.2.1/pywebexec.egg-info → pywebexec-2.2.3}/PKG-INFO +3 -2
  2. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/form.css +13 -0
  3. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/executables.js +0 -3
  4. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/schemaform.js +34 -31
  5. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/swagger-form.js +4 -4
  6. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/version.py +2 -2
  7. {pywebexec-2.2.1 → pywebexec-2.2.3/pywebexec.egg-info}/PKG-INFO +3 -2
  8. {pywebexec-2.2.1 → pywebexec-2.2.3}/.github/workflows/python-publish.yml +0 -0
  9. {pywebexec-2.2.1 → pywebexec-2.2.3}/.gitignore +0 -0
  10. {pywebexec-2.2.1 → pywebexec-2.2.3}/LICENSE +0 -0
  11. {pywebexec-2.2.1 → pywebexec-2.2.3}/README.md +0 -0
  12. {pywebexec-2.2.1 → pywebexec-2.2.3}/pyproject.toml +0 -0
  13. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/__init__.py +0 -0
  14. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/host_ip.py +0 -0
  15. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/pywebexec.py +0 -0
  16. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/markdown.css +0 -0
  17. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/style.css +0 -0
  18. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/swagger-ui.css +0 -0
  19. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/swagger-ui.css.map +0 -0
  20. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/css/xterm.css +0 -0
  21. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.ttf +0 -0
  22. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/LICENSE +0 -0
  23. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/glyphicons-halflings-regular.eot +0 -0
  24. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/glyphicons-halflings-regular.svg +0 -0
  25. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  26. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/glyphicons-halflings-regular.woff +0 -0
  27. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  28. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/aborted.svg +0 -0
  29. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/copy.svg +0 -0
  30. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/copy_ok.svg +0 -0
  31. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/down-arrow.svg +0 -0
  32. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/failed.svg +0 -0
  33. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/favicon.svg +0 -0
  34. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/fit-tty.svg +0 -0
  35. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/fit-win.svg +0 -0
  36. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/font-decrease.svg +0 -0
  37. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/font-increase.svg +0 -0
  38. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/norun.svg +0 -0
  39. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/pause.svg +0 -0
  40. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/popup.svg +0 -0
  41. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/resume.svg +0 -0
  42. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/running.svg +0 -0
  43. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/success.svg +0 -0
  44. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/images/swagger-ui.svg +0 -0
  45. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/js-yaml/LICENSE +0 -0
  46. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/js-yaml/js-yaml.min.js +0 -0
  47. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/marked/LICENSE.md +0 -0
  48. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/marked/marked.min.js +0 -0
  49. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/popup.js +0 -0
  50. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/script.js +0 -0
  51. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/swagger-ui/LICENSE +0 -0
  52. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/swagger-ui/swagger-ui-bundle.js +0 -0
  53. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/swagger-ui/swagger-ui-standalone-preset.js +0 -0
  54. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/LICENSE +0 -0
  55. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-canvas.js +0 -0
  56. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-canvas.js.map +0 -0
  57. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-fit.js +0 -0
  58. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
  59. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-unicode-graphemes.js +0 -0
  60. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-unicode-graphemes.js.map +0 -0
  61. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-unicode11.js +0 -0
  62. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/addon-unicode11.js.map +0 -0
  63. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/xterm.js +0 -0
  64. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/js/xterm/xterm.js.map +0 -0
  65. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/LICENSE +0 -0
  66. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/deps/README.md +0 -0
  67. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/deps/img/glyphicons-halflings.png +0 -0
  68. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/deps/jquery.min.js +0 -0
  69. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/deps/jsv.js +0 -0
  70. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/deps/underscore.js +0 -0
  71. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/static/jsonform/lib/jsonform.js +0 -0
  72. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/swagger.yaml +0 -0
  73. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/templates/__init__.py +0 -0
  74. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/templates/index.html +0 -0
  75. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/templates/popup.html +0 -0
  76. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec/templates/swagger_ui.html +0 -0
  77. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec.egg-info/SOURCES.txt +0 -0
  78. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec.egg-info/dependency_links.txt +0 -0
  79. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec.egg-info/entry_points.txt +0 -0
  80. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec.egg-info/requires.txt +0 -0
  81. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexec.egg-info/top_level.txt +0 -0
  82. {pywebexec-2.2.1 → pywebexec-2.2.3}/pywebexecdev +0 -0
  83. {pywebexec-2.2.1 → pywebexec-2.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pywebexec
3
- Version: 2.2.1
3
+ Version: 2.2.3
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -62,6 +62,7 @@ Requires-Dist: ldap3>=2.9.1
62
62
  Requires-Dist: pyte>=0.8.1
63
63
  Requires-Dist: PyYAML>=6.0.1
64
64
  Requires-Dist: run-para>=1.0.2
65
+ Dynamic: license-file
65
66
 
66
67
  [![Pypi version](https://img.shields.io/pypi/v/pywebexec.svg)](https://pypi.org/project/pywebexec/)
67
68
  ![Publish Package](https://github.com/joknarf/pywebexec/actions/workflows/python-publish.yml/badge.svg)
@@ -211,6 +211,19 @@
211
211
  box-shadow: unset;
212
212
  outline: 0;
213
213
  }
214
+ .controls > .checkbox input {
215
+ top: 5px;
216
+ }
217
+ .checkbox {
218
+ label {
219
+ font-weight: normal;
220
+ }
221
+ input {
222
+ top: 1px;
223
+ display: unset;
224
+ margin-right: 4px;
225
+ }
226
+ }
214
227
  }
215
228
 
216
229
  .swagger-ui textarea {
@@ -259,9 +259,6 @@ async function fetchExecutables() {
259
259
  paramsInput.addEventListener('focus', () => {
260
260
  const currentCmd = commandInput.value;
261
261
  paramsInput.name = currentCmd;
262
- if (paramsContainer.style.display == 'none') {
263
- $('#schemaForm').html('');
264
- }
265
262
  if (gExecutables[currentCmd] && gExecutables[currentCmd].schema && gExecutables[currentCmd].schema.properties && paramsContainer.style.display == 'none') {
266
263
  createSchemaForm($('#schemaForm'), gExecutables[currentCmd].schema, async function (errors, values) {
267
264
  const commandName = commandInput.value;
@@ -10,24 +10,20 @@ function adjustInputWidth(input) {
10
10
 
11
11
  function formInputHandle() {
12
12
  schemaForm.querySelectorAll('input[type="text"], input[type="number"]').forEach(input => {
13
- if (! inputHandlers.includes(input)) {
14
- val = input.placeholder;
15
- if (val) {
16
- size = Math.max(val.length, 2)
17
- if (input.type== 'number') {
18
- size += 2;
19
- }
20
- } else {
21
- size = 12;
22
- }
23
- if (input.value) {
24
- size = 2;
13
+ val = input.placeholder;
14
+ if (val) {
15
+ size = Math.max(val.length, 2)
16
+ if (input.type== 'number') {
17
+ size += 2;
25
18
  }
26
- input.setAttribute('size', size);
27
- setTimeout(() => adjustInputWidth(input), 1);
28
- input.addEventListener('input', () => adjustInputWidth(input));
29
- inputHandlers.push(input);
19
+ } else {
20
+ size = 12;
30
21
  }
22
+ if (input.value) {
23
+ size = 2;
24
+ }
25
+ input.setAttribute('size', size);
26
+ setTimeout(() => adjustInputWidth(input), 1);
31
27
  });
32
28
  }
33
29
 
@@ -84,6 +80,8 @@ function convertTextareaToArray(values, formDesc, schema) {
84
80
  const val = obj[lastKey];
85
81
  if (val) {
86
82
  obj[lastKey] = val.trim().split(/[\s\r,]+/).filter(x => x);
83
+ } else {
84
+ delete obj[lastKey];
87
85
  }
88
86
  }
89
87
  }
@@ -93,7 +91,7 @@ function convertTextareaToArray(values, formDesc, schema) {
93
91
 
94
92
  // ...existing code...
95
93
 
96
- function createSchemaForm(form, schema, onSubmit, schemaName) {
94
+ function createSchemaForm($form, schema, onSubmit, schemaName) {
97
95
  if (schema && schema.schema_options) {
98
96
  schema_options = schema.schema_options;
99
97
  } else {
@@ -140,8 +138,14 @@ function createSchemaForm(form, schema, onSubmit, schemaName) {
140
138
  } else {
141
139
  value = {};
142
140
  }
143
-
144
- schemaForm = form[0];
141
+ // recreate form to remove event listeners
142
+ $form.off();
143
+ $form.empty();
144
+ $form.html('');
145
+ $newform = $form.clone();
146
+ $form.replaceWith($newform);
147
+ $form = $newform;
148
+ schemaForm = $form[0];
145
149
  if (onSubmit != null) {
146
150
  if (schema_options && schema_options.batch_param) {
147
151
  schema.properties[schema_options.batch_param].required = true;
@@ -207,8 +211,8 @@ function createSchemaForm(form, schema, onSubmit, schemaName) {
207
211
  }
208
212
  }
209
213
  }
210
- form[0].classList.add('form-inline');
211
- jsform = form.jsonForm({
214
+ schemaForm.classList.add('form-inline');
215
+ jsform = $form.jsonForm({
212
216
  schema: schema,
213
217
  onSubmit: function (errors, values) {
214
218
  convertTextareaToArray(values, formDesc, schema);
@@ -228,23 +232,22 @@ function createSchemaForm(form, schema, onSubmit, schemaName) {
228
232
  // fieldHtmlClass: "input-small",
229
233
  // }
230
234
  });
231
- form[0].firstChild.classList.add('form-inline');
232
- form[0].querySelectorAll('._jsonform-array-addmore').forEach(btn => {
233
- btn.addEventListener('click', formInputHandle);
234
- });
235
- formInputHandle();
236
-
237
- form[0].querySelectorAll('textarea').forEach(txt => {
235
+ schemaForm.firstChild.classList.add('form-inline');
236
+ schemaForm.querySelectorAll('textarea').forEach(txt => {
238
237
  txt.style.height = "0";
239
238
  setTimeout(() => adjustTxtHeight(txt), 1);
240
239
  txt.setAttribute("spellcheck", "false");
241
240
  txt.addEventListener("input", () => adjustTxtHeight(txt));
242
241
  });
243
- form[0].addEventListener('input', () => {
242
+ schemaForm.addEventListener('input', (e) => {
243
+ console.log(schemaName);
244
244
  schemaValues[schemaName] = convertTextareaToArray(jsform.root.getFormValues(), formDesc, schema);
245
245
  localStorage.setItem('schemaValues', JSON.stringify(schemaValues));
246
+ if (e.target.tagName === 'INPUT' && e.target.type === 'text') {
247
+ adjustInputWidth(e.target);
248
+ }
246
249
  });
247
-
250
+ formInputHandle();
248
251
  return jsform;
249
252
  }
250
253
  function adjustTxtHeight(txt) {
@@ -286,7 +289,7 @@ async function getPostParametersSchema() {
286
289
  }
287
290
 
288
291
  let schemaForm;
289
- let inputHandlers = [];
292
+ // let inputHandlers = [];
290
293
  let schemaValues = JSON.parse(localStorage.getItem('schemaValues')) || {};
291
294
 
292
295
 
@@ -107,12 +107,12 @@ window.onload = function() {
107
107
  const form = document.createElement("form");
108
108
  form.id = routePathId;
109
109
  form.classList.add("schema-form");
110
+ paramtext.parentNode.insertBefore(form, paramtext.nextSibling);
110
111
  jsform = createSchemaForm($(form), swaggerSchemas[routePath], null, routePath);
111
- // form.addEventListener("input", formInput(node, jsform));
112
+ newForm = jsform.root.ownerTree.domRoot;
112
113
  setTimeout(() => addFormInputListener(paramtext, jsform)(), 100);
113
- form.addEventListener("input", addFormInputListener(paramtext, jsform));
114
- paramtext.parentNode.insertBefore(form, paramtext.nextSibling);
115
- item1 = form.querySelector("input, select, textarea");
114
+ newForm.addEventListener("input", addFormInputListener(paramtext, jsform));
115
+ item1 = newForm.querySelector("input, select, textarea");
116
116
  if (item1) {
117
117
  item1.focus();
118
118
  }
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.2.1'
21
- __version_tuple__ = version_tuple = (2, 2, 1)
20
+ __version__ = version = '2.2.3'
21
+ __version_tuple__ = version_tuple = (2, 2, 3)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pywebexec
3
- Version: 2.2.1
3
+ Version: 2.2.3
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -62,6 +62,7 @@ Requires-Dist: ldap3>=2.9.1
62
62
  Requires-Dist: pyte>=0.8.1
63
63
  Requires-Dist: PyYAML>=6.0.1
64
64
  Requires-Dist: run-para>=1.0.2
65
+ Dynamic: license-file
65
66
 
66
67
  [![Pypi version](https://img.shields.io/pypi/v/pywebexec.svg)](https://pypi.org/project/pywebexec/)
67
68
  ![Publish Package](https://github.com/joknarf/pywebexec/actions/workflows/python-publish.yml/badge.svg)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes