@json-editor/json-editor 2.9.0 → 2.10.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/.github/workflows/build.yml +2 -0
- package/CHANGELOG.md +29 -7
- package/README.md +47 -1
- package/config/codeceptjs_helpers.js +4 -8
- package/config/karma.conf.js +0 -4
- package/config/webpack.common.js +1 -1
- package/config/webpack.dev.js +1 -1
- package/config/webpack.nonmin.js +1 -1
- package/config/webpack.prod.js +0 -1
- package/dist/dev/jsoneditor.js +3687 -0
- package/dist/jsoneditor.js +2 -14
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/jsoneditor.js.map +1 -1
- package/dist/nonmin/jsoneditor.js +25744 -26450
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/css_integration.html +17 -15
- package/docs/custom-editor.html +92 -0
- package/docs/datetime.html +37 -2
- package/docs/index.html +4 -1
- package/docs/meta_schema.json +426 -398
- package/package.json +26 -24
- package/src/defaults.js +15 -1
- package/src/editor.js +23 -6
- package/src/editors/integer.js +5 -3
- package/src/editors/multiple.js +67 -8
- package/src/editors/number.js +5 -3
- package/src/editors/object.js +0 -1
- package/src/editors/radio.js +4 -6
- package/src/editors/select.js +0 -6
- package/src/iconlibs/bootstrap.js +28 -0
- package/src/iconlibs/index.js +2 -0
- package/src/resolvers.js +5 -2
- package/src/schemaloader.js +3 -1
- package/src/themes/bootstrap3.js +1 -1
- package/src/utilities.js +22 -0
- package/src/validator.js +93 -0
- package/tests/codeceptjs/constrains/contains_test.js +36 -0
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
- package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
- package/tests/codeceptjs/core_test.js +46 -46
- package/tests/codeceptjs/editors/advanced_test.js +12 -11
- package/tests/codeceptjs/editors/array_any_of_test.js +37 -37
- package/tests/codeceptjs/editors/array_test.js +784 -794
- package/tests/codeceptjs/editors/autocomplete_test.js +4 -6
- package/tests/codeceptjs/editors/button_test.js +30 -29
- package/tests/codeceptjs/editors/checkbox_test.js +19 -18
- package/tests/codeceptjs/editors/colorpicker_test.js +20 -18
- package/tests/codeceptjs/editors/datetime_test.js +11 -11
- package/tests/codeceptjs/editors/inheritance_test.js +8 -9
- package/tests/codeceptjs/editors/integer_test.js +77 -78
- package/tests/codeceptjs/editors/jodit_test.js +18 -19
- package/tests/codeceptjs/editors/multiselect_test.js +6 -6
- package/tests/codeceptjs/editors/number_test.js +72 -71
- package/tests/codeceptjs/editors/object_test.js +52 -26
- package/tests/codeceptjs/editors/option-no_default_values_test.js +6 -6
- package/tests/codeceptjs/editors/programmatic-changes_test.js +4 -5
- package/tests/codeceptjs/editors/radio_test.js +1 -1
- package/tests/codeceptjs/editors/range_test.js +2 -4
- package/tests/codeceptjs/editors/rating_test.js +1 -1
- package/tests/codeceptjs/editors/select_test.js +5 -7
- package/tests/codeceptjs/editors/stepper_test.js +8 -10
- package/tests/codeceptjs/editors/string_test.js +16 -16
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +11 -13
- package/tests/codeceptjs/editors/tabs_test.js +1 -1
- package/tests/codeceptjs/editors/uuid_test.js +15 -15
- package/tests/codeceptjs/editors/validation_test.js +2 -2
- package/tests/codeceptjs/issues/issue-gh-1133_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +1 -3
- package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +3 -5
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
- package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
- package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
- package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
- package/tests/codeceptjs/meta-schema_test.js +12 -12
- package/tests/codeceptjs/schemaloader_test.js +8 -8
- package/tests/codeceptjs/themes_test.js +40 -9
- package/tests/pages/autocomplete.html +1 -0
- package/tests/pages/contains.html +38 -0
- package/tests/pages/dependentSchemas.html +52 -0
- package/tests/pages/if-else.html +57 -0
- package/tests/pages/if-then-else-allOf.html +117 -0
- package/tests/pages/if-then-else.html +64 -0
- package/tests/pages/if-then.html +57 -0
- package/tests/pages/issues/issue-gh-1133.html +64 -0
- package/tests/pages/issues/issue-gh-1158-2.html +189 -0
- package/tests/pages/issues/issue-gh-1164.html +71 -0
- package/tests/pages/issues/issue-gh-1165.html +63 -0
- package/tests/pages/issues/issue-gh-1165.json +8 -0
- package/tests/pages/issues/issue-gh-1211.html +1022 -0
- package/tests/pages/issues/issue-gh-1338.html +74 -0
- package/tests/pages/issues/issue-gh-1347.html +142 -0
- package/tests/pages/issues/issue-gh-795.html +58 -0
- package/tests/pages/issues/issue-gh-810.html +149 -0
- package/tests/pages/maxContains.html +39 -0
- package/tests/pages/meta-schema.html +28 -0
- package/tests/pages/meta_schema.json +426 -398
- package/tests/pages/minContains.html +39 -0
- package/tests/pages/number.html +18 -0
- package/tests/pages/option-dependencies.html +106 -0
- package/tests/pages/themes.html +3 -1
- package/tests/unit/core.spec.js +8 -10
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
|
@@ -0,0 +1,1022 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8"/>
|
|
5
|
+
<title>GitHub Issue 1211</title>
|
|
6
|
+
<link rel="stylesheet" id="theme-link" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
|
|
7
|
+
<link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
|
|
8
|
+
<script src="../../../dist/jsoneditor.js"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div class="container">
|
|
12
|
+
<h1><a href="https://github.com/json-editor/json-editor/issues/1211">GitHub Issue 1211</a></h1>
|
|
13
|
+
<div id='editor_holder'></div>
|
|
14
|
+
<label for="value">Value</label>
|
|
15
|
+
<textarea class="form-control" id="value" rows="12" style="font-size: 12px; font-family: monospace;"></textarea>
|
|
16
|
+
<button id="set-value">Set Value</button>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
var schema = {
|
|
21
|
+
"title": " ",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"options": {
|
|
24
|
+
"disable_collapse": true,
|
|
25
|
+
},
|
|
26
|
+
"definitions": {
|
|
27
|
+
"ruleBase": {
|
|
28
|
+
"title": "ruleBase",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"disable_edit_json": true,
|
|
32
|
+
"disable_collapse": true,
|
|
33
|
+
"properties": {
|
|
34
|
+
"name": {
|
|
35
|
+
"propertyOrder": 1,
|
|
36
|
+
"required": true,
|
|
37
|
+
"title": "Name",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"options": {
|
|
40
|
+
"grid_columns": 6,
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"description": {
|
|
44
|
+
"propertyOrder": 2,
|
|
45
|
+
"required": true,
|
|
46
|
+
"title": "Description",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"options": {
|
|
49
|
+
"grid_columns": 5
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"enabled": {
|
|
53
|
+
"propertyOrder": 3,
|
|
54
|
+
"title": "Enabled",
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"format": "checkbox",
|
|
57
|
+
"options": {
|
|
58
|
+
"grid_columns": 1
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"groupBase": {
|
|
64
|
+
"title": "groupBase",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"format": "grid",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"disable_edit_json": true,
|
|
69
|
+
"collapsed": true,
|
|
70
|
+
"properties": {
|
|
71
|
+
"name": {
|
|
72
|
+
"propertyOrder": 1,
|
|
73
|
+
"required": true,
|
|
74
|
+
"title": "Name",
|
|
75
|
+
"type": "string",
|
|
76
|
+
"options": {
|
|
77
|
+
"grid_columns": 6
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"description": {
|
|
81
|
+
"propertyOrder": 2,
|
|
82
|
+
"required": true,
|
|
83
|
+
"title": "Description",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"options": {
|
|
86
|
+
"grid_columns": 6
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"generic": {
|
|
92
|
+
"title": "Generic Allow Rule",
|
|
93
|
+
"type": "object",
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"disable_edit_json": true,
|
|
96
|
+
"collapsed": true,
|
|
97
|
+
"options": {
|
|
98
|
+
"disable_collapse": true
|
|
99
|
+
},
|
|
100
|
+
"allOf": [
|
|
101
|
+
{
|
|
102
|
+
"$ref": "#/definitions/ruleBase"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"properties": {
|
|
106
|
+
"type": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"required": true,
|
|
109
|
+
"enum": ["any"],
|
|
110
|
+
"default": "any",
|
|
111
|
+
"options": {
|
|
112
|
+
"hidden": true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"custom-cert-ext": {
|
|
118
|
+
"title": "Custom Certificate Extension",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"format": "table",
|
|
121
|
+
"uniqueItems": true,
|
|
122
|
+
"options": {
|
|
123
|
+
"disable_array_reorder": true,
|
|
124
|
+
"disable_collapse": true
|
|
125
|
+
},
|
|
126
|
+
"properties": {
|
|
127
|
+
"type": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"required": true,
|
|
130
|
+
"enum": ["cert-extension"],
|
|
131
|
+
"default": "cert-extension",
|
|
132
|
+
"options": {
|
|
133
|
+
"hidden": true
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"name":{
|
|
137
|
+
"title": "Extension",
|
|
138
|
+
"type": "string",
|
|
139
|
+
"watch": {
|
|
140
|
+
"name": "certificate-extensions"
|
|
141
|
+
},
|
|
142
|
+
"enumSource": [
|
|
143
|
+
{
|
|
144
|
+
"source": "name",
|
|
145
|
+
"filter": "customCertAttrFilter",
|
|
146
|
+
"value": "enumValueCustomCertAttr"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"filter": {
|
|
151
|
+
"title": "Filter Value by",
|
|
152
|
+
"type": "string",
|
|
153
|
+
"default": "*"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"vlan-assignment": {
|
|
159
|
+
"title": "VLAN assignment",
|
|
160
|
+
"required": true,
|
|
161
|
+
"type": "object",
|
|
162
|
+
"oneOf": [
|
|
163
|
+
{
|
|
164
|
+
"type": "object",
|
|
165
|
+
"additionalProperties": false,
|
|
166
|
+
"disable_edit_json": true,
|
|
167
|
+
"title": "Static",
|
|
168
|
+
"options": {
|
|
169
|
+
"disable_collapse": true,
|
|
170
|
+
},
|
|
171
|
+
"properties": {
|
|
172
|
+
"state": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"required": true,
|
|
175
|
+
"enum": ["enabled"],
|
|
176
|
+
"default": "enabled",
|
|
177
|
+
"options": {
|
|
178
|
+
"hidden": true
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"type": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"required": true,
|
|
184
|
+
"enum": ["static"],
|
|
185
|
+
"default": "static",
|
|
186
|
+
"options": {
|
|
187
|
+
"hidden": true
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"vlanid": {
|
|
191
|
+
"title": "VLAN ID",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"disable_edit_json": true,
|
|
194
|
+
"type": "integer"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"title": "By Certificate Extension",
|
|
200
|
+
"$ref": "#/definitions/custom-cert-ext"
|
|
201
|
+
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"title": "By Certificate Subject Name",
|
|
205
|
+
"type": "object",
|
|
206
|
+
"format": "table",
|
|
207
|
+
"uniqueItems": true,
|
|
208
|
+
"options": {
|
|
209
|
+
"disable_array_reorder": true,
|
|
210
|
+
"disable_collapse": true
|
|
211
|
+
},
|
|
212
|
+
"properties": {
|
|
213
|
+
"type": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"required": true,
|
|
216
|
+
"enum": ["cert-subject"],
|
|
217
|
+
"default": "cert-subject",
|
|
218
|
+
"options": {
|
|
219
|
+
"hidden": true
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"identifier": {
|
|
223
|
+
"title": "Distinguished Name attribute",
|
|
224
|
+
"type": "string",
|
|
225
|
+
"enum": ["CN", "OU", "O", "SN", "L"]
|
|
226
|
+
},
|
|
227
|
+
"prefix": {
|
|
228
|
+
"title": "Prefix",
|
|
229
|
+
"type": "string",
|
|
230
|
+
"default": "vlan-"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"$ref": "#/definitions/disabledOption"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"default": {
|
|
240
|
+
"state": "disabled"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"configuration-lan": {
|
|
244
|
+
"title": "Configuration",
|
|
245
|
+
"type": "object",
|
|
246
|
+
"collapsed": true,
|
|
247
|
+
"options": {
|
|
248
|
+
"disable_collapse": true
|
|
249
|
+
},
|
|
250
|
+
"properties": {
|
|
251
|
+
"switch": {
|
|
252
|
+
"title": "Which Switch MAC addresses are allowed(any if disabled)",
|
|
253
|
+
"oneOf": [
|
|
254
|
+
{
|
|
255
|
+
"$ref": "#/definitions/disabledOption"
|
|
256
|
+
}, {
|
|
257
|
+
"title": "Addresses",
|
|
258
|
+
"type": "object",
|
|
259
|
+
"properties": {
|
|
260
|
+
"type": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"required": true,
|
|
263
|
+
"enum": ["switch-mac-addresses"],
|
|
264
|
+
"default": "switch-mac-addresses",
|
|
265
|
+
"options": {
|
|
266
|
+
"hidden": true
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"addresses": {
|
|
270
|
+
"title": "Addresses",
|
|
271
|
+
"type": "array",
|
|
272
|
+
"format": "table",
|
|
273
|
+
"options": {
|
|
274
|
+
"disable_array_reorder": true
|
|
275
|
+
},
|
|
276
|
+
"items": {
|
|
277
|
+
"title": "MAC address",
|
|
278
|
+
"type": "string",
|
|
279
|
+
"default": "any"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
"title": "Groups",
|
|
285
|
+
"type": "array",
|
|
286
|
+
"required": true,
|
|
287
|
+
"format": "table",
|
|
288
|
+
"uniqueItems": true,
|
|
289
|
+
"options": {
|
|
290
|
+
"disable_array_reorder": true,
|
|
291
|
+
"disable_collapse": true
|
|
292
|
+
},
|
|
293
|
+
"items": {
|
|
294
|
+
"title": "Name",
|
|
295
|
+
"type": "string",
|
|
296
|
+
"watch": {
|
|
297
|
+
"name": "groups",
|
|
298
|
+
"type": "groups.type"
|
|
299
|
+
},
|
|
300
|
+
"enumSource": [
|
|
301
|
+
["any"], {
|
|
302
|
+
"source": "name",
|
|
303
|
+
"filter": "switchgroupFilter",
|
|
304
|
+
"title": "enumTitleSwitchGroup",
|
|
305
|
+
"value": "enumValueSwitchGroup"
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
"vlan": {
|
|
313
|
+
"$ref": "#/definitions/vlan-assignment"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"configuration-wifi": {
|
|
318
|
+
"title": "Configuration",
|
|
319
|
+
"type": "object",
|
|
320
|
+
"collapsed": true,
|
|
321
|
+
"options": {
|
|
322
|
+
"disable_collapse": true
|
|
323
|
+
},
|
|
324
|
+
"properties": {
|
|
325
|
+
"ssids": {
|
|
326
|
+
"title": "Which SSIDs are allowed (any if disabled)",
|
|
327
|
+
"oneOf": [
|
|
328
|
+
{
|
|
329
|
+
"$ref": "#/definitions/disabledOption"
|
|
330
|
+
}, {
|
|
331
|
+
"title": "Names",
|
|
332
|
+
"type": "object",
|
|
333
|
+
"options": {
|
|
334
|
+
"disable_collapse": true
|
|
335
|
+
},
|
|
336
|
+
"properties": {
|
|
337
|
+
"type": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"required": true,
|
|
340
|
+
"enum": ["ssid-names"],
|
|
341
|
+
"default": "ssid-names",
|
|
342
|
+
"options": {
|
|
343
|
+
"hidden": true
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"names": {
|
|
347
|
+
"title": "Name",
|
|
348
|
+
"type": "array",
|
|
349
|
+
"format": "table",
|
|
350
|
+
"uniqueItems": true,
|
|
351
|
+
"options": {
|
|
352
|
+
"disable_array_reorder": true,
|
|
353
|
+
"disable_collapse": true
|
|
354
|
+
},
|
|
355
|
+
"items": {
|
|
356
|
+
"title": "SSID Name",
|
|
357
|
+
"type": "string",
|
|
358
|
+
"default": "any"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}, {
|
|
363
|
+
"type": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"required": true,
|
|
366
|
+
"enum": ["ssid-groups"],
|
|
367
|
+
"default": "ssid-groups",
|
|
368
|
+
"options": {
|
|
369
|
+
"hidden": true
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"title": "Groups",
|
|
373
|
+
"type": "array",
|
|
374
|
+
"required": true,
|
|
375
|
+
"format": "table",
|
|
376
|
+
"uniqueItems": true,
|
|
377
|
+
"options": {
|
|
378
|
+
"disable_array_reorder": true,
|
|
379
|
+
"disable_collapse": true
|
|
380
|
+
},
|
|
381
|
+
"items": {
|
|
382
|
+
"title": "Name",
|
|
383
|
+
"type": "string",
|
|
384
|
+
"watch": {
|
|
385
|
+
"name": "groups",
|
|
386
|
+
"type": "groups.type"
|
|
387
|
+
},
|
|
388
|
+
"enumSource": [
|
|
389
|
+
["any"], {
|
|
390
|
+
"source": "name",
|
|
391
|
+
"filter": "ssidgroupFilter",
|
|
392
|
+
"title": "enumTitleSSIDGroup",
|
|
393
|
+
"value": "enumValueSSIDGroup"
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
"aps": {
|
|
401
|
+
"title": "Which Access Point MAC addresses are allowed(any if disabled)",
|
|
402
|
+
"oneOf": [
|
|
403
|
+
{
|
|
404
|
+
"$ref": "#/definitions/disabledOption"
|
|
405
|
+
}, {
|
|
406
|
+
"title": "Addresses",
|
|
407
|
+
"type": "object",
|
|
408
|
+
"options": {
|
|
409
|
+
"disable_collapse": true
|
|
410
|
+
},
|
|
411
|
+
"properties": {
|
|
412
|
+
"type": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"required": true,
|
|
415
|
+
"enum": ["ap-mac-addresses"],
|
|
416
|
+
"default": "ap-mac-addresses",
|
|
417
|
+
"options": {
|
|
418
|
+
"hidden": true
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"addresses": {
|
|
422
|
+
"title": "Addresses",
|
|
423
|
+
"type": "array",
|
|
424
|
+
"format": "table",
|
|
425
|
+
"options": {
|
|
426
|
+
"disable_array_reorder": true,
|
|
427
|
+
"disable_collapse": true
|
|
428
|
+
},
|
|
429
|
+
"items": {
|
|
430
|
+
"title": "MAC address",
|
|
431
|
+
"type": "string",
|
|
432
|
+
"default": "any"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}, {
|
|
437
|
+
"title": "Groups",
|
|
438
|
+
"type": "array",
|
|
439
|
+
"required": true,
|
|
440
|
+
"format": "table",
|
|
441
|
+
"uniqueItems": true,
|
|
442
|
+
"options": {
|
|
443
|
+
"disable_array_reorder": true,
|
|
444
|
+
"disable_collapse": true
|
|
445
|
+
},
|
|
446
|
+
"items": {
|
|
447
|
+
"title": "Name",
|
|
448
|
+
"type": "string",
|
|
449
|
+
"watch": {
|
|
450
|
+
"name": "groups",
|
|
451
|
+
"type": "groups.type"
|
|
452
|
+
},
|
|
453
|
+
"enumSource": [
|
|
454
|
+
["any"], {
|
|
455
|
+
"source": "name",
|
|
456
|
+
"filter": "apgroupFilter",
|
|
457
|
+
"title": "enumTitleAPGroup",
|
|
458
|
+
"value": "enumValueAPGroup"
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
|
|
466
|
+
"vlan": {
|
|
467
|
+
"$ref": "#/definitions/vlan-assignment"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"wifi": {
|
|
472
|
+
"title": "WiFi Rule",
|
|
473
|
+
"type": "object",
|
|
474
|
+
"additionalProperties": false,
|
|
475
|
+
"disable_edit_json": true,
|
|
476
|
+
"collapsed": true,
|
|
477
|
+
"options": {
|
|
478
|
+
"disable_collapse": true
|
|
479
|
+
},
|
|
480
|
+
"allOf": [
|
|
481
|
+
{
|
|
482
|
+
"$ref": "#/definitions/ruleBase"
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
"properties": {
|
|
486
|
+
"type": {
|
|
487
|
+
"type": "string",
|
|
488
|
+
"required": true,
|
|
489
|
+
"enum": ["wifi"],
|
|
490
|
+
"default": "wifi",
|
|
491
|
+
"options": {
|
|
492
|
+
"hidden": true
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
|
|
496
|
+
"authentication": {
|
|
497
|
+
"$ref": "#/definitions/authenticaton"
|
|
498
|
+
},
|
|
499
|
+
"configuration": {
|
|
500
|
+
"$ref": "#/definitions/configuration-wifi"
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"lan": {
|
|
505
|
+
"title": "LAN Rule",
|
|
506
|
+
"type": "object",
|
|
507
|
+
"additionalProperties": false,
|
|
508
|
+
"disable_edit_json": true,
|
|
509
|
+
"collapsed": true,
|
|
510
|
+
"options": {
|
|
511
|
+
"disable_collapse": true
|
|
512
|
+
},
|
|
513
|
+
"allOf": [
|
|
514
|
+
{
|
|
515
|
+
"$ref": "#/definitions/ruleBase"
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
"properties": {
|
|
519
|
+
"type": {
|
|
520
|
+
"type": "string",
|
|
521
|
+
"required": true,
|
|
522
|
+
"enum": ["lan"],
|
|
523
|
+
"default": "lan",
|
|
524
|
+
"options": {
|
|
525
|
+
"hidden": true
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"authentication": {
|
|
529
|
+
"propertyOrder": 4,
|
|
530
|
+
"$ref": "#/definitions/authenticaton"
|
|
531
|
+
},
|
|
532
|
+
"configuration": {
|
|
533
|
+
"$ref": "#/definitions/configuration-lan"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"authenticaton": {
|
|
538
|
+
"title": "Authentication",
|
|
539
|
+
"type": "object",
|
|
540
|
+
"collapsed": true,
|
|
541
|
+
"options": {
|
|
542
|
+
"disable_collapse": true
|
|
543
|
+
},
|
|
544
|
+
"properties": {
|
|
545
|
+
"cert": {
|
|
546
|
+
"title": "Certificate-based authentication",
|
|
547
|
+
"type": "object",
|
|
548
|
+
"required": true,
|
|
549
|
+
"collapsed": true,
|
|
550
|
+
"options": {
|
|
551
|
+
"disable_collapse": true,
|
|
552
|
+
},
|
|
553
|
+
"oneOf": [
|
|
554
|
+
{
|
|
555
|
+
"$ref": "#/definitions/disabledOption"
|
|
556
|
+
}, {
|
|
557
|
+
"type": "object",
|
|
558
|
+
"additionalProperties": false,
|
|
559
|
+
"disable_edit_json": true,
|
|
560
|
+
"title": "enabled",
|
|
561
|
+
"properties": {
|
|
562
|
+
"type": {
|
|
563
|
+
"type": "string",
|
|
564
|
+
"required": true,
|
|
565
|
+
"default": "cert",
|
|
566
|
+
"options": {
|
|
567
|
+
"hidden": true
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"state": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"required": true,
|
|
573
|
+
"enum": ["enabled"],
|
|
574
|
+
"default": "enabled",
|
|
575
|
+
"options": {
|
|
576
|
+
"hidden": true
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
"roots": {
|
|
580
|
+
"title": "Filter allowed certificates(any if disabled)",
|
|
581
|
+
"oneOf": [
|
|
582
|
+
{
|
|
583
|
+
"$ref": "#/definitions/disabledOption"
|
|
584
|
+
}, {
|
|
585
|
+
"title": "Allowed trusted roots",
|
|
586
|
+
"type": "array",
|
|
587
|
+
"format": "table",
|
|
588
|
+
"uniqueItems": true,
|
|
589
|
+
"options": {
|
|
590
|
+
"disable_array_reorder": true,
|
|
591
|
+
"disable_collapse": true,
|
|
592
|
+
|
|
593
|
+
},
|
|
594
|
+
"items": {
|
|
595
|
+
"title": "Certificate Subject",
|
|
596
|
+
"type": "string",
|
|
597
|
+
"watch": {
|
|
598
|
+
"subject": "trustedroots"
|
|
599
|
+
},
|
|
600
|
+
"enumSource": [
|
|
601
|
+
{
|
|
602
|
+
"source": "subject",
|
|
603
|
+
"filter": "trustedrootFilter",
|
|
604
|
+
"title": "enumTitleTrustedRoot",
|
|
605
|
+
"value": "enumValueTrustedRoot"
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
]
|
|
611
|
+
},
|
|
612
|
+
"intuneids": {
|
|
613
|
+
"title": "Filter allowed Intune IDs(any if disabled)",
|
|
614
|
+
"oneOf": [
|
|
615
|
+
{
|
|
616
|
+
"$ref": "#/definitions/disabledOption"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"title": "Ignore",
|
|
620
|
+
"type": "object",
|
|
621
|
+
"options": {
|
|
622
|
+
"disable_array_reorder": true,
|
|
623
|
+
"disable_collapse": true,
|
|
624
|
+
"collapsed": true
|
|
625
|
+
},
|
|
626
|
+
"properties": {
|
|
627
|
+
"type": {
|
|
628
|
+
"type": "string",
|
|
629
|
+
"required": true,
|
|
630
|
+
"enum": ["ignore"],
|
|
631
|
+
"default": "ignore",
|
|
632
|
+
"options": {
|
|
633
|
+
"hidden": true
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"title": "Allowed Intune IDs",
|
|
640
|
+
"type": "array",
|
|
641
|
+
"format": "table",
|
|
642
|
+
"uniqueItems": true,
|
|
643
|
+
"options": {
|
|
644
|
+
"disable_array_reorder": true,
|
|
645
|
+
"disable_collapse": true
|
|
646
|
+
},
|
|
647
|
+
"items": {
|
|
648
|
+
"title": "Intune ID",
|
|
649
|
+
"type": "string",
|
|
650
|
+
"watch": {
|
|
651
|
+
"id": "intuneids"
|
|
652
|
+
},
|
|
653
|
+
"enumSource": [
|
|
654
|
+
{
|
|
655
|
+
"source": "id",
|
|
656
|
+
"filter": "intuneidFilter",
|
|
657
|
+
"title": "enumTitleIntuneid",
|
|
658
|
+
"value": "enumValueIntuneid"
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
]
|
|
668
|
+
},
|
|
669
|
+
"password": {
|
|
670
|
+
"title": "Username/Password-based authentication",
|
|
671
|
+
"required": true,
|
|
672
|
+
"type": "object",
|
|
673
|
+
"collapsed": true,
|
|
674
|
+
"options": {
|
|
675
|
+
"disable_collapse": true
|
|
676
|
+
},
|
|
677
|
+
"oneOf": [
|
|
678
|
+
{
|
|
679
|
+
"$ref": "#/definitions/disabledOption"
|
|
680
|
+
}, {
|
|
681
|
+
"type": "object",
|
|
682
|
+
"additionalProperties": false,
|
|
683
|
+
"title": "enabled",
|
|
684
|
+
"options": {
|
|
685
|
+
"disable_collapse": true
|
|
686
|
+
},
|
|
687
|
+
"properties": {
|
|
688
|
+
"type": {
|
|
689
|
+
"type": "string",
|
|
690
|
+
"required": true,
|
|
691
|
+
"default": "password",
|
|
692
|
+
"options": {
|
|
693
|
+
"hidden": true
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
"state": {
|
|
697
|
+
"type": "string",
|
|
698
|
+
"required": true,
|
|
699
|
+
"enum": ["enabled"],
|
|
700
|
+
"default": "enabled",
|
|
701
|
+
"options": {
|
|
702
|
+
"hidden": true
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
"username-regex": {
|
|
706
|
+
"title": "User name Regex",
|
|
707
|
+
"type": "string",
|
|
708
|
+
"default": ".*"
|
|
709
|
+
},
|
|
710
|
+
"owner-rule": {
|
|
711
|
+
"options": {
|
|
712
|
+
"infoText": "Infotext"
|
|
713
|
+
},
|
|
714
|
+
"title": "Owner Regex",
|
|
715
|
+
"type": "string",
|
|
716
|
+
"default": ".*"
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
],
|
|
721
|
+
"default": {
|
|
722
|
+
"state": "disabled"
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
"disabledOption": {
|
|
728
|
+
"type": "object",
|
|
729
|
+
"additionalProperties": false,
|
|
730
|
+
"disable_edit_json": true,
|
|
731
|
+
"title": "disabled",
|
|
732
|
+
"options": {
|
|
733
|
+
"collapsed": true,
|
|
734
|
+
"disable_edit_json": true,
|
|
735
|
+
"disable_properties": true,
|
|
736
|
+
"disable_collapse": true,
|
|
737
|
+
},
|
|
738
|
+
"properties": {
|
|
739
|
+
"state": {
|
|
740
|
+
"type": "string",
|
|
741
|
+
"required": true,
|
|
742
|
+
"enum": ["disabled"],
|
|
743
|
+
"default": "disabled",
|
|
744
|
+
"options": {
|
|
745
|
+
"hidden": true
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"ssid-group": {
|
|
751
|
+
"title": "SSID Group",
|
|
752
|
+
"type": "object",
|
|
753
|
+
"additionalProperties": false,
|
|
754
|
+
"disable_edit_json": true,
|
|
755
|
+
"uniqueItems": true,
|
|
756
|
+
"collapsed": true,
|
|
757
|
+
"options": {
|
|
758
|
+
"disable_collapse": true
|
|
759
|
+
},
|
|
760
|
+
"allOf": [
|
|
761
|
+
{
|
|
762
|
+
"$ref": "#/definitions/groupBase"
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
"properties": {
|
|
766
|
+
"type": {
|
|
767
|
+
"type": "string",
|
|
768
|
+
"required": true,
|
|
769
|
+
"enum": ["ssid-group"],
|
|
770
|
+
"default": "ssid-group",
|
|
771
|
+
"options": {
|
|
772
|
+
"hidden": true
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
"ssid-group": {
|
|
776
|
+
"title": " ",
|
|
777
|
+
"type": "array",
|
|
778
|
+
"format": "table",
|
|
779
|
+
"uniqueItems": true,
|
|
780
|
+
"options": {
|
|
781
|
+
"disable_array_reorder": true,
|
|
782
|
+
"disable_collapse": true
|
|
783
|
+
},
|
|
784
|
+
"items": {
|
|
785
|
+
"title": "SSID",
|
|
786
|
+
"type": "string"
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
"ap-group": {
|
|
792
|
+
"title": "AP Group",
|
|
793
|
+
"type": "object",
|
|
794
|
+
"additionalProperties": false,
|
|
795
|
+
"disable_edit_json": true,
|
|
796
|
+
"uniqueItems": true,
|
|
797
|
+
"collapsed": true,
|
|
798
|
+
"options": {
|
|
799
|
+
"disable_array_reorder": true,
|
|
800
|
+
"disable_collapse": true,
|
|
801
|
+
},
|
|
802
|
+
"allOf": [
|
|
803
|
+
{
|
|
804
|
+
"$ref": "#/definitions/groupBase"
|
|
805
|
+
}
|
|
806
|
+
],
|
|
807
|
+
"properties": {
|
|
808
|
+
"type": {
|
|
809
|
+
"type": "string",
|
|
810
|
+
"required": true,
|
|
811
|
+
"enum": ["ap-mac-group"],
|
|
812
|
+
"default": "ap-mac-group",
|
|
813
|
+
"options": {
|
|
814
|
+
"hidden": true
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
"macs": {
|
|
818
|
+
"title": " ",
|
|
819
|
+
"type": "array",
|
|
820
|
+
"format": "table",
|
|
821
|
+
"uniqueItems": true,
|
|
822
|
+
"options": {
|
|
823
|
+
"disable_array_reorder": true,
|
|
824
|
+
"disable_collapse": true
|
|
825
|
+
},
|
|
826
|
+
"items": {
|
|
827
|
+
"title": "MAC address",
|
|
828
|
+
"type": "string",
|
|
829
|
+
"default": "any"
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
"switch-group": {
|
|
835
|
+
"title": "Switch Group",
|
|
836
|
+
"type": "object",
|
|
837
|
+
"additionalProperties": false,
|
|
838
|
+
"disable_edit_json": true,
|
|
839
|
+
"uniqueItems": true,
|
|
840
|
+
"collapsed": true,
|
|
841
|
+
"options": {
|
|
842
|
+
"disable_array_reorder": true,
|
|
843
|
+
"disable_collapse": true
|
|
844
|
+
},
|
|
845
|
+
"allOf": [
|
|
846
|
+
{
|
|
847
|
+
"$ref": "#/definitions/groupBase"
|
|
848
|
+
}
|
|
849
|
+
],
|
|
850
|
+
"properties": {
|
|
851
|
+
"type": {
|
|
852
|
+
"type": "string",
|
|
853
|
+
"required": true,
|
|
854
|
+
"enum": ["switch-mac-group"],
|
|
855
|
+
"default": "switch-mac-group",
|
|
856
|
+
"options": {
|
|
857
|
+
"hidden": true
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
"macs": {
|
|
861
|
+
"title": " ",
|
|
862
|
+
"type": "array",
|
|
863
|
+
"format": "table",
|
|
864
|
+
"uniqueItems": true,
|
|
865
|
+
"options": {
|
|
866
|
+
"disable_array_reorder": true,
|
|
867
|
+
"disable_collapse": true
|
|
868
|
+
},
|
|
869
|
+
"items": {
|
|
870
|
+
"title": "MAC address",
|
|
871
|
+
"type": "string",
|
|
872
|
+
"default": "any"
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
"properties": {
|
|
879
|
+
"rules": {
|
|
880
|
+
"type": "array",
|
|
881
|
+
"title": "Rule collection",
|
|
882
|
+
"uniqueItems": true,
|
|
883
|
+
"format": "tabs-top",
|
|
884
|
+
"options": {
|
|
885
|
+
"disable_array_reorder": false,
|
|
886
|
+
"disable_collapse": true,
|
|
887
|
+
"infoText": "Infotext"
|
|
888
|
+
},
|
|
889
|
+
"items": {
|
|
890
|
+
"title": "Rule",
|
|
891
|
+
|
|
892
|
+
"headerTemplate": "{{ self.name }} -- {{#self.enabled}}Enabled{{/self.enabled}}{{^self.enabled}}Disabled{{/self.enabled}}",
|
|
893
|
+
|
|
894
|
+
"oneOf": [
|
|
895
|
+
{
|
|
896
|
+
"$ref": "#/definitions/generic"
|
|
897
|
+
}, {
|
|
898
|
+
"$ref": "#/definitions/wifi"
|
|
899
|
+
}, {
|
|
900
|
+
"$ref": "#/definitions/lan"
|
|
901
|
+
}
|
|
902
|
+
]
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
"groups": {
|
|
906
|
+
"type": "array",
|
|
907
|
+
"title": "SSID & MAC Groups",
|
|
908
|
+
"uniqueItems": true,
|
|
909
|
+
"format": "tabs-top",
|
|
910
|
+
"collapsed": true,
|
|
911
|
+
"options": {
|
|
912
|
+
"disable_array_reorder": false,
|
|
913
|
+
"disable_collapse": true,
|
|
914
|
+
"infoText": "Infotext"
|
|
915
|
+
},
|
|
916
|
+
"items": {
|
|
917
|
+
"title": "Group",
|
|
918
|
+
|
|
919
|
+
"headerTemplate": "{{ self.name }}",
|
|
920
|
+
|
|
921
|
+
"oneOf": [
|
|
922
|
+
{
|
|
923
|
+
"$ref": "#/definitions/ssid-group"
|
|
924
|
+
}, {
|
|
925
|
+
"$ref": "#/definitions/ap-group"
|
|
926
|
+
}, {
|
|
927
|
+
"$ref": "#/definitions/switch-group"
|
|
928
|
+
}
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"certificate-extensions": {
|
|
933
|
+
"type": "array",
|
|
934
|
+
"title": "Certificate Extensions",
|
|
935
|
+
"uniqueItems": true,
|
|
936
|
+
"format": "table",
|
|
937
|
+
"collapsed": true,
|
|
938
|
+
"options": {
|
|
939
|
+
"disable_array_reorder": "true",
|
|
940
|
+
"disable_collapse": true,
|
|
941
|
+
"infoText": "Infotext"
|
|
942
|
+
},
|
|
943
|
+
"items": {
|
|
944
|
+
"title": "Extension",
|
|
945
|
+
"properties":{
|
|
946
|
+
"name": {
|
|
947
|
+
"title": "Name",
|
|
948
|
+
"type": "string"
|
|
949
|
+
},
|
|
950
|
+
"oid": {
|
|
951
|
+
"title": "OID",
|
|
952
|
+
"type": "string"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
"trustedroots": {
|
|
958
|
+
"type": "array",
|
|
959
|
+
"title": "Trusted Roots",
|
|
960
|
+
"options": {
|
|
961
|
+
"hidden": true
|
|
962
|
+
},
|
|
963
|
+
"items": {
|
|
964
|
+
"title": "Cert object",
|
|
965
|
+
"type": "object",
|
|
966
|
+
"properties": {
|
|
967
|
+
"subject": {
|
|
968
|
+
"type": "string"
|
|
969
|
+
},
|
|
970
|
+
"type": {
|
|
971
|
+
"type": "string"
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
"intuneids": {
|
|
977
|
+
"type": "array",
|
|
978
|
+
"title": "Intune IDs",
|
|
979
|
+
"options": {
|
|
980
|
+
"hidden": true
|
|
981
|
+
},
|
|
982
|
+
"items": {
|
|
983
|
+
"title": "Intune ID",
|
|
984
|
+
"type": "object",
|
|
985
|
+
"properties": {
|
|
986
|
+
"id": {
|
|
987
|
+
"type": "string"
|
|
988
|
+
},
|
|
989
|
+
"type": {
|
|
990
|
+
"type": "string"
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
var value = document.querySelector('#value')
|
|
999
|
+
var setValue = document.querySelector('#set-value')
|
|
1000
|
+
var editor = new JSONEditor(document.getElementById('editor_holder'), {
|
|
1001
|
+
iconlib: 'fontawesome5',
|
|
1002
|
+
disable_array_delete_all_rows: true,
|
|
1003
|
+
no_additional_properties: true,
|
|
1004
|
+
disable_edit_json: true,
|
|
1005
|
+
input_size: 'small',
|
|
1006
|
+
disable_properties: true,
|
|
1007
|
+
disable_array_delete_last_row: true,
|
|
1008
|
+
schema: schema,
|
|
1009
|
+
theme: 'bootstrap4',
|
|
1010
|
+
keep_oneof_values: false
|
|
1011
|
+
})
|
|
1012
|
+
|
|
1013
|
+
editor.on('change', function () {
|
|
1014
|
+
value.value = JSON.stringify(editor.getValue())
|
|
1015
|
+
})
|
|
1016
|
+
|
|
1017
|
+
setValue.addEventListener('click', function () {
|
|
1018
|
+
editor.setValue(JSON.parse(value.value))
|
|
1019
|
+
})
|
|
1020
|
+
</script>
|
|
1021
|
+
</body>
|
|
1022
|
+
</html>
|