underpost 2.89.44 → 2.90.0
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.
- package/README.md +2 -2
- package/cli.md +112 -101
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +8 -24
- package/manifests/kubeadm-calico-config.yaml +1 -1
- package/manifests/lxd/underpost-setup.sh +1 -1
- package/package.json +1 -1
- package/scripts/nvim.sh +1 -1
- package/src/cli/cluster.js +17 -55
- package/src/cli/db.js +34 -10
- package/src/cli/deploy.js +280 -178
- package/src/cli/index.js +18 -4
- package/src/cli/monitor.js +4 -2
- package/src/cli/run.js +218 -13
- package/src/client/components/core/CalendarCore.js +1 -7
- package/src/client/components/core/Modal.js +2 -2
- package/src/client/components/core/Panel.js +1 -1
- package/src/client/components/core/PanelForm.js +1 -5
- package/src/client/components/default/MenuDefault.js +5 -30
- package/src/index.js +1 -1
- package/src/server/client-build.js +13 -31
- package/src/server/json-schema.js +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
function isPlainObject(obj) {
|
|
2
|
-
return obj ? typeof obj === 'object' && Object.getPrototypeOf(obj) === Object.prototype : false;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
const supportType = ['string', 'number', 'array', 'object', 'boolean', 'integer'];
|
|
6
|
-
|
|
7
|
-
function getType(type) {
|
|
8
|
-
if (!type) type = 'string';
|
|
9
|
-
if (supportType.indexOf(type) !== -1) {
|
|
10
|
-
return type;
|
|
11
|
-
}
|
|
12
|
-
return typeof type;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function isSchema(object) {
|
|
16
|
-
if (supportType.indexOf(object.type) !== -1) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function handleSchema(json, schema) {
|
|
23
|
-
Object.assign(schema, json);
|
|
24
|
-
if (schema.type === 'object') {
|
|
25
|
-
delete schema.properties;
|
|
26
|
-
parse(json.properties, schema);
|
|
27
|
-
}
|
|
28
|
-
if (schema.type === 'array') {
|
|
29
|
-
delete schema.items;
|
|
30
|
-
schema.items = {};
|
|
31
|
-
parse(json.items, schema.items);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function handleArray(arr, schema) {
|
|
36
|
-
schema.type = 'array';
|
|
37
|
-
let props = (schema.items = {});
|
|
38
|
-
parse(arr[0], props);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function handleObject(json, schema) {
|
|
42
|
-
if (isSchema(json)) {
|
|
43
|
-
return handleSchema(json, schema);
|
|
44
|
-
}
|
|
45
|
-
schema.type = 'object';
|
|
46
|
-
schema.required = [];
|
|
47
|
-
let props = (schema.properties = {});
|
|
48
|
-
for (let key in json) {
|
|
49
|
-
let item = json[key];
|
|
50
|
-
let curSchema = (props[key] = {});
|
|
51
|
-
if (key[0] === '*') {
|
|
52
|
-
delete props[key];
|
|
53
|
-
key = key.substr(1);
|
|
54
|
-
schema.required.push(key);
|
|
55
|
-
curSchema = props[key] = {};
|
|
56
|
-
}
|
|
57
|
-
parse(item, curSchema);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function parse(json, schema) {
|
|
62
|
-
if (Array.isArray(json)) {
|
|
63
|
-
handleArray(json, schema);
|
|
64
|
-
} else if (isPlainObject(json)) {
|
|
65
|
-
handleObject(json, schema);
|
|
66
|
-
} else {
|
|
67
|
-
schema.type = getType(json);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function ejs(data) {
|
|
72
|
-
let JsonSchema = {};
|
|
73
|
-
parse(data, JsonSchema);
|
|
74
|
-
return JsonSchema;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { ejs };
|