работающая генерация настроек
This commit is contained in:
parent
44aec3a114
commit
a7242c186d
@ -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",
|
||||
|
@ -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),
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
rt3: [],
|
||||
cd: [],
|
||||
},
|
||||
{% if 'tcpaccel' in params.groupsList %}
|
||||
{% if 'tcpaccel' in params.paramGroupsList %}
|
||||
paramsTcpAccel: {
|
||||
en: false,
|
||||
maxConnections: 128
|
||||
|
@ -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
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitQoS()">Применить <span class="submit-spinner" v-show="submitStatus.qos"></span></button>
|
||||
|
||||
{% endraw %}{% if 'tcpaccel' in params.groupsList %}{% raw %}
|
||||
{% endraw %}{% if 'tcpaccel' in params.paramGroupsList %}{% raw %}
|
||||
<h2>Настройки TCP-акселерации</h2>
|
||||
<div class="settings-set-container">
|
||||
<label>
|
||||
|
@ -0,0 +1,55 @@
|
||||
{% if 'rxtx' in params.paramGroupsList %}
|
||||
paramsRxtx: {
|
||||
isCinC: Boolean,
|
||||
txEn: Boolean, // включен/выключен
|
||||
modulatorMode: 'normal', // режим работы модулятора
|
||||
autoStartTx: Boolean, // было "режим работы передатчика"
|
||||
isTestInputData: Boolean, // входные данные: eth или test
|
||||
txAttenuation: Number, // ослабление
|
||||
txRolloff: Number,
|
||||
txCymRate: Number,
|
||||
txCenterFreq: Number,
|
||||
txMode: null, // ccm/acm
|
||||
txFrameSizeNormal: null, // 'normal' / 'short'
|
||||
txIsPilots: false,
|
||||
txCcmModulation: null,
|
||||
txCcmSpeed: null,
|
||||
txAcmMaxModulation: null,
|
||||
txAcmMaxSpeed: null,
|
||||
txAcmMinModulation: null,
|
||||
txAcmMinSpeed: null,
|
||||
txSnrReserve: null,
|
||||
txServicePacketPeriod: null,
|
||||
txAcmEn: false,
|
||||
txAcmMaxAttenuation: null,
|
||||
txAcmMinAttenuation: null,
|
||||
txAcmRequiredSnr: null,
|
||||
|
||||
rxGainMode: null, // 'auto'/'manual' режим управления усилением
|
||||
rxManualGain: 0, // усиление, только для ручного режима
|
||||
rxSpectrumInversion: false,
|
||||
rxRolloff: 0,
|
||||
rxCymRate: 100000,
|
||||
rxCenterFreq: 1200000.0,
|
||||
},
|
||||
{% endif %}
|
||||
{% if 'cinc' in params.paramGroupsList %}
|
||||
paramsCinc: {
|
||||
cincMode: null, // 'positional' | 'delay'
|
||||
cincSearchBandwidth: 0, // полоса поиска в кГц
|
||||
cincPosition: {station: {latitude: 0, longitude: 0}, satelliteLongitude: 0},
|
||||
cincDelayMin: 0,
|
||||
cincDelayMax: 0
|
||||
},
|
||||
{% endif %}
|
||||
{% if 'buclnb' in params.paramGroupsList %}
|
||||
paramsBuclnb: {
|
||||
bucRefClk10M: false, // подача опоры 10MHz
|
||||
bucPowering: 0, // 0, 24, 48
|
||||
lnbRefclk10m: false, // подача опоры 10MHz
|
||||
lnbPowering: 0 // 0, 13, 18, 24
|
||||
sysRefClk10M: false, // подача опоры 10MHz
|
||||
sysAutoStart: false
|
||||
},
|
||||
{% endif %}
|
||||
|
@ -1,4 +1,5 @@
|
||||
settingsSubmitRxTx() {
|
||||
{% if 'rxtx' in params.paramGroupsList %}
|
||||
settingsSubmitRxtx() {
|
||||
if (this.submitStatus.rxTx) { return }
|
||||
// потом добавить: "dvbs2.isPilots": this.param.dvbs2.isPilots
|
||||
let query = {
|
||||
@ -45,6 +46,49 @@
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
},
|
||||
updateRxtxSettings(vals) {
|
||||
this.submitStatus.rxTx = false
|
||||
this.param.general.isCinC = vals["settings"]["general.isCinC"]
|
||||
this.param.general.txEn = vals["settings"]["general.txEn"]
|
||||
this.param.general.modulatorMode = vals["settings"]["general.modulatorMode"]
|
||||
this.param.general.autoStartTx = vals["settings"]["general.autoStartTx"]
|
||||
this.param.general.isTestInputData = vals["settings"]["general.isTestInputData"]
|
||||
|
||||
this.param.tx.attenuation = vals["settings"]["tx.attenuation"]
|
||||
this.param.tx.rolloff = vals["settings"]["tx.rolloff"]
|
||||
this.param.tx.cymRate = vals["settings"]["tx.cymRate"]
|
||||
this.param.tx.centerFreq = vals["settings"]["tx.centerFreq"]
|
||||
|
||||
this.param.dvbs2.mode = (vals["settings"]["dvbs2.isAcm"] ? 'acm' : 'ccm')
|
||||
this.param.dvbs2.frameSizeNormal = vals["settings"]["dvbs2.frameSizeNormal"]
|
||||
// this.param.dvbs2.isPilots = vals["settings"]["dvbs2.isPilots"]
|
||||
|
||||
let m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.ccm_modcod"])
|
||||
this.param.dvbs2.ccm_modulation = m.modulation
|
||||
this.param.dvbs2.ccm_speed = m.speed
|
||||
m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.acm_maxModcod"])
|
||||
this.param.dvbs2.acm_maxModulation = m.modulation
|
||||
this.param.dvbs2.acm_maxSpeed = m.speed
|
||||
m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.acm_minModcod"])
|
||||
this.param.dvbs2.acm_minModulation = m.modulation
|
||||
this.param.dvbs2.acm_minSpeed = m.speed
|
||||
|
||||
this.param.dvbs2.snrReserve = vals["settings"]["dvbs2.snrReserve"]
|
||||
this.param.dvbs2.servicePacketPeriod = vals["settings"]["dvbs2.servicePacketPeriod"]
|
||||
|
||||
this.param.acm.en = vals["settings"]["acm.en"]
|
||||
this.param.acm.maxAttenuation = vals["settings"]["acm.maxAttenuation"]
|
||||
this.param.acm.minAttenuation = vals["settings"]["acm.minAttenuation"]
|
||||
this.param.acm.requiredSnr = vals["settings"]["acm.requiredSnr"]
|
||||
|
||||
this.param.rx.gainMode = vals["settings"]["rx.gainMode"]
|
||||
this.param.rx.manualGain = vals["settings"]["rx.manualGain"]
|
||||
this.param.rx.spectrumInversion = vals["settings"]["rx.spectrumInversion"]
|
||||
this.param.rx.rolloff = vals["settings"]["rx.rolloff"]
|
||||
this.param.rx.cymRate = vals["settings"]["rx.cymRate"]
|
||||
this.param.rx.centerFreq = vals["settings"]["rx.centerFreq"]
|
||||
},
|
||||
{% endif %}
|
||||
|
||||
settingsSubmitCinC() {
|
||||
if (this.submitStatus.cinc) { return }
|
||||
@ -102,48 +146,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
updateRxTxSettings(vals) {
|
||||
this.submitStatus.rxTx = false
|
||||
this.param.general.isCinC = vals["settings"]["general.isCinC"]
|
||||
this.param.general.txEn = vals["settings"]["general.txEn"]
|
||||
this.param.general.modulatorMode = vals["settings"]["general.modulatorMode"]
|
||||
this.param.general.autoStartTx = vals["settings"]["general.autoStartTx"]
|
||||
this.param.general.isTestInputData = vals["settings"]["general.isTestInputData"]
|
||||
|
||||
this.param.tx.attenuation = vals["settings"]["tx.attenuation"]
|
||||
this.param.tx.rolloff = vals["settings"]["tx.rolloff"]
|
||||
this.param.tx.cymRate = vals["settings"]["tx.cymRate"]
|
||||
this.param.tx.centerFreq = vals["settings"]["tx.centerFreq"]
|
||||
|
||||
this.param.dvbs2.mode = (vals["settings"]["dvbs2.isAcm"] ? 'acm' : 'ccm')
|
||||
this.param.dvbs2.frameSizeNormal = vals["settings"]["dvbs2.frameSizeNormal"]
|
||||
// this.param.dvbs2.isPilots = vals["settings"]["dvbs2.isPilots"]
|
||||
|
||||
let m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.ccm_modcod"])
|
||||
this.param.dvbs2.ccm_modulation = m.modulation
|
||||
this.param.dvbs2.ccm_speed = m.speed
|
||||
m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.acm_maxModcod"])
|
||||
this.param.dvbs2.acm_maxModulation = m.modulation
|
||||
this.param.dvbs2.acm_maxSpeed = m.speed
|
||||
m = extractModulationAndSpeedFromModcod(vals["settings"]["dvbs2.acm_minModcod"])
|
||||
this.param.dvbs2.acm_minModulation = m.modulation
|
||||
this.param.dvbs2.acm_minSpeed = m.speed
|
||||
|
||||
this.param.dvbs2.snrReserve = vals["settings"]["dvbs2.snrReserve"]
|
||||
this.param.dvbs2.servicePacketPeriod = vals["settings"]["dvbs2.servicePacketPeriod"]
|
||||
|
||||
this.param.acm.en = vals["settings"]["acm.en"]
|
||||
this.param.acm.maxAttenuation = vals["settings"]["acm.maxAttenuation"]
|
||||
this.param.acm.minAttenuation = vals["settings"]["acm.minAttenuation"]
|
||||
this.param.acm.requiredSnr = vals["settings"]["acm.requiredSnr"]
|
||||
|
||||
this.param.rx.gainMode = vals["settings"]["rx.gainMode"]
|
||||
this.param.rx.manualGain = vals["settings"]["rx.manualGain"]
|
||||
this.param.rx.spectrumInversion = vals["settings"]["rx.spectrumInversion"]
|
||||
this.param.rx.rolloff = vals["settings"]["rx.rolloff"]
|
||||
this.param.rx.cymRate = vals["settings"]["rx.cymRate"]
|
||||
this.param.rx.centerFreq = vals["settings"]["rx.centerFreq"]
|
||||
},
|
||||
|
||||
updateCincSettings(vals) {
|
||||
this.submitStatus.cinc = false
|
||||
|
@ -1,310 +1,9 @@
|
||||
{% from 'common/widgets.j2' import build_widget %}
|
||||
<div class="tabs-body-item" v-if="activeTab === 'setup' && settingFetchComplete">
|
||||
<h2>Настройки приема/передачи</h2>
|
||||
|
||||
<div class="settings-set-container">
|
||||
<label>
|
||||
<span>Режим работы</span>
|
||||
<select v-model="param.general.isCinC">
|
||||
<option :value="false">SCPC</option>
|
||||
<option :value="true">CinC</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="tabs-item-flex-container">
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки передатчика</h3>
|
||||
<label>
|
||||
<span>Включить передатчик</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.general.txEn" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Автоматический запуск передатчика</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.general.autoStartTx" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Режим работы модулятора</span>
|
||||
<select v-model="param.general.modulatorMode">
|
||||
<option value="normal">Нормальный</option>
|
||||
<option value="test">Тест (CW)</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Входные данные</span>
|
||||
<select v-model="param.general.isTestInputData">
|
||||
<option :value="false">Ethernet</option>
|
||||
<option :value="true">Тест (CW)</option>
|
||||
</select>
|
||||
</label>
|
||||
<h3>Параметры передачи</h3>
|
||||
<label>
|
||||
<span>Центральная частота, КГц</span>
|
||||
<input v-model="param.tx.centerFreq" type="number" step="0.01"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Символьная скорость, Бод</span>
|
||||
<input v-model="param.tx.cymRate" type="number"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Roll-off</span>
|
||||
<select v-model="param.tx.rolloff">
|
||||
<option :value="5">0.05</option>
|
||||
<option :value="10">0.10</option>
|
||||
<option :value="15">0.15</option>
|
||||
<option :value="20">0.20</option>
|
||||
<option :value="25">0.25</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Ослабление, дБ</span>
|
||||
<input v-model="param.tx.attenuation" type="number" step="0.01"/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="settings-set-container">
|
||||
<h3>Режим работы DVB-S2</h3>
|
||||
<label>
|
||||
<span>Период служебных пакетов, сек</span>
|
||||
<input v-model="param.dvbs2.servicePacketPeriod" type="number">
|
||||
</label>
|
||||
<label>
|
||||
<span>Режим</span>
|
||||
<select v-model="param.dvbs2.mode">
|
||||
<option value="ccm">CCM</option>
|
||||
<option value="acm">ACM</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Размер кадра</span>
|
||||
<select v-model="param.dvbs2.frameSizeNormal">
|
||||
<option :value="true">normal</option>
|
||||
<option :value="false">short</option>
|
||||
</select>
|
||||
</label>
|
||||
<!-- <label>-->
|
||||
<!-- <span>Пилот-символы</span>-->
|
||||
<!-- <select v-model="param.dvbs2.isPilots">-->
|
||||
<!-- <option :value="true">pilots</option>-->
|
||||
<!-- <option :value="false">no pilots</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </label>-->
|
||||
|
||||
<label v-show="param.dvbs2.mode === 'ccm'">
|
||||
<span>Модуляция</span>
|
||||
<select v-model="param.dvbs2.ccm_modulation" @change="param.dvbs2.ccm_speed = correctModcodSpeed(param.dvbs2.ccm_modulation, param.dvbs2.ccm_speed)">
|
||||
<option value="qpsk">QPSK</option>
|
||||
<option value="8psk">8PSK</option>
|
||||
<option value="16apsk">16APSK</option>
|
||||
<option value="32apsk">32APSK</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.dvbs2.mode === 'ccm'">
|
||||
<span>Скорость кода</span>
|
||||
<select v-model="param.dvbs2.ccm_speed">
|
||||
<option v-for="speed in getAvailableModcods(param.dvbs2.ccm_modulation)" v-bind:value="speed">{{ speed }}</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Текущий модкод</span>
|
||||
<input v-model="stat_rx.modcod" readonly>
|
||||
</label>
|
||||
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Модуляция (макс. режим)</span>
|
||||
<select v-model="param.dvbs2.acm_maxModulation" @change="param.dvbs2.acm_maxSpeed = correctModcodSpeed(param.dvbs2.acm_maxModulation, param.dvbs2.acm_maxSpeed)">
|
||||
<option value="qpsk">QPSK</option>
|
||||
<option value="8psk">8PSK</option>
|
||||
<option value="16apsk">16APSK</option>
|
||||
<option value="32apsk">32APSK</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Скорость кода (макс. режим)</span>
|
||||
<select v-model="param.dvbs2.acm_maxSpeed">
|
||||
<option v-for="speed in getAvailableModcods(param.dvbs2.acm_maxModulation)" v-bind:value="speed">{{ speed }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Модуляция (мин. режим)</span>
|
||||
<select v-model="param.dvbs2.acm_minModulation" @change="param.dvbs2.acm_minSpeed = correctModcodSpeed(param.dvbs2.acm_minModulation, param.dvbs2.acm_minSpeed)">
|
||||
<option value="qpsk">QPSK</option>
|
||||
<option value="8psk">8PSK</option>
|
||||
<option value="16apsk">16APSK</option>
|
||||
<option value="32apsk">32APSK</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Скорость кода (мин. режим)</span>
|
||||
<select v-model="param.dvbs2.acm_minSpeed">
|
||||
<option v-for="speed in getAvailableModcods(param.dvbs2.acm_minModulation)" v-bind:value="speed">{{ speed }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.dvbs2.mode === 'acm'">
|
||||
<span>Запас ОСШ</span>
|
||||
<input v-model="param.dvbs2.snrReserve" type="number" step="0.01">
|
||||
</label>
|
||||
|
||||
<h3>Авто-регулировка мощности</h3>
|
||||
<label>
|
||||
<span>Авто-регулировка мощности</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.acm.en" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Максимальное ослабление</span>
|
||||
<input v-model="param.acm.maxAttenuation" type="number" step="0.01"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Минимальное ослабление</span>
|
||||
<input v-model="param.acm.minAttenuation" type="number" step="0.01"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Требуемое ОСШ</span>
|
||||
<input v-model="param.acm.requiredSnr" type="number" step="0.01"/>
|
||||
</label>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройка приемника</h3>
|
||||
<label>
|
||||
<span>Режим управления усилением</span>
|
||||
<select v-model="param.rx.gainMode">
|
||||
<option value="auto">АРУ</option>
|
||||
<option value="manual">РРУ</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="param.rx.gainMode === 'manual'">
|
||||
<span>Усиление, dB</span>
|
||||
<input v-model="param.rx.manualGain" type="number"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Инверсия спектра</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.rx.spectrumInversion" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Центральная частота, кГц</span>
|
||||
<input v-model="param.rx.centerFreq" type="number" step="0.01"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Символьная скорость, Бод</span>
|
||||
<input v-model="param.rx.cymRate" type="number"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Roll-off</span>
|
||||
<select v-model="param.rx.rolloff">
|
||||
<option :value="5">0.05</option>
|
||||
<option :value="10">0.10</option>
|
||||
<option :value="15">0.15</option>
|
||||
<option :value="20">0.20</option>
|
||||
<option :value="25">0.25</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitRxTx()">Сохранить <span class="submit-spinner" v-show="submitStatus.rxTx"></span></button>
|
||||
|
||||
<h2 v-show="param.general.isCinC === true">Настройки режима CinC</h2>
|
||||
<div v-show="param.general.isCinC === true" class="settings-set-container">
|
||||
<label>
|
||||
<span>Метод расчета задержки</span>
|
||||
<select v-model="param.cinc.mode">
|
||||
<option value="positional">Позиционированием</option>
|
||||
<option value="delay">Окном задержки</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<h3 v-show="param.cinc.mode === 'positional'">Настройки позиционирования</h3>
|
||||
<label v-show="param.cinc.mode === 'positional'">
|
||||
<span>Широта станции</span>
|
||||
<input v-model="param.cinc.position.station.latitude" type="number" step="0.000001"/>
|
||||
</label>
|
||||
<label v-show="param.cinc.mode === 'positional'">
|
||||
<span>Долгота станции</span>
|
||||
<input v-model="param.cinc.position.station.longitude" type="number" step="0.000001"/>
|
||||
</label>
|
||||
<label v-show="param.cinc.mode === 'positional'">
|
||||
<span>Подспутниковая точка</span>
|
||||
<input v-model="param.cinc.position.satelliteLongitude" type="number" step="0.000001"/>
|
||||
</label>
|
||||
|
||||
<h3 v-show="param.cinc.mode === 'delay'">Задержка до спутника</h3>
|
||||
<label v-show="param.cinc.mode === 'delay'">
|
||||
<span>от, мс</span>
|
||||
<input v-model="param.cinc.delayMin" type="number"/>
|
||||
</label>
|
||||
<label v-show="param.cinc.mode === 'delay'">
|
||||
<span>до, мс</span>
|
||||
<input v-model="param.cinc.delayMax" type="number"/>
|
||||
</label>
|
||||
</div>
|
||||
<button class="action-button" v-show="param.general.isCinC" @click="settingsSubmitCinC()" type="submit">Сохранить <span class="submit-spinner" v-show="submitStatus.cinc"></span></button>
|
||||
|
||||
<h2>Настройки питания и опорного генератора</h2>
|
||||
<div class="tabs-item-flex-container">
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки BUC</h3>
|
||||
<label>
|
||||
<span>Подача опоры 10МГц</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.buc.refClk10M" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Питание BUC</span>
|
||||
<select v-model="param.buc.powering">
|
||||
<option value="0">выкл</option>
|
||||
<option value="24">24В</option>
|
||||
<option value="48">48В</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки LNB</h3>
|
||||
<label>
|
||||
<span>Подача опоры 10МГц</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.lnb.refClk10M" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Питание LNB</span>
|
||||
<select v-model="param.lnb.powering">
|
||||
<option value="0">выкл</option>
|
||||
<option value="13">13В</option>
|
||||
<option value="18">18В</option>
|
||||
<option value="24">24В</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Сервисные настройки</h3>
|
||||
<label>
|
||||
<span>Подача опоры 10МГц на 'Выход 10МГц'</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.serviceSettings.refClk10M" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Автозапуск BUC и LNB при включении</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.serviceSettings.autoStart" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% for cat in ['rxtx', 'cinc', 'buclnb'] %}
|
||||
{% if cat in params %}
|
||||
{% for w in params[cat] %}{{ build_widget(cat, w) }}{% endfor %}
|
||||
<button class="action-button" @click="settingsSubmitBucLnb()">Сохранить <span class="submit-spinner" v-show="submitStatus.bucLnb"></span></button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
41
front-generator/template/common/widgets.j2
Normal file
41
front-generator/template/common/widgets.j2
Normal file
@ -0,0 +1,41 @@
|
||||
{% macro build_widget_checkbox(param_group, widget) %}<label{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
<span>{{ widget.label }}</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param{{ param_group | title }}.{{ widget.name }}" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>{% endmacro %}
|
||||
|
||||
{% macro build_widget_number(param_group, widget) %}<label{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
</label>{% endmacro %}
|
||||
|
||||
{% macro build_widget_select(param_group, widget) %}<label{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
<span>{{ widget.label }}</span>
|
||||
<select v-model="param{{ param_group | title }}.{{ widget.name }}">
|
||||
{% for opt in widget['values'] %}
|
||||
<option :value="{{ opt.value }}">{{ opt.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>{% endmacro %}
|
||||
|
||||
{% macro build_widget_flex_container(param_group, widget) %}<div class="tabs-item-flex-container"{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
{% for w in widget.childs %}{{ build_widget(param_group, w) }}{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro build_widget_settings_container(param_group, widget) %}<div class="settings-set-container"{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
{% for w in widget.childs %}{{ build_widget(param_group, w) }}{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% macro build_widget(param_group, widget) %}{% if widget.widget == 'flex-container' %}{{ build_widget_flex_container(param_group, widget) }}
|
||||
{% elif widget.widget == 'settings-container' %}{{ build_widget_settings_container(param_group, widget) }}
|
||||
{% elif widget.widget == 'h2' %}<h2{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>{{ widget.label }}</h2>
|
||||
{% elif widget.widget == 'h3' %}<h3{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>{{ widget.label }}</h3>
|
||||
{% elif widget.widget == 'checkbox' %}{{ build_widget_checkbox(param_group, widget) }}
|
||||
{% elif widget.widget == 'number' %}{{ build_widget_number(param_group, widget) }}
|
||||
{% elif widget.widget == 'select' %}{{ build_widget_select(param_group, widget) }}
|
||||
{% else %}<p>Widget '{{ widget.widget }}' not defined!</p><p>{{ widget }}</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
@ -74,7 +74,7 @@
|
||||
|
||||
// false - означает что статистика не отправляется, true - отправляется
|
||||
submitStatus: {
|
||||
{% for pg in params.groupsList %}
|
||||
{% for pg in params.paramGroupsList %}
|
||||
{{ pg }}: false,
|
||||
{% endfor %}
|
||||
firmwareUpload: false,
|
||||
@ -141,7 +141,7 @@
|
||||
let d = await fetch("/api/get/settings")
|
||||
let vals = await d.json()
|
||||
this.settingFetchComplete = true
|
||||
{% for pg in params.groupsList %}
|
||||
{% for pg in params.paramGroupsList %}
|
||||
this.update{{ pg | capitalize }}Settings(vals)
|
||||
{% endfor %}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@
|
||||
<div class="tabs-header">
|
||||
<span style="font-weight:bold">RCSM-101</span>
|
||||
<a href="#monitoring" class="tabs-btn" @click="activeTab = 'monitoring'" :class="{ active: activeTab === 'monitoring' }">Мониторинг</a>
|
||||
<a href="#setup" class="tabs-btn" @click="activeTab = 'setup'" :class="{ active: activeTab === 'setup' }">Настройки</a>
|
||||
<a href="#qos" class="tabs-btn" @click="activeTab = 'qos'" :class="{ active: activeTab === 'qos' }">QoS</a>
|
||||
<a href="/logout" class="tabs-btn">Выход</a>
|
||||
</div>
|
||||
@ -121,7 +122,34 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabs-body-item" v-if="activeTab === 'setup' && settingFetchComplete">
|
||||
<h2>Настройки приема/передачи</h2>
|
||||
<div class="settings-set-container">
|
||||
<label>
|
||||
<span>Режим работы</span>
|
||||
<select v-model="paramRxtx.isCinC">
|
||||
<option :value="true">CinC</option>
|
||||
<option :value="false">SCPC</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="tabs-item-flex-container">
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки приема/передачи</h3>
|
||||
<label>
|
||||
<span>Режим работы</span>
|
||||
<select v-model="paramRxtx.isCinC">
|
||||
<option :value="true">CinC</option>
|
||||
<option :value="false">SCPC</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<button class="action-button" @click="settingsSubmitBucLnb()">Сохранить <span class="submit-spinner" v-show="submitStatus.bucLnb"></span></button>
|
||||
</div>
|
||||
<div class="tabs-body-item" v-if="activeTab === 'qos' && settingFetchComplete">
|
||||
<h2>Настройки QoS</h2>
|
||||
<div class="settings-set-container">
|
||||
@ -224,26 +252,12 @@
|
||||
<button class="action-button" @click="settingsSubmitQoS()">Применить <span class="submit-spinner" v-show="submitStatus.qos"></span></button>
|
||||
|
||||
|
||||
<h2>Настройки TCP-акселерации</h2>
|
||||
<div class="settings-set-container">
|
||||
<label>
|
||||
<span>Активировать акселерацию</span>
|
||||
<span class="toggle-input"><input type="checkbox" v-model="paramsTcpAccel.en" /><span class="slider"></span></span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Максимальное количество соединений</span>
|
||||
<input type="number" v-model="paramsTcpAccel.maxConnections" min="1" max="10000" />
|
||||
</label>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitTcpAccel()">Применить <span class="submit-spinner" v-show="submitStatus.tcpAccel"></span></button>
|
||||
</div>
|
||||
|
||||
<p>Последнее обновление статистики: {{ lastUpdateTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/vue.js"></script>
|
||||
<script>
|
||||
const availableTabs = ['monitoring', 'qos']
|
||||
const availableTabs = ['monitoring', 'setup', 'qos']
|
||||
|
||||
// default-js.js
|
||||
// для обновления высоты хидера
|
||||
@ -393,8 +407,6 @@
|
||||
|
||||
// false - означает что статистика не отправляется, true - отправляется
|
||||
submitStatus: {
|
||||
qos: false,
|
||||
tcpaccel: false,
|
||||
firmwareUpload: false,
|
||||
firmwareUpgrade: false,
|
||||
// когда модем перезагружается, тут должен быть счетчик. Направление счета - к нулю
|
||||
@ -444,6 +456,9 @@
|
||||
statOs: {uptime: '?'},
|
||||
// ========== include end from 'common/monitoring-data.js.j2'
|
||||
|
||||
// ========== include from 'common/setup-data.js.j2'
|
||||
// ========== include end from 'common/setup-data.js.j2'
|
||||
|
||||
// ========== include from 'common/qos-data.js.j2'
|
||||
paramsQos: {
|
||||
en: false,
|
||||
@ -452,10 +467,6 @@
|
||||
rt3: [],
|
||||
cd: [],
|
||||
},
|
||||
paramsTcpAccel: {
|
||||
en: false,
|
||||
maxConnections: 128
|
||||
},
|
||||
// ========== include end from 'common/qos-data.js.j2'
|
||||
|
||||
uploadFw: {
|
||||
@ -571,6 +582,97 @@
|
||||
})
|
||||
}, // ========== include end from 'common/monitoring-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/setup-methods.js.j2'
|
||||
|
||||
settingsSubmitCinC() {
|
||||
if (this.submitStatus.cinc) { return }
|
||||
|
||||
let query = {
|
||||
"cinc.mode": this.param.cinc.mode,
|
||||
"cinc.searchBandwidth": this.param.cinc.searchBandwidth,
|
||||
"cinc.position.station.latitude": this.param.cinc.position.station.latitude,
|
||||
"cinc.position.station.longitude": this.param.cinc.position.station.longitude,
|
||||
"cinc.position.satelliteLongitude": this.param.cinc.position.satelliteLongitude,
|
||||
"cinc.delayMin": this.param.cinc.delayMin,
|
||||
"cinc.delayMax": this.param.cinc.delayMax
|
||||
}
|
||||
this.submitStatus.cinc = true
|
||||
fetch('/api/set/cinc', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.cinc = false
|
||||
this.updateCincSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.cinc = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
},
|
||||
|
||||
settingsSubmitBucLnb() {
|
||||
if (this.submitStatus.bucLnb) { return }
|
||||
let query = {
|
||||
"buc.refClk10M": this.param.buc.refClk10M,
|
||||
"buc.powering": parseInt(this.param.buc.powering),
|
||||
"lnb.refClk10M": this.param.lnb.refClk10M,
|
||||
"lnb.powering": parseInt(this.param.lnb.powering),
|
||||
"serviceSettings.refClk10M": this.param.serviceSettings.refClk10M,
|
||||
"serviceSettings.autoStart": this.param.serviceSettings.autoStart
|
||||
}
|
||||
if (confirm('Вы уверены, что хотите сохранить настройки BUC и LNB?')) {
|
||||
this.submitStatus.bucLnb = true
|
||||
fetch('/api/set/bucLnb', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.bucLnb = false
|
||||
this.updateBucLnbSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.bucLnb = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
updateCincSettings(vals) {
|
||||
this.submitStatus.cinc = false
|
||||
this.param.cinc.mode = vals["settings"]["cinc.mode"]
|
||||
this.param.cinc.searchBandwidth = vals["settings"]["cinc.searchBandwidth"]
|
||||
this.param.cinc.position.station.latitude = vals["settings"]["cinc.position.station.latitude"]
|
||||
this.param.cinc.position.station.longitude = vals["settings"]["cinc.position.station.longitude"]
|
||||
this.param.cinc.position.satelliteLongitude = vals["settings"]["cinc.position.satelliteLongitude"]
|
||||
this.param.cinc.delayMin = vals["settings"]["cinc.delayMin"]
|
||||
this.param.cinc.delayMax = vals["settings"]["cinc.delayMax"]
|
||||
},
|
||||
|
||||
updateBucLnbSettings(vals) {
|
||||
this.submitStatus.bucLnb = false
|
||||
this.param.buc.refClk10M = vals["settings"]["buc.refClk10M"]
|
||||
this.param.buc.powering = vals["settings"]["buc.powering"]
|
||||
this.param.lnb.refClk10M = vals["settings"]["lnb.refClk10M"]
|
||||
this.param.lnb.powering = vals["settings"]["lnb.powering"]
|
||||
this.param.serviceSettings.refClk10M = vals["settings"]["serviceSettings.refClk10M"]
|
||||
this.param.serviceSettings.autoStart = vals["settings"]["serviceSettings.autoStart"]
|
||||
},
|
||||
|
||||
updateSettings(vals) {
|
||||
this.settingFetchComplete = true
|
||||
this.updateRxTxSettings(vals)
|
||||
this.updateCincSettings(vals)
|
||||
this.updateBucLnbSettings(vals)
|
||||
this.updateQosSettings(vals)
|
||||
this.updateNetworkSettings(vals)
|
||||
this.updateDebugSendSettings(vals)
|
||||
}, // ========== include end from 'common/setup-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/qos-methods.js.j2'
|
||||
settingsSubmitQoS() {
|
||||
if (this.submitStatus.qos) { return }
|
||||
@ -644,27 +746,6 @@
|
||||
})
|
||||
},
|
||||
|
||||
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}`)
|
||||
})
|
||||
},
|
||||
|
||||
updateQosSettings(vals) {
|
||||
this.submitStatus.qos = false
|
||||
this.paramsQos.en = vals["settings"]["qos.enabled"]
|
||||
@ -812,7 +893,8 @@
|
||||
}
|
||||
|
||||
return result
|
||||
}, // ========== include end from 'common/qos-methods.js.j2'
|
||||
},
|
||||
// ========== include end from 'common/qos-methods.js.j2'
|
||||
|
||||
|
||||
performUpdateSettings() {
|
||||
@ -820,8 +902,6 @@
|
||||
let d = await fetch("/api/get/settings")
|
||||
let vals = await d.json()
|
||||
this.settingFetchComplete = true
|
||||
this.updateQosSettings(vals)
|
||||
this.updateTcpaccelSettings(vals)
|
||||
}
|
||||
|
||||
doFetchSettings().then(() => {})
|
||||
|
@ -45,6 +45,7 @@
|
||||
<div class="tabs-header">
|
||||
<span style="font-weight:bold">RCSM-101 TDMA</span>
|
||||
<a href="#monitoring" class="tabs-btn" @click="activeTab = 'monitoring'" :class="{ active: activeTab === 'monitoring' }">Мониторинг</a>
|
||||
<a href="#setup" class="tabs-btn" @click="activeTab = 'setup'" :class="{ active: activeTab === 'setup' }">Настройки</a>
|
||||
<a href="#admin" class="tabs-btn" @click="activeTab = 'admin'" :class="{ active: activeTab === 'admin' }">Администрирование</a>
|
||||
<a href="/logout" class="tabs-btn">Выход</a>
|
||||
</div>
|
||||
@ -108,7 +109,49 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabs-body-item" v-if="activeTab === 'setup' && settingFetchComplete">
|
||||
<h2>Настройки приема/передачи</h2>
|
||||
<div class="tabs-item-flex-container">
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки передатчика</h3>
|
||||
<label>
|
||||
<span>Включить передатчик</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="paramRxtx.txEn" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>Входные данные</span>
|
||||
<select v-model="paramRxtx.txIsTestInput">
|
||||
<option :value="true">Тест</option>
|
||||
<option :value="false">SCPC</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки приемника</h3>
|
||||
<label>
|
||||
<span>Режим управления усилением</span>
|
||||
<select v-model="paramRxtx.rxAgcEn">
|
||||
<option :value="true">АРУ</option>
|
||||
<option :value="false">РРУ</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Инверсия спектра</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="paramRxtx.rxSpectrumInversion" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<button class="action-button" @click="settingsSubmitBucLnb()">Сохранить <span class="submit-spinner" v-show="submitStatus.bucLnb"></span></button>
|
||||
</div>
|
||||
<div class="tabs-body-item" v-if="activeTab === 'admin' && settingFetchComplete">
|
||||
<h2>Настройки сети</h2>
|
||||
<div class="settings-set-container">
|
||||
@ -200,7 +243,7 @@
|
||||
</div>
|
||||
<script src="/js/vue.js"></script>
|
||||
<script>
|
||||
const availableTabs = ['monitoring', 'admin']
|
||||
const availableTabs = ['monitoring', 'setup', 'admin']
|
||||
|
||||
// default-js.js
|
||||
// для обновления высоты хидера
|
||||
@ -391,6 +434,9 @@
|
||||
statOs: {uptime: '?'},
|
||||
// ========== include end from 'common/monitoring-data.js.j2'
|
||||
|
||||
// ========== include from 'common/setup-data.js.j2'
|
||||
// ========== include end from 'common/setup-data.js.j2'
|
||||
|
||||
// ========== include from 'common/admin-data.js.j2'
|
||||
// ========== include end from 'common/admin-data.js.j2'
|
||||
|
||||
@ -498,6 +544,97 @@
|
||||
})
|
||||
}, // ========== include end from 'common/monitoring-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/setup-methods.js.j2'
|
||||
|
||||
settingsSubmitCinC() {
|
||||
if (this.submitStatus.cinc) { return }
|
||||
|
||||
let query = {
|
||||
"cinc.mode": this.param.cinc.mode,
|
||||
"cinc.searchBandwidth": this.param.cinc.searchBandwidth,
|
||||
"cinc.position.station.latitude": this.param.cinc.position.station.latitude,
|
||||
"cinc.position.station.longitude": this.param.cinc.position.station.longitude,
|
||||
"cinc.position.satelliteLongitude": this.param.cinc.position.satelliteLongitude,
|
||||
"cinc.delayMin": this.param.cinc.delayMin,
|
||||
"cinc.delayMax": this.param.cinc.delayMax
|
||||
}
|
||||
this.submitStatus.cinc = true
|
||||
fetch('/api/set/cinc', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.cinc = false
|
||||
this.updateCincSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.cinc = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
},
|
||||
|
||||
settingsSubmitBucLnb() {
|
||||
if (this.submitStatus.bucLnb) { return }
|
||||
let query = {
|
||||
"buc.refClk10M": this.param.buc.refClk10M,
|
||||
"buc.powering": parseInt(this.param.buc.powering),
|
||||
"lnb.refClk10M": this.param.lnb.refClk10M,
|
||||
"lnb.powering": parseInt(this.param.lnb.powering),
|
||||
"serviceSettings.refClk10M": this.param.serviceSettings.refClk10M,
|
||||
"serviceSettings.autoStart": this.param.serviceSettings.autoStart
|
||||
}
|
||||
if (confirm('Вы уверены, что хотите сохранить настройки BUC и LNB?')) {
|
||||
this.submitStatus.bucLnb = true
|
||||
fetch('/api/set/bucLnb', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.bucLnb = false
|
||||
this.updateBucLnbSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.bucLnb = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
updateCincSettings(vals) {
|
||||
this.submitStatus.cinc = false
|
||||
this.param.cinc.mode = vals["settings"]["cinc.mode"]
|
||||
this.param.cinc.searchBandwidth = vals["settings"]["cinc.searchBandwidth"]
|
||||
this.param.cinc.position.station.latitude = vals["settings"]["cinc.position.station.latitude"]
|
||||
this.param.cinc.position.station.longitude = vals["settings"]["cinc.position.station.longitude"]
|
||||
this.param.cinc.position.satelliteLongitude = vals["settings"]["cinc.position.satelliteLongitude"]
|
||||
this.param.cinc.delayMin = vals["settings"]["cinc.delayMin"]
|
||||
this.param.cinc.delayMax = vals["settings"]["cinc.delayMax"]
|
||||
},
|
||||
|
||||
updateBucLnbSettings(vals) {
|
||||
this.submitStatus.bucLnb = false
|
||||
this.param.buc.refClk10M = vals["settings"]["buc.refClk10M"]
|
||||
this.param.buc.powering = vals["settings"]["buc.powering"]
|
||||
this.param.lnb.refClk10M = vals["settings"]["lnb.refClk10M"]
|
||||
this.param.lnb.powering = vals["settings"]["lnb.powering"]
|
||||
this.param.serviceSettings.refClk10M = vals["settings"]["serviceSettings.refClk10M"]
|
||||
this.param.serviceSettings.autoStart = vals["settings"]["serviceSettings.autoStart"]
|
||||
},
|
||||
|
||||
updateSettings(vals) {
|
||||
this.settingFetchComplete = true
|
||||
this.updateRxTxSettings(vals)
|
||||
this.updateCincSettings(vals)
|
||||
this.updateBucLnbSettings(vals)
|
||||
this.updateQosSettings(vals)
|
||||
this.updateNetworkSettings(vals)
|
||||
this.updateDebugSendSettings(vals)
|
||||
}, // ========== include end from 'common/setup-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/admin-methods.js.j2'
|
||||
settingsSubmitNetwork() {
|
||||
if (this.submitStatus.network) { return }
|
||||
|
Loading…
x
Reference in New Issue
Block a user