pywebexec 2.1.16__py3-none-any.whl → 2.1.17__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.
@@ -256,6 +256,7 @@ async function fetchExecutables() {
256
256
 
257
257
  }
258
258
 
259
+ let schemaValues = {};
259
260
 
260
261
  paramsInput.addEventListener('focus', () => {
261
262
  const currentCmd = commandInput.value;
@@ -266,6 +267,8 @@ paramsInput.addEventListener('focus', () => {
266
267
  if (gExecutables[currentCmd] && gExecutables[currentCmd].schema && gExecutables[currentCmd].schema.properties && paramsContainer.style.display == 'none') {
267
268
  createSchemaForm($('#schemaForm'), gExecutables[currentCmd].schema, async function (errors, values) {
268
269
  if (errors) {
270
+ schemaValues[currentCmd] = values;
271
+
269
272
  console.log(errors);
270
273
  alert(errors[0].message);
271
274
  return false;
@@ -273,6 +276,7 @@ paramsInput.addEventListener('focus', () => {
273
276
  const commandName = commandInput.value;
274
277
  fitAddon.fit();
275
278
  terminal.clear();
279
+ schemaValues[currentCmd] = values;
276
280
  payload = { params: values, rows: terminal.rows, cols: terminal.cols }
277
281
  if ('parallel' in values) {
278
282
  payload['parallel'] = values['parallel'];
@@ -302,7 +306,7 @@ paramsInput.addEventListener('focus', () => {
302
306
  console.log('Error running command:', error);
303
307
  }
304
308
  }
305
- });
309
+ }, schemaValues[currentCmd]);
306
310
  setHelpDivPosition();
307
311
  paramsContainer.style.display = 'block';
308
312
  const input1 = schemaFormPW.querySelector('input, select, textarea');
@@ -20,7 +20,11 @@ function formInputHandle() {
20
20
  } else {
21
21
  size = 12;
22
22
  }
23
+ if (input.value) {
24
+ size = 2;
25
+ }
23
26
  input.setAttribute('size', size);
27
+ setTimeout(() => adjustInputWidth(input), 1);
24
28
  input.addEventListener('input', () => adjustInputWidth(input));
25
29
  inputHandlers.push(input);
26
30
  }
@@ -49,7 +53,7 @@ function extractKeysAndPlaceholders(obj, formoptions, prefix = '') {
49
53
  return result;
50
54
  }
51
55
 
52
- function createSchemaForm(form, schema, onSubmit) {
56
+ function createSchemaForm(form, schema, onSubmit, value={}) {
53
57
  if (schema && schema.schema_options) {
54
58
  schema_options = schema.schema_options;
55
59
  } else {
@@ -141,6 +145,7 @@ function createSchemaForm(form, schema, onSubmit) {
141
145
  schema: schema,
142
146
  onSubmit: onSubmit,
143
147
  form: formDesc,
148
+ value: value,
144
149
  // params: {
145
150
  // fieldHtmlClass: "input-small",
146
151
  // }
@@ -152,18 +157,18 @@ function createSchemaForm(form, schema, onSubmit) {
152
157
  formInputHandle();
153
158
 
154
159
  form[0].querySelectorAll('textarea').forEach(txt => {
155
- txt.style.height = "0";
156
- txt.style.height = txt.scrollHeight + "px";
157
- txt.setAttribute("spellcheck", "false")
158
- txt.addEventListener("input", (e) => {
159
- e.target.style.height = "0";
160
- e.target.style.height = (e.target.scrollHeight+2) + "px";
161
- });
160
+ txt.style.height = "0";
161
+ setTimeout(() => adjustTxtHeight(txt), 1);
162
+ txt.setAttribute("spellcheck", "false");
163
+ txt.addEventListener("input", () => adjustTxtHeight(txt));
162
164
  });
163
165
 
164
166
  return jsform;
165
167
  }
166
-
168
+ function adjustTxtHeight(txt) {
169
+ txt.style.height = "0";
170
+ txt.style.height = txt.scrollHeight + "px";
171
+ }
167
172
  async function getSwaggerSpec() {
168
173
  const response = await fetch('/swagger.yaml');
169
174
  if (!response.ok) {
pywebexec/version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.1.16'
21
- __version_tuple__ = version_tuple = (2, 1, 16)
20
+ __version__ = version = '2.1.17'
21
+ __version_tuple__ = version_tuple = (2, 1, 17)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 2.1.16
3
+ Version: 2.1.17
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -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=kufip6m7MWjCIjtheUYuFUZgnNS5_W3kC5gVFVSUVX8,45662
4
4
  pywebexec/swagger.yaml,sha256=zP_Nz69vZx0iwbKTwiQgSs8rJRUTiGKRyIkWzMPANOE,6688
5
- pywebexec/version.py,sha256=rudGT5E5yeJvX5boBvUebroVntBjuBLjwwGBYa7WCrQ,513
5
+ pywebexec/version.py,sha256=6B1QsV14vku3b3mzQ60TgvM-e03ET7xDx-6ZZcUvbqI,513
6
6
  pywebexec/static/css/form.css,sha256=eApJskeJ3MCzC7_p4gXgoIbvbG5s8m4bP1O4KHHqeiA,5293
7
7
  pywebexec/static/css/markdown.css,sha256=3RzUnpVBdF6cQuB_NXV7hMTc0quYU8sfyuZcpsREj6A,1939
8
8
  pywebexec/static/css/style.css,sha256=ynccbEDzK07rurLm-UirUs5j_hVfXlIgaHeUIq9WvA0,9969
@@ -33,9 +33,9 @@ pywebexec/static/images/resume.svg,sha256=99LP1Ya2JXakRCO9kW8JMuT_4a_CannF65Eiuw
33
33
  pywebexec/static/images/running.svg,sha256=fBCYwYb2O9K4N3waC2nURP25NRwZlqR4PbDZy6JQMww,610
34
34
  pywebexec/static/images/success.svg,sha256=NVwezvVMplt46ElW798vqGfrL21Mw_DWHUp_qiD_FU8,489
35
35
  pywebexec/static/images/swagger-ui.svg,sha256=FR0yeOVwe4zCYKZAjCGcT_m0Mf25NexIVaSXifIkoU0,2117
36
- pywebexec/static/js/executables.js,sha256=bt2MVHsSFACAEtjQvs7xqhzsABefJ9A80grJxTmF3nE,12149
36
+ pywebexec/static/js/executables.js,sha256=DgkpsiXYRLzS57W8s8zTa-bqk4aErQaQnC7Y_icJITs,12301
37
37
  pywebexec/static/js/popup.js,sha256=0fr3pp4j9D2fXEVnHyQrx2bPWFHfgbb336dbewgH1d8,9023
38
- pywebexec/static/js/schemaform.js,sha256=RqFzI0rAoKke0FzArxBIupK5eR1-0GBMcEIuAkfz3Zs,5945
38
+ pywebexec/static/js/schemaform.js,sha256=AcJky1SuxlcPFmVsHSXTTHBUtb3ZJ8SlDk1Yq2Zb_Es,6096
39
39
  pywebexec/static/js/script.js,sha256=KrtLF77vKvKomKAIy0rix-T1hx4VTgjkQunHvgs-jaA,17631
40
40
  pywebexec/static/js/swagger-form.js,sha256=BU64XxyfrWx4DnpAuaWtG-9YpcHF3OzzAYzjiSH0NGo,3826
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=9ngyldkyEdLonBjl97mbIZUlVk-jxwcHrvFzMSrveyU,1067
70
- pywebexec-2.1.16.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
71
- pywebexec-2.1.16.dist-info/METADATA,sha256=x_lYFp0gk6M23_hAifhXzG9rd8mCJQ4yPJPU2mtFRzE,12811
72
- pywebexec-2.1.16.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
73
- pywebexec-2.1.16.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
74
- pywebexec-2.1.16.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
75
- pywebexec-2.1.16.dist-info/RECORD,,
70
+ pywebexec-2.1.17.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
71
+ pywebexec-2.1.17.dist-info/METADATA,sha256=KCKxVgXAdHSNNrg9xrxNUjL5PrTJDkYQXv1ZlkMhAl0,12811
72
+ pywebexec-2.1.17.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
73
+ pywebexec-2.1.17.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
74
+ pywebexec-2.1.17.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
75
+ pywebexec-2.1.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5