pywebexec 2.1.14__tar.gz → 2.1.16__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.
- {pywebexec-2.1.14/pywebexec.egg-info → pywebexec-2.1.16}/PKG-INFO +1 -1
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/pywebexec.py +8 -4
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/form.css +17 -2
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/executables.js +2 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/schemaform.js +36 -11
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/script.js +1 -1
- pywebexec-2.1.16/pywebexec/static/jsonform/deps/jsv.js +3700 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/templates/index.html +1 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/version.py +2 -2
- {pywebexec-2.1.14 → pywebexec-2.1.16/pywebexec.egg-info}/PKG-INFO +1 -1
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec.egg-info/SOURCES.txt +1 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/.github/workflows/python-publish.yml +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/.gitignore +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/README.md +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pyproject.toml +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/__init__.py +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/host_ip.py +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/markdown.css +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/style.css +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/swagger-ui.css +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/swagger-ui.css.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/css/xterm.css +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.ttf +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/glyphicons-halflings-regular.eot +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/glyphicons-halflings-regular.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/glyphicons-halflings-regular.ttf +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/glyphicons-halflings-regular.woff +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/aborted.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/copy.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/copy_ok.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/down-arrow.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/failed.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/favicon.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/fit-tty.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/fit-win.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/font-decrease.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/font-increase.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/norun.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/pause.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/popup.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/resume.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/running.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/success.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/images/swagger-ui.svg +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/js-yaml/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/js-yaml/js-yaml.min.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/marked/LICENSE.md +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/marked/marked.min.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/popup.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/swagger-form.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/swagger-ui/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/swagger-ui/swagger-ui-bundle.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/swagger-ui/swagger-ui-standalone-preset.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-canvas.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-canvas.js.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-fit.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-unicode-graphemes.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-unicode-graphemes.js.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-unicode11.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/addon-unicode11.js.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/xterm.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/js/xterm/xterm.js.map +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/LICENSE +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/deps/README.md +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/deps/img/glyphicons-halflings.png +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/deps/jquery.min.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/deps/underscore.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/static/jsonform/lib/jsonform.js +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/swagger.yaml +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/templates/__init__.py +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/templates/popup.html +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec/templates/swagger_ui.html +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec.egg-info/dependency_links.txt +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec.egg-info/entry_points.txt +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec.egg-info/requires.txt +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexec.egg-info/top_level.txt +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/pywebexecdev +0 -0
- {pywebexec-2.1.14 → pywebexec-2.1.16}/setup.cfg +0 -0
@@ -837,6 +837,7 @@ def run_dynamic_command(cmd):
|
|
837
837
|
separator_params = exe.get("schema", {}).get("schema_options", {}).get("separator_params", {})
|
838
838
|
noprefix = exe.get("schema", {}).get("schema_options", {}).get("noprefix_params", {})
|
839
839
|
convert_params = exe.get("schema", {}).get("schema_options", {}).get("convert_params", {})
|
840
|
+
convert_values = exe.get("schema", {}).get("schema_options", {}).get("convert_values", {})
|
840
841
|
schema_params = exe.get("schema", {}).get("properties", {})
|
841
842
|
batch_param = exe.get("schema", {}).get("schema_options", {}).get("batch_param", None)
|
842
843
|
batch_values = []
|
@@ -865,14 +866,17 @@ def run_dynamic_command(cmd):
|
|
865
866
|
separator = ""
|
866
867
|
else:
|
867
868
|
prefix = f"--{param}"
|
868
|
-
if isinstance(value, bool):
|
869
|
+
if isinstance(value, bool) and convert_params.get(param, None) is None:
|
869
870
|
if value:
|
870
871
|
params += f"{prefix} "
|
871
872
|
continue
|
872
|
-
if isinstance(value, dict):
|
873
|
-
value = shlex.quote(json.dumps(value))
|
873
|
+
if isinstance(value, dict) or convert_values.get(param, None) == "json":
|
874
|
+
value = shlex.quote(json.dumps(value, indent=2, sort_keys=False))
|
875
|
+
elif convert_values.get(param, None) == "quote":
|
876
|
+
value = shlex.quote(str(value))
|
877
|
+
else:
|
878
|
+
values = shlex.split(value) if isinstance(value, str) else value
|
874
879
|
params += f"{prefix}{separator}"
|
875
|
-
values = shlex.split(value) if isinstance(value, str) else value
|
876
880
|
if param == batch_param and len(values)>1:
|
877
881
|
batch_values = values
|
878
882
|
value="@1"
|
@@ -196,9 +196,24 @@
|
|
196
196
|
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
|
197
197
|
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
|
198
198
|
}
|
199
|
+
._jsonform-array-deletelast {
|
200
|
+
display: none;
|
201
|
+
}
|
202
|
+
._jsonform-array-buttons {
|
203
|
+
display: block;
|
204
|
+
width: 100%;
|
205
|
+
text-align: right;
|
206
|
+
}
|
207
|
+
i[title="Delete current"] {
|
208
|
+
top: 5px;
|
209
|
+
}
|
210
|
+
._jsonform-array-addmore, ._jsonform-array-deletecurrent {
|
211
|
+
box-shadow: unset;
|
212
|
+
outline: 0;
|
213
|
+
}
|
199
214
|
}
|
200
215
|
|
201
216
|
.swagger-ui textarea {
|
202
|
-
min-height: 130px;
|
203
|
-
overflow-y: hidden;
|
217
|
+
min-height: 130px;
|
218
|
+
overflow-y: hidden;
|
204
219
|
}
|
@@ -267,6 +267,8 @@ paramsInput.addEventListener('focus', () => {
|
|
267
267
|
createSchemaForm($('#schemaForm'), gExecutables[currentCmd].schema, async function (errors, values) {
|
268
268
|
if (errors) {
|
269
269
|
console.log(errors);
|
270
|
+
alert(errors[0].message);
|
271
|
+
return false;
|
270
272
|
} else {
|
271
273
|
const commandName = commandInput.value;
|
272
274
|
fitAddon.fit();
|
@@ -13,7 +13,7 @@ function formInputHandle() {
|
|
13
13
|
if (! inputHandlers.includes(input)) {
|
14
14
|
val = input.value || input.placeholder;
|
15
15
|
if (val) {
|
16
|
-
size = Math.max(val.length
|
16
|
+
size = Math.max(val.length, 2)
|
17
17
|
if (input.type== 'number') {
|
18
18
|
size += 2;
|
19
19
|
}
|
@@ -27,16 +27,22 @@ function formInputHandle() {
|
|
27
27
|
});
|
28
28
|
}
|
29
29
|
|
30
|
-
function extractKeysAndPlaceholders(obj, prefix = '') {
|
30
|
+
function extractKeysAndPlaceholders(obj, formoptions, prefix = '') {
|
31
31
|
let result = [];
|
32
32
|
|
33
33
|
for (let key in obj.properties) {
|
34
34
|
if (obj.properties[key].type === 'object' && obj.properties[key].properties) {
|
35
|
-
result = result.concat(extractKeysAndPlaceholders(obj.properties[key], prefix ? `${prefix}.${key}` : key));
|
35
|
+
result = result.concat(extractKeysAndPlaceholders(obj.properties[key], formoptions, prefix ? `${prefix}.${key}` : key));
|
36
36
|
} else {
|
37
|
+
if (formoptions[`${prefix}.${key}`]) {
|
38
|
+
foptions = formoptions[`${prefix}.${key}`];
|
39
|
+
} else {
|
40
|
+
foptions = {};
|
41
|
+
}
|
37
42
|
result.push({
|
38
43
|
key: prefix ? `${prefix}.${key}` : key,
|
39
|
-
placeholder: obj.properties[key].example || null
|
44
|
+
placeholder: obj.properties[key].example || null,
|
45
|
+
... foptions
|
40
46
|
});
|
41
47
|
}
|
42
48
|
}
|
@@ -44,11 +50,30 @@ function extractKeysAndPlaceholders(obj, prefix = '') {
|
|
44
50
|
}
|
45
51
|
|
46
52
|
function createSchemaForm(form, schema, onSubmit) {
|
47
|
-
|
53
|
+
if (schema && schema.schema_options) {
|
54
|
+
schema_options = schema.schema_options;
|
55
|
+
} else {
|
56
|
+
schema_options = {};
|
57
|
+
}
|
58
|
+
if (schema && schema.properties && schema.properties.params && schema.properties.params.schema_options) {
|
59
|
+
schema_params_options = schema.properties.params.schema_options;
|
60
|
+
} else {
|
61
|
+
schema_params_options = {};
|
62
|
+
}
|
63
|
+
|
64
|
+
formoptions = {};
|
65
|
+
if (schema_options && schema_options.form) {
|
66
|
+
formoptions = schema.schema_options.form;
|
67
|
+
} else if (schema_params_options && schema_params_options.form) {
|
68
|
+
for (let key in schema_params_options.form) {
|
69
|
+
formoptions[`params.${key}`] = schema_params_options.form[key];
|
70
|
+
}
|
71
|
+
}
|
72
|
+
formDesc = extractKeysAndPlaceholders(schema, formoptions);
|
48
73
|
schemaForm = form[0];
|
49
74
|
if (onSubmit != null) {
|
50
|
-
if (
|
51
|
-
schema.properties[
|
75
|
+
if (schema_options && schema_options.batch_param) {
|
76
|
+
schema.properties[schema_options.batch_param].required = true;
|
52
77
|
if (!schema.properties.parallel) {
|
53
78
|
schema.properties['parallel'] = {
|
54
79
|
type: 'integer',
|
@@ -74,7 +99,7 @@ function createSchemaForm(form, schema, onSubmit) {
|
|
74
99
|
});
|
75
100
|
}
|
76
101
|
for (i = 0; i < formDesc.length; i++) {
|
77
|
-
if (formDesc[i].key ==
|
102
|
+
if (formDesc[i].key == schema_options.batch_param) {
|
78
103
|
formDesc[i].type = 'textarea';
|
79
104
|
formDesc[i].required = true;
|
80
105
|
}
|
@@ -93,10 +118,10 @@ function createSchemaForm(form, schema, onSubmit) {
|
|
93
118
|
title: 'Run',
|
94
119
|
});
|
95
120
|
} else {
|
96
|
-
if (
|
97
|
-
schema.properties.params.properties[
|
121
|
+
if (schema_params_options && schema_params_options.batch_param) {
|
122
|
+
schema.properties.params.properties[schema_params_options.batch_param].required = true;
|
98
123
|
for (i = 0; i < formDesc.length; i++) {
|
99
|
-
if (formDesc[i].key == 'params.' +
|
124
|
+
if (formDesc[i].key == 'params.' + schema_params_options.batch_param) {
|
100
125
|
formDesc[i].type = 'textarea';
|
101
126
|
formDesc[i].required = true;
|
102
127
|
}
|
@@ -262,7 +262,7 @@ async function viewOutput(command_id) {
|
|
262
262
|
const commandInfo = document.getElementById('commandInfo');
|
263
263
|
const command = `${data.command.replace(/^\.\//, '')} ${data.params.join(' ')}`;
|
264
264
|
setCommandStatus(data.status)
|
265
|
-
commandInfo.
|
265
|
+
commandInfo.innerHTML = command;
|
266
266
|
commandInfo.setAttribute('title', command);
|
267
267
|
if (data.command == 'term')
|
268
268
|
terminal.options.cursorInactiveStyle = 'outline';
|