diff --git a/front-generator/render-params.json b/front-generator/render-params.json
index bec1081..83dd6bf 100644
--- a/front-generator/render-params.json
+++ b/front-generator/render-params.json
@@ -1,32 +1,73 @@
{
"monitoring-params": {},
- "params": {
- "rxtx": {
- "rx.en": {
- "model": "w:switch",
- "label": "Включить передатчик"
- },
- "rx.isTestInputData": {
- "model": "w:select",
- "label": "Включить передатчик",
- "items": [
- {"value": "false", "label": "Ethernet"},
- {"value": "true", "label": "Тест (CW)"}
- ]
- },
- "rx.freqKhz": {
- "model": "w:number",
- "number.type": "int",
- "number.step": 1,
- "number.min": 500000,
- "number.max": 15000000
- }
- }
- },
"modem_types": {
"tdma": {
"modem_name": "RCSM-101 TDMA",
- "groupsList": ["rxtx", "buclnb"],
+ "params": {
+ "rxtx": [
+ {
+ "widget": "h2",
+ "label": "Настройки приема/передачи"
+ },
+ {
+ "widget": "flex-container",
+ "childs": [
+ {
+ "widget": "settings-container",
+ "childs": [
+ { "widget": "h3", "label": "Настройки передатчика" },
+ {
+ "widget": "checkbox",
+ "label": "Включить передатчик",
+ "name": "txEn"
+ },
+ {
+ "widget": "select",
+ "label": "Входные данные",
+ "name": "txIsTestInput",
+ "values": [
+ {
+ "label": "Тест",
+ "value": "true"
+ },
+ {
+ "label": "SCPC",
+ "value": "false"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "widget": "settings-container",
+ "childs": [
+ { "widget": "h3", "label": "Настройки приемника" },
+ {
+ "widget": "select",
+ "label": "Режим управления усилением",
+ "name": "rxAgcEn",
+ "values": [
+ {
+ "label": "АРУ",
+ "value": "true"
+ },
+ {
+ "label": "РРУ",
+ "value": "false"
+ }
+ ]
+ },
+ {
+ "widget": "checkbox",
+ "label": "Инверсия спектра",
+ "name": "rxSpectrumInversion"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
"tabs": [
{
"name": "monitoring",
@@ -44,7 +85,60 @@
},
"scpc": {
"modem_name": "RCSM-101",
- "groupsList": ["rxtx", "cinc", "buclnb", "qos", "tcpaccel"],
+ "params": {
+ "rxtx": [
+ {
+ "widget": "h2",
+ "label": "Настройки приема/передачи"
+ },
+ {
+ "widget": "settings-container",
+ "childs": [
+ {
+ "widget": "select",
+ "label": "Режим работы",
+ "name": "isCinC",
+ "values": [
+ {
+ "label": "CinC",
+ "value": "true"
+ },
+ {
+ "label": "SCPC",
+ "value": "false"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "widget": "flex-container",
+ "childs": [
+ {
+ "widget": "settings-container",
+ "childs": [
+ { "widget": "h3", "label": "Настройки приема/передачи" },
+ {
+ "widget": "select",
+ "label": "Режим работы",
+ "name": "isCinC",
+ "values": [
+ {
+ "label": "CinC",
+ "value": "true"
+ },
+ {
+ "label": "SCPC",
+ "value": "false"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
"tabs": [
{
"name": "monitoring",
diff --git a/front-generator/render.py b/front-generator/render.py
index acf4018..d1f3881 100644
--- a/front-generator/render.py
+++ b/front-generator/render.py
@@ -4,6 +4,15 @@ import sys
import os
+def extract_param_names(mc):
+ result = {}
+
+
+
+def extract_param_groups(mc):
+ return [k for k in mc['params']]
+
+
def build_modem_env(modem):
with open('render-params.json') as f:
config = json.load(f)
@@ -17,8 +26,9 @@ def build_modem_env(modem):
"modem_name": mc['modem_name'],
"header_tabs": mc['tabs'],
"tab_names_array": [t['name'] for t in mc['tabs']],
- "params": {"groupsList": mc["groupsList"]} | config["params"],
- "all_settings_group_names": []
+ "params": mc["params"],
+ "paramGroupsWithNames": extract_param_names(mc),
+ "paramGroupsList": extract_param_groups(mc),
}
diff --git a/front-generator/template/common/qos-data.js.j2 b/front-generator/template/common/qos-data.js.j2
index e253188..ee1f477 100644
--- a/front-generator/template/common/qos-data.js.j2
+++ b/front-generator/template/common/qos-data.js.j2
@@ -5,7 +5,7 @@
rt3: [],
cd: [],
},
- {% if 'tcpaccel' in params.groupsList %}
+ {% if 'tcpaccel' in params.paramGroupsList %}
paramsTcpAccel: {
en: false,
maxConnections: 128
diff --git a/front-generator/template/common/qos-methods.js.j2 b/front-generator/template/common/qos-methods.js.j2
index a2feefc..45db200 100644
--- a/front-generator/template/common/qos-methods.js.j2
+++ b/front-generator/template/common/qos-methods.js.j2
@@ -1,3 +1,26 @@
+ {% if 'tcpaccel' in params.paramGroupsList %}
+ submitTcpaccelSettings() {
+ if (this.submitStatus.tcpAccel) { return }
+ this.submitStatus.tcpAccel = true
+ fetch('/api/set/tcpAccel', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ "tcpAccel.en": this.param.tcpAccel.en,
+ "tcpAccel.maxConnections": this.param.tcpAccel.maxConnections
+ })
+ }).then(async (resp) => {
+ this.submitStatus.tcpAccel = false
+ this.updateNetworkSettings(await resp.json())
+ }).catch((reason) => {
+ this.submitStatus.tcpAccel = false
+ alert(`Ошибка при применении настроек: ${reason}`)
+ })
+ },
+ updateTcpaccelSettings(vals) { console.log('tcp accel setting update function has no impl! update backend and write this function') }
+ {% endif %}
settingsSubmitQoS() {
if (this.submitStatus.qos) { return }
this.submitStatus.qos = true
@@ -70,29 +93,6 @@
})
},
- {% if 'tcpaccel' in params.groupsList %}
- settingsSubmitTcpAccel() {
- if (this.submitStatus.tcpAccel) { return }
- this.submitStatus.tcpAccel = true
- fetch('/api/set/tcpAccel', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify({
- "tcpAccel.en": this.param.tcpAccel.en,
- "tcpAccel.maxConnections": this.param.tcpAccel.maxConnections
- })
- }).then(async (resp) => {
- this.submitStatus.tcpAccel = false
- this.updateNetworkSettings(await resp.json())
- }).catch((reason) => {
- this.submitStatus.tcpAccel = false
- alert(`Ошибка при применении настроек: ${reason}`)
- })
- },
- {% endif %}
-
updateQosSettings(vals) {
this.submitStatus.qos = false
this.paramsQos.en = vals["settings"]["qos.enabled"]
@@ -240,4 +240,5 @@
}
return result
- },
\ No newline at end of file
+ },
+
diff --git a/front-generator/template/common/qos.html.j2 b/front-generator/template/common/qos.html.j2
index c23bcb1..8a6949a 100644
--- a/front-generator/template/common/qos.html.j2
+++ b/front-generator/template/common/qos.html.j2
@@ -100,7 +100,7 @@
- {% endraw %}{% if 'tcpaccel' in params.groupsList %}{% raw %}
+ {% endraw %}{% if 'tcpaccel' in params.paramGroupsList %}{% raw %}
Настройки TCP-акселерации
+
+
Настройки приема/передачи
+
+
+ Режим работы
+
+
+
+
+
+
Настройки приема/передачи
+
+ Режим работы
+
+
+
+
+
+
+
+
Настройки QoS
@@ -224,26 +252,12 @@
-
Настройки TCP-акселерации
-
-
- Активировать акселерацию
-
-
-
- Максимальное количество соединений
-
-
-
-
-
-
Последнее обновление статистики: {{ lastUpdateTime }}