mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-29 09:12:20 +00:00
add wifi-bands to admin-ui
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
],
|
||||
};
|
||||
|
||||
if (admin_ui.wifi_bands)
|
||||
interface.ssids[0].wifi_bands = admin_ui.wifi_bands;
|
||||
if (admin_ui.wifi_key) {
|
||||
interface.ssids[0].encryption.proto = 'psk2';
|
||||
interface.ssids[0].encryption.key = admin_ui.wifi_key;
|
||||
|
||||
@@ -13,6 +13,19 @@ properties:
|
||||
type: string
|
||||
maxLength: 63
|
||||
minLength: 8
|
||||
wifi-bands:
|
||||
description:
|
||||
The band that the SSID should be broadcasted on. The configuration layer
|
||||
will use the first matching band.
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- 2G
|
||||
- 5G
|
||||
- 5G-lower
|
||||
- 5G-upper
|
||||
- 6G
|
||||
offline-trigger:
|
||||
description:
|
||||
The admin-ui will be spawned when this offline threshold was exceeded.
|
||||
|
||||
@@ -8825,6 +8825,31 @@ function instantiateServiceAdminUi(location, value, errors) {
|
||||
obj.wifi_key = parseWifiKey(location + "/wifi-key", value["wifi-key"], errors);
|
||||
}
|
||||
|
||||
function parseWifiBands(location, value, errors) {
|
||||
if (type(value) == "array") {
|
||||
function parseItem(location, value, errors) {
|
||||
if (type(value) != "string")
|
||||
push(errors, [ location, "must be of type string" ]);
|
||||
|
||||
if (!(value in [ "2G", "5G", "5G-lower", "5G-upper", "6G" ]))
|
||||
push(errors, [ location, "must be one of \"2G\", \"5G\", \"5G-lower\", \"5G-upper\" or \"6G\"" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return map(value, (item, i) => parseItem(location + "/" + i, item, errors));
|
||||
}
|
||||
|
||||
if (type(value) != "array")
|
||||
push(errors, [ location, "must be of type array" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "wifi-bands")) {
|
||||
obj.wifi_bands = parseWifiBands(location + "/wifi-bands", value["wifi-bands"], errors);
|
||||
}
|
||||
|
||||
function parseOfflineTrigger(location, value, errors) {
|
||||
if (!(type(value) in [ "int", "double" ]))
|
||||
push(errors, [ location, "must be of type number" ]);
|
||||
|
||||
@@ -3145,6 +3145,19 @@
|
||||
"maxLength": 63,
|
||||
"minLength": 8
|
||||
},
|
||||
"wifi-bands": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"2G",
|
||||
"5G",
|
||||
"5G-lower",
|
||||
"5G-upper",
|
||||
"6G"
|
||||
]
|
||||
}
|
||||
},
|
||||
"offline-trigger": {
|
||||
"type": "number"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user