pywebexec 2.0.5__tar.gz → 2.0.6__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 (82) hide show
  1. {pywebexec-2.0.5/pywebexec.egg-info → pywebexec-2.0.6}/PKG-INFO +57 -2
  2. {pywebexec-2.0.5 → pywebexec-2.0.6}/README.md +56 -1
  3. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/pywebexec.py +1 -1
  4. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/markdown.css +6 -1
  5. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/style.css +2 -2
  6. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/executables.js +1 -1
  7. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/swagger.yaml +1 -1
  8. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/version.py +2 -2
  9. {pywebexec-2.0.5 → pywebexec-2.0.6/pywebexec.egg-info}/PKG-INFO +57 -2
  10. {pywebexec-2.0.5 → pywebexec-2.0.6}/.github/workflows/python-publish.yml +0 -0
  11. {pywebexec-2.0.5 → pywebexec-2.0.6}/.gitignore +0 -0
  12. {pywebexec-2.0.5 → pywebexec-2.0.6}/LICENSE +0 -0
  13. {pywebexec-2.0.5 → pywebexec-2.0.6}/pyproject.toml +0 -0
  14. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/__init__.py +0 -0
  15. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/host_ip.py +0 -0
  16. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/form.css +0 -0
  17. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/swagger-ui.css +0 -0
  18. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/swagger-ui.css.map +0 -0
  19. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/css/xterm.css +0 -0
  20. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.ttf +0 -0
  21. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/LICENSE +0 -0
  22. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/glyphicons-halflings-regular.eot +0 -0
  23. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/glyphicons-halflings-regular.svg +0 -0
  24. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  25. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/glyphicons-halflings-regular.woff +0 -0
  26. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  27. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/aborted.svg +0 -0
  28. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/copy.svg +0 -0
  29. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/copy_ok.svg +0 -0
  30. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/down-arrow.svg +0 -0
  31. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/failed.svg +0 -0
  32. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/favicon.svg +0 -0
  33. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/fit-tty.svg +0 -0
  34. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/fit-win.svg +0 -0
  35. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/font-decrease.svg +0 -0
  36. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/font-increase.svg +0 -0
  37. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/norun.svg +0 -0
  38. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/pause.svg +0 -0
  39. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/popup.svg +0 -0
  40. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/resume.svg +0 -0
  41. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/running.svg +0 -0
  42. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/success.svg +0 -0
  43. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/images/swagger-ui.svg +0 -0
  44. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/js-yaml/LICENSE +0 -0
  45. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/js-yaml/js-yaml.min.js +0 -0
  46. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/marked/LICENSE.md +0 -0
  47. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/marked/marked.min.js +0 -0
  48. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/popup.js +0 -0
  49. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/schemaform.js +0 -0
  50. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/script.js +0 -0
  51. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/swagger-form.js +0 -0
  52. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/swagger-ui/LICENSE +0 -0
  53. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/swagger-ui/swagger-ui-bundle.js +0 -0
  54. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/swagger-ui/swagger-ui-standalone-preset.js +0 -0
  55. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/LICENSE +0 -0
  56. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-canvas.js +0 -0
  57. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-canvas.js.map +0 -0
  58. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-fit.js +0 -0
  59. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
  60. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-unicode-graphemes.js +0 -0
  61. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-unicode-graphemes.js.map +0 -0
  62. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-unicode11.js +0 -0
  63. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/addon-unicode11.js.map +0 -0
  64. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/xterm.js +0 -0
  65. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/js/xterm/xterm.js.map +0 -0
  66. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/LICENSE +0 -0
  67. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/deps/README.md +0 -0
  68. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/deps/img/glyphicons-halflings.png +0 -0
  69. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/deps/jquery.min.js +0 -0
  70. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/deps/underscore.js +0 -0
  71. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/static/jsonform/lib/jsonform.js +0 -0
  72. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/templates/__init__.py +0 -0
  73. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/templates/index.html +0 -0
  74. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/templates/popup.html +0 -0
  75. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec/templates/swagger_ui.html +0 -0
  76. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec.egg-info/SOURCES.txt +0 -0
  77. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec.egg-info/dependency_links.txt +0 -0
  78. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec.egg-info/entry_points.txt +0 -0
  79. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec.egg-info/requires.txt +0 -0
  80. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexec.egg-info/top_level.txt +0 -0
  81. {pywebexec-2.0.5 → pywebexec-2.0.6}/pywebexecdev +0 -0
  82. {pywebexec-2.0.5 → pywebexec-2.0.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -208,12 +208,67 @@ The help message is displayed:
208
208
 
209
209
  <img src="https://github.com/user-attachments/assets/2d69cef2-3371-4282-99bb-e994eb0c0b24" width="400"/>
210
210
 
211
+ ## Add schema to commands
212
+
213
+ For each exposed command, you can add a schema by creating a file named `<command>.schema.yaml` in the same directory as the command. The schema must be written in yaml format.
214
+ The schema is used to generate a form in the web interface and in the swagger-ui in the `/commands/<command>` route.
215
+ The schema is also used to validate the input parameters when calling the API `/commands/<command>`.
216
+ The schema must be written in the openapi schema format.
217
+
218
+ ```yaml
219
+ type: object
220
+ properties:
221
+ param1:
222
+ type: string
223
+ description: "param1 description"
224
+ example: "value"
225
+ param2:
226
+ type: integer
227
+ description: "param2 description"
228
+ enum: [1, 2, 3]
229
+ param3:
230
+ type: array
231
+ items:
232
+ type: string
233
+ description: "param3 description"
234
+ example: ["value1", "value2"]
235
+ required:
236
+ - param1
237
+ - param2
238
+ ```
239
+ The payload will be converted to command line arguments when calling the command.
240
+ ```
241
+ command --param1 value --param2 1 --param3 value1 value2
242
+ ```
243
+
244
+ * On the web inferface, and swagger-ui the form will be generated from the schema.
245
+
246
+ <img src="https://github.com/user-attachments/assets/c7cdf117-aa38-4366-97c7-1aa26e5ebf0d" width=400>
247
+
248
+ When using schema, the command can now be launched with:
249
+ ```
250
+ $ curl -X POST http://<srv>/commands/<cmd> -H "Content-Type: application/json" -d '{"param1": "value", "param2": 1, "param3": ["value1", "value2"]}'
251
+ ```
252
+
253
+ ## Schema options
254
+
255
+ The schema options are used to customize the command line arguments generation, just add a `schema_options` section to the schema.
256
+ ```yaml
257
+ schema_options:
258
+ separator: "=" # --param=value (default is " ")
259
+ noprefix_params: ["param1", "param2"] # omit --param prefix, use "*" to omit all
260
+ convert_params: {"param1": "param2"} # convert param1 to param2
261
+ ```
262
+
211
263
  ## Swagger UI
212
264
 
213
- A swagger UI is available at `http[s]://<srv>/v0/documentation`
265
+ A custom swagger UI is available at `http[s]://<srv>/v0/documentation` with enhanced markdown rendering and form generation for body parameters.
214
266
 
215
267
  <img src="https://github.com/user-attachments/assets/c80a341e-c04c-4606-9510-a57b473a74e5" width="400"/>
216
268
 
269
+ <img src="https://github.com/user-attachments/assets/22261048-459e-4ace-8d04-c568d67bef37" width="400">
270
+
271
+
217
272
  ## API reference
218
273
 
219
274
 
@@ -145,12 +145,67 @@ The help message is displayed:
145
145
 
146
146
  <img src="https://github.com/user-attachments/assets/2d69cef2-3371-4282-99bb-e994eb0c0b24" width="400"/>
147
147
 
148
+ ## Add schema to commands
149
+
150
+ For each exposed command, you can add a schema by creating a file named `<command>.schema.yaml` in the same directory as the command. The schema must be written in yaml format.
151
+ The schema is used to generate a form in the web interface and in the swagger-ui in the `/commands/<command>` route.
152
+ The schema is also used to validate the input parameters when calling the API `/commands/<command>`.
153
+ The schema must be written in the openapi schema format.
154
+
155
+ ```yaml
156
+ type: object
157
+ properties:
158
+ param1:
159
+ type: string
160
+ description: "param1 description"
161
+ example: "value"
162
+ param2:
163
+ type: integer
164
+ description: "param2 description"
165
+ enum: [1, 2, 3]
166
+ param3:
167
+ type: array
168
+ items:
169
+ type: string
170
+ description: "param3 description"
171
+ example: ["value1", "value2"]
172
+ required:
173
+ - param1
174
+ - param2
175
+ ```
176
+ The payload will be converted to command line arguments when calling the command.
177
+ ```
178
+ command --param1 value --param2 1 --param3 value1 value2
179
+ ```
180
+
181
+ * On the web inferface, and swagger-ui the form will be generated from the schema.
182
+
183
+ <img src="https://github.com/user-attachments/assets/c7cdf117-aa38-4366-97c7-1aa26e5ebf0d" width=400>
184
+
185
+ When using schema, the command can now be launched with:
186
+ ```
187
+ $ curl -X POST http://<srv>/commands/<cmd> -H "Content-Type: application/json" -d '{"param1": "value", "param2": 1, "param3": ["value1", "value2"]}'
188
+ ```
189
+
190
+ ## Schema options
191
+
192
+ The schema options are used to customize the command line arguments generation, just add a `schema_options` section to the schema.
193
+ ```yaml
194
+ schema_options:
195
+ separator: "=" # --param=value (default is " ")
196
+ noprefix_params: ["param1", "param2"] # omit --param prefix, use "*" to omit all
197
+ convert_params: {"param1": "param2"} # convert param1 to param2
198
+ ```
199
+
148
200
  ## Swagger UI
149
201
 
150
- A swagger UI is available at `http[s]://<srv>/v0/documentation`
202
+ A custom swagger UI is available at `http[s]://<srv>/v0/documentation` with enhanced markdown rendering and form generation for body parameters.
151
203
 
152
204
  <img src="https://github.com/user-attachments/assets/c80a341e-c04c-4606-9510-a57b473a74e5" width="400"/>
153
205
 
206
+ <img src="https://github.com/user-attachments/assets/22261048-459e-4ace-8d04-c568d67bef37" width="400">
207
+
208
+
154
209
  ## API reference
155
210
 
156
211
 
@@ -1007,7 +1007,7 @@ def swagger_yaml():
1007
1007
  "parameters": [
1008
1008
  {
1009
1009
  "in": "body",
1010
- "name": "commandRequest",
1010
+ "name": "reuqestBody",
1011
1011
  "schema": cmd_schema
1012
1012
  }
1013
1013
  ],
@@ -66,9 +66,14 @@
66
66
  font-size: 14px;
67
67
  color: #333;
68
68
  background-color: #dfdfff;
69
- padding: 1px 4px;
70
69
  border-radius: 5px;
71
70
  }
71
+ code {
72
+ padding: 1px 4px;
73
+ }
74
+ pre code {
75
+ padding: 0;
76
+ }
72
77
  pre {
73
78
  padding: 5px 10px;
74
79
  border-radius: 10px;
@@ -420,7 +420,7 @@ body.dimmed * {
420
420
  font-size: 13px;
421
421
  }
422
422
  .command-line {
423
- padding: 6px 10px 6px 10px;
423
+ padding: 5px 10px 6px 10px;
424
424
  background-color: #111;
425
425
  color: #eee;
426
426
  max-width: 300px;
@@ -429,7 +429,7 @@ body.dimmed * {
429
429
  overflow: hidden;
430
430
  text-overflow: ellipsis;
431
431
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
432
- font-size: 13px;
432
+ font-size: 14px;
433
433
  }
434
434
 
435
435
  .nbrunning {
@@ -34,7 +34,7 @@ function filterCommands() {
34
34
  items[i].style.display = 'none';
35
35
  }
36
36
  }
37
- if (nbVisibleItems > 1) {
37
+ if (nbVisibleItems > 1 || commandInput.value.length == 0) {
38
38
  commandListDiv.style.display = 'block';
39
39
  } else {
40
40
  commandListDiv.style.display = 'none';
@@ -47,7 +47,7 @@ paths:
47
47
  - application/json
48
48
  parameters:
49
49
  - in: body
50
- name: commandRequest
50
+ name: requestBody
51
51
  schema:
52
52
  type: object
53
53
  properties:
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.0.5'
21
- __version_tuple__ = version_tuple = (2, 0, 5)
20
+ __version__ = version = '2.0.6'
21
+ __version_tuple__ = version_tuple = (2, 0, 6)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -208,12 +208,67 @@ The help message is displayed:
208
208
 
209
209
  <img src="https://github.com/user-attachments/assets/2d69cef2-3371-4282-99bb-e994eb0c0b24" width="400"/>
210
210
 
211
+ ## Add schema to commands
212
+
213
+ For each exposed command, you can add a schema by creating a file named `<command>.schema.yaml` in the same directory as the command. The schema must be written in yaml format.
214
+ The schema is used to generate a form in the web interface and in the swagger-ui in the `/commands/<command>` route.
215
+ The schema is also used to validate the input parameters when calling the API `/commands/<command>`.
216
+ The schema must be written in the openapi schema format.
217
+
218
+ ```yaml
219
+ type: object
220
+ properties:
221
+ param1:
222
+ type: string
223
+ description: "param1 description"
224
+ example: "value"
225
+ param2:
226
+ type: integer
227
+ description: "param2 description"
228
+ enum: [1, 2, 3]
229
+ param3:
230
+ type: array
231
+ items:
232
+ type: string
233
+ description: "param3 description"
234
+ example: ["value1", "value2"]
235
+ required:
236
+ - param1
237
+ - param2
238
+ ```
239
+ The payload will be converted to command line arguments when calling the command.
240
+ ```
241
+ command --param1 value --param2 1 --param3 value1 value2
242
+ ```
243
+
244
+ * On the web inferface, and swagger-ui the form will be generated from the schema.
245
+
246
+ <img src="https://github.com/user-attachments/assets/c7cdf117-aa38-4366-97c7-1aa26e5ebf0d" width=400>
247
+
248
+ When using schema, the command can now be launched with:
249
+ ```
250
+ $ curl -X POST http://<srv>/commands/<cmd> -H "Content-Type: application/json" -d '{"param1": "value", "param2": 1, "param3": ["value1", "value2"]}'
251
+ ```
252
+
253
+ ## Schema options
254
+
255
+ The schema options are used to customize the command line arguments generation, just add a `schema_options` section to the schema.
256
+ ```yaml
257
+ schema_options:
258
+ separator: "=" # --param=value (default is " ")
259
+ noprefix_params: ["param1", "param2"] # omit --param prefix, use "*" to omit all
260
+ convert_params: {"param1": "param2"} # convert param1 to param2
261
+ ```
262
+
211
263
  ## Swagger UI
212
264
 
213
- A swagger UI is available at `http[s]://<srv>/v0/documentation`
265
+ A custom swagger UI is available at `http[s]://<srv>/v0/documentation` with enhanced markdown rendering and form generation for body parameters.
214
266
 
215
267
  <img src="https://github.com/user-attachments/assets/c80a341e-c04c-4606-9510-a57b473a74e5" width="400"/>
216
268
 
269
+ <img src="https://github.com/user-attachments/assets/22261048-459e-4ace-8d04-c568d67bef37" width="400">
270
+
271
+
217
272
  ## API reference
218
273
 
219
274
 
File without changes
File without changes
File without changes
File without changes
File without changes