генератор фронта завершен
This commit is contained in:
parent
25a3b11ba8
commit
5a94f9a4fd
@ -98,6 +98,22 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{"widget": "h2", "label": "Настройки сети"},
|
||||
{
|
||||
"widget": "settings-container",
|
||||
"childs": [
|
||||
{"widget": "h3", "label": "Настройки интерфейса управления"},
|
||||
{"widget": "ip-address", "label": "Интерфейс управления (/24)", "name": "netManagementIp"},
|
||||
{
|
||||
"widget": "select", "label": "Режим сети", "name": "netIsL2",
|
||||
"values": [{"label": "Маршрутизатор", "value": "false"}, {"label": "Коммутатор", "value": "true"}]
|
||||
},
|
||||
{"widget": "ip-address", "label": "Интерфейс данных (/24)", "name": "netDataIp", "v_show": "paramNetwork.netIsL2 === false"},
|
||||
{"widget": "number", "label": "MTU интерфейса данных", "name": "netDataMtu", "min": 1500, "step": 1, "max": 2000}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tabs": [
|
||||
@ -108,6 +124,10 @@
|
||||
},
|
||||
"scpc": {
|
||||
"modem_name": "RCSM-101",
|
||||
"dangerousParamGroups": {
|
||||
"buclnb": "Применение неправильных настроек может вывести из строя оборудование! Продолжить?",
|
||||
"network": "Применение этих настроек может сделать модем недоступным! Продолжить?"
|
||||
},
|
||||
"params": {
|
||||
"rxtx": [
|
||||
{"widget": "h2", "label": "Настройки приема/передачи"},
|
||||
@ -144,6 +164,10 @@
|
||||
"widget": "select", "label": "Roll-off", "name": "txRolloff",
|
||||
"values": [{"label": "0.02", "value": "2"}, {"label": "0.05", "value": "5"}, {"label": "0.10", "value": "10"}, {"label": "0.15", "value": "15"}, {"label": "0.20", "value": "20"}, {"label": "0.25", "value": "25"}]
|
||||
},
|
||||
{
|
||||
"widget": "select", "label": "Номер последовательности Голда", "name": "txGoldan",
|
||||
"values": [{"label": "0", "value": "0"}, {"label": "1", "value": "1"}]
|
||||
},
|
||||
{"widget": "number", "label": "Ослабление, дБ", "name": "txAttenuation", "min": 0, "step": 1}
|
||||
]
|
||||
},
|
||||
@ -195,6 +219,10 @@
|
||||
{
|
||||
"widget": "select", "label": "Roll-off", "name": "rxRolloff",
|
||||
"values": [{"label": "0.02", "value": "2"}, {"label": "0.05", "value": "5"}, {"label": "0.10", "value": "10"}, {"label": "0.15", "value": "15"}, {"label": "0.20", "value": "20"}, {"label": "0.25", "value": "25"}]
|
||||
},
|
||||
{
|
||||
"widget": "select", "label": "Номер последовательности Голда", "name": "rxGoldan",
|
||||
"values": [{"label": "0", "value": "0"}, {"label": "1", "value": "1"}]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -213,8 +241,14 @@
|
||||
{"label": "Окном задержки", "value": "false"}
|
||||
]
|
||||
},
|
||||
{"widget": "number", "label": "Полоса поиска, КГц ±", "name": "cincSearchBandwidth", "min": 0, "step": 1, "max": 100}
|
||||
]
|
||||
{"widget": "number", "label": "Полоса поиска, КГц ±", "name": "cincSearchBandwidth", "min": 0, "step": 1, "max": 100},
|
||||
{"widget": "h2", "label": "Настройки позиционирования", "v_show": "paramCinc.cincIsPositional === true"},
|
||||
{"widget": "number", "label": "Широта станции", "name": "cincPositionStationLatitude", "v_show": "paramCinc.cincIsPositional === true", "min": -180, "step": 0.000001, "max": 180},
|
||||
{"widget": "number", "label": "Долгота станции", "name": "cincPositionStationLongitude", "v_show": "paramCinc.cincIsPositional === true", "min": -180, "step": 0.000001, "max": 180},
|
||||
{"widget": "number", "label": "Подспутниковая точка", "name": "cincPositionSatelliteLongitude", "v_show": "paramCinc.cincIsPositional === true", "min": -180, "step": 0.000001, "max": 180},
|
||||
{"widget": "h2", "label": "Задержка до спутника", "v_show": "paramCinc.cincIsPositional === false"},
|
||||
{"widget": "number", "label": "от, мс", "name": "cincDelayMin", "v_show": "paramCinc.cincIsPositional === false", "min": 0, "step": 0.1, "max": 400},
|
||||
{"widget": "number", "label": "до, мс", "name": "cincDelayMax", "v_show": "paramCinc.cincIsPositional === false", "min": 0, "step": 0.1, "max": 400}]
|
||||
},
|
||||
{"widget": "submit", "v_show": "paramRxtx.isCinC"}
|
||||
],
|
||||
@ -274,21 +308,29 @@
|
||||
{"widget": "number", "label": "Максимальное количество соединений", "name": "accelMaxConnections", "min": 0, "step": 1, "max": 4000}
|
||||
]
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{"widget": "h2", "label": "Настройки сети"},
|
||||
{
|
||||
"widget": "settings-container",
|
||||
"childs": [
|
||||
{"widget": "h3", "label": "Настройки интерфейса управления"},
|
||||
{"widget": "ip-address", "label": "Интерфейс управления (/24)", "name": "netManagementIp"},
|
||||
{
|
||||
"widget": "select", "label": "Режим сети", "name": "netIsL2",
|
||||
"values": [{"label": "Маршрутизатор", "value": "false"}, {"label": "Коммутатор", "value": "true"}]
|
||||
},
|
||||
{"widget": "ip-address", "label": "Интерфейс данных (/24)", "name": "netDataIp", "v_show": "paramNetwork.netIsL2 === false"},
|
||||
{"widget": "number", "label": "MTU интерфейса данных", "name": "netDataMtu", "min": 1500, "step": 1, "max": 2000}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tabs": [
|
||||
{
|
||||
"name": "monitoring",
|
||||
"desc": "Мониторинг"
|
||||
},
|
||||
{
|
||||
"name": "setup",
|
||||
"desc": "Настройки"
|
||||
},
|
||||
{
|
||||
"name": "qos",
|
||||
"desc": "QoS"
|
||||
}
|
||||
{"name": "monitoring", "desc": "Мониторинг"},
|
||||
{"name": "setup", "desc": "Настройки"},
|
||||
{"name": "qos", "desc": "QoS"},
|
||||
{"name": "admin", "desc": "Администрирование"}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,3 @@
|
||||
settingsSubmitNetwork() {
|
||||
if (this.submitStatus.network) { return }
|
||||
let query = {
|
||||
"network.managementIp": this.param.network.managementIp,
|
||||
"network.managementGateway": this.param.network.managementGateway,
|
||||
"network.mode": this.param.network.mode,
|
||||
"network.dataIp": this.param.network.dataIp,
|
||||
"network.dataMtu": this.param.network.dataMtu
|
||||
}
|
||||
if (confirm('Вы уверены, что хотите сохранить настройки сети? После этого модем может стать недоступным.')) {
|
||||
this.submitStatus.network = true
|
||||
fetch('/api/set/network', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.network = false
|
||||
this.updateNetworkSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.network = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
settingsSubmitDebugSend() {
|
||||
if (this.submitStatus.debugSend) { return }
|
||||
let query = {
|
||||
"debugSend.en": this.param.debugSend.en,
|
||||
"debugSend.receiverIp": this.param.debugSend.receiverIp,
|
||||
"debugSend.portCinC": this.param.debugSend.portCinC,
|
||||
"debugSend.portData": this.param.debugSend.portData,
|
||||
"debugSend.timeout": this.param.debugSend.timeout
|
||||
}
|
||||
this.submitStatus.debugSend = true
|
||||
fetch('/api/set/debugSend', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.debugSend = false
|
||||
this.updateNetworkSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.debugSend = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
},
|
||||
|
||||
async settingsUploadUpdate() {
|
||||
if (!this.uploadFw.filename) {
|
||||
alert('Выберите файл для загрузки');
|
||||
@ -105,24 +53,6 @@
|
||||
this.submitStatus.firmwareUpgrade = false
|
||||
},
|
||||
|
||||
updateNetworkSettings(vals) {
|
||||
this.submitStatus.network = false
|
||||
this.param.network.managementIp = vals["settings"]["network.managementIp"]
|
||||
this.param.network.managementGateway = vals["settings"]["network.managementGateway"]
|
||||
this.param.network.mode = vals["settings"]["network.mode"]
|
||||
this.param.network.dataIp = vals["settings"]["network.dataIp"]
|
||||
this.param.network.dataMtu = vals["settings"]["network.dataMtu"]
|
||||
},
|
||||
|
||||
updateDebugSendSettings(vals) {
|
||||
this.submitStatus.debugSend = false
|
||||
this.param.debugSend.en = vals["settings"]["debugSend.en"]
|
||||
this.param.debugSend.receiverIp = vals["settings"]["debugSend.receiverIp"]
|
||||
this.param.debugSend.portCinC = vals["settings"]["debugSend.portCinC"]
|
||||
this.param.debugSend.portData = vals["settings"]["debugSend.portData"]
|
||||
this.param.debugSend.timeout = vals["settings"]["debugSend.timeout"]
|
||||
},
|
||||
|
||||
doModemReboot() {
|
||||
if (this.submitStatus.modemReboot !== null) {
|
||||
return
|
||||
|
@ -1,63 +1,11 @@
|
||||
{% raw %}
|
||||
{% from 'common/widgets.j2' import build_widget %}
|
||||
<div class="tabs-body-item" v-if="activeTab === 'admin' && settingFetchComplete">
|
||||
<h2>Настройки сети</h2>
|
||||
{% if 'network' in params %}
|
||||
{% for w in params['network'] %}{{ build_widget('network', w) | indent(12, true) }}{% endfor %}
|
||||
{% endif %}
|
||||
{% raw %}
|
||||
<h2>Система</h2>
|
||||
<div class="settings-set-container">
|
||||
<h3>Интерфейс управления</h3>
|
||||
<label>
|
||||
<span>IP адрес/маска</span>
|
||||
<input v-model="param.network.managementIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
</label>
|
||||
<label>
|
||||
<span>Шлюз интерфейса управления</span>
|
||||
<input v-model="param.network.managementGateway" type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
</label>
|
||||
<label>
|
||||
<span>Режим модема</span>
|
||||
<select v-model="param.network.mode">
|
||||
<option value="l2">Коммутатор</option>
|
||||
<option value="l3">Маршрутизатор</option>
|
||||
</select>
|
||||
</label>
|
||||
<h3>Интерфейс данных</h3>
|
||||
<label v-if="param.network.mode === 'l3'">
|
||||
<span>IP адрес/маска</span>
|
||||
<input v-model="param.network.dataIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
</label>
|
||||
<label>
|
||||
<span>MTU</span>
|
||||
<input v-model="param.network.dataMtu" required type="number" min="1500" max="9000">
|
||||
</label>
|
||||
<button class="action-button" @click="settingsSubmitNetwork()">Применить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Отладка</h3>
|
||||
<label>
|
||||
<span>Передача отладочной информации</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.debugSend.en" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label v-if="param.debugSend.en">
|
||||
<span>IP адрес получателя</span>
|
||||
<input v-model="param.debugSend.receiverIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}">
|
||||
</label>
|
||||
<label>
|
||||
<span>Порт для данных</span>
|
||||
<input v-model="param.debugSend.portCinC" type="number" min="0" max="65535">
|
||||
</label>
|
||||
<label>
|
||||
<span>Порт для CinC</span>
|
||||
<input v-model="param.debugSend.portData" type="number" min="0" max="65535">
|
||||
</label>
|
||||
<label>
|
||||
<span>Таймаут</span>
|
||||
<input v-model="param.debugSend.timeout" type="number" pattern="^[0-9]+$">
|
||||
</label>
|
||||
<button class="action-button" @click="settingsSubmitDebugSend()">Применить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Управление ПО</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Версия ПО</th><td>{{ about.firmwareVersion }}</td></tr>
|
||||
@ -82,6 +30,5 @@
|
||||
</label>
|
||||
<button class="action-button" @click="settingsUploadUpdate()">Загрузить<span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button>
|
||||
<button class="dangerous-button" v-show="uploadFw.sha256 !== null" @click="settingsPerformFirmwareUpgrade()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpgrade"></span></button>
|
||||
</div>{% endraw %}
|
||||
</div>
|
||||
</div>
|
||||
{% endraw %}
|
@ -40,6 +40,10 @@
|
||||
{% for w in widget.childs %}{{ build_widget(param_group, w) | indent(4, true) }}{% endfor %}
|
||||
</div>{% endmacro %}
|
||||
|
||||
{% macro build_widget_ip_address(param_group, widget) %}<label{% if widget.v_show %} v-show="{{ widget.v_show }}"{% endif %}>
|
||||
<span>{{ widget.label }}</span>
|
||||
<input v-model="param{{ param_group | title }}.{{ widget.name }}" required type="text" pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
|
||||
</label>{% 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) }}
|
||||
@ -52,6 +56,7 @@
|
||||
{% elif widget.widget == 'select' %}{{ build_widget_select(param_group, widget) }}
|
||||
{% elif widget.widget == 'modulation-modcod' %}{{ build_widget_modulation_modcod(param_group, widget) }}
|
||||
{% elif widget.widget == 'modulation-speed' %}{{ build_widget_modulation_speed(param_group, widget) }}
|
||||
{% elif widget.widget == 'ip-address' %}{{ build_widget_ip_address(param_group, widget) }}
|
||||
{% else %}<p>Widget '{{ widget.widget }}' not defined!</p><p>{{ widget }}</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
@ -47,6 +47,7 @@
|
||||
<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="#admin" class="tabs-btn" @click="activeTab = 'admin'" :class="{ active: activeTab === 'admin' }">Администрирование</a>
|
||||
<a href="/logout" class="tabs-btn">Выход</a>
|
||||
</div>
|
||||
</header>
|
||||
@ -172,6 +173,13 @@
|
||||
<option :value="25">0.25</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Номер последовательности Голда</span>
|
||||
<select v-model="paramRxtx.txGoldan">
|
||||
<option :value="0">0</option>
|
||||
<option :value="1">1</option>
|
||||
</select>
|
||||
</label>
|
||||
<label><span>Ослабление, дБ</span><input type="number" v-model="paramRxtx.txAttenuation" step="1"/></label>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
@ -276,6 +284,13 @@
|
||||
<option :value="25">0.25</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Номер последовательности Голда</span>
|
||||
<select v-model="paramRxtx.rxGoldan">
|
||||
<option :value="0">0</option>
|
||||
<option :value="1">1</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitRxtx()">Сохранить <span class="submit-spinner" v-show="submitStatus.rxtx"></span></button>
|
||||
@ -289,6 +304,13 @@
|
||||
</select>
|
||||
</label>
|
||||
<label><span>Полоса поиска, КГц ±</span><input type="number" v-model="paramCinc.cincSearchBandwidth" max="100" step="1"/></label>
|
||||
<h2 v-show="paramCinc.cincIsPositional === true">Настройки позиционирования</h2>
|
||||
<label v-show="paramCinc.cincIsPositional === true"><span>Широта станции</span><input type="number" v-model="paramCinc.cincPositionStationLatitude" min="-180" max="180" step="1e-06"/></label>
|
||||
<label v-show="paramCinc.cincIsPositional === true"><span>Долгота станции</span><input type="number" v-model="paramCinc.cincPositionStationLongitude" min="-180" max="180" step="1e-06"/></label>
|
||||
<label v-show="paramCinc.cincIsPositional === true"><span>Подспутниковая точка</span><input type="number" v-model="paramCinc.cincPositionSatelliteLongitude" min="-180" max="180" step="1e-06"/></label>
|
||||
<h2 v-show="paramCinc.cincIsPositional === false">Задержка до спутника</h2>
|
||||
<label v-show="paramCinc.cincIsPositional === false"><span>от, мс</span><input type="number" v-model="paramCinc.cincDelayMin" max="400" step="0.1"/></label>
|
||||
<label v-show="paramCinc.cincIsPositional === false"><span>до, мс</span><input type="number" v-model="paramCinc.cincDelayMax" max="400" step="0.1"/></label>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitCinc()" v-show="paramRxtx.isCinC">Сохранить <span class="submit-spinner" v-show="submitStatus.cinc"></span></button>
|
||||
<h2>Настройки питания и опорного генератора</h2>
|
||||
@ -448,13 +470,62 @@
|
||||
<label><span>Максимальное количество соединений</span><input type="number" v-model="paramTcpaccel.accelMaxConnections" max="4000" step="1"/></label>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitTcpaccel()">Сохранить <span class="submit-spinner" v-show="submitStatus.tcpaccel"></span></button>
|
||||
</div> <div class="tabs-body-item" v-if="activeTab === 'admin' && settingFetchComplete">
|
||||
<h2>Настройки сети</h2>
|
||||
<div class="settings-set-container">
|
||||
<h3>Настройки интерфейса управления</h3>
|
||||
<label>
|
||||
<span>Интерфейс управления (/24)</span>
|
||||
<input v-model="paramNetwork.netManagementIp" required type="text" pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
|
||||
</label>
|
||||
<label>
|
||||
<span>Режим сети</span>
|
||||
<select v-model="paramNetwork.netIsL2">
|
||||
<option :value="false">Маршрутизатор</option>
|
||||
<option :value="true">Коммутатор</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-show="paramNetwork.netIsL2 === false">
|
||||
<span>Интерфейс данных (/24)</span>
|
||||
<input v-model="paramNetwork.netDataIp" required type="text" pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
|
||||
</label>
|
||||
<label><span>MTU интерфейса данных</span><input type="number" v-model="paramNetwork.netDataMtu" min="1500" max="2000" step="1"/></label>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitNetwork()">Сохранить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
|
||||
<h2>Система</h2>
|
||||
<div class="settings-set-container">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Версия ПО</th><td>{{ about.firmwareVersion }}</td></tr>
|
||||
<tr><th>ID модема</th><td>{{ about.modemUid }}</td></tr>
|
||||
<tr><th>Серийный номер</th><td>{{ about.modemSn }}</td></tr>
|
||||
<tr><th>MAC интерфейса управления</th><td>{{ about.macManagement }}</td></tr>
|
||||
<tr><th>MAC интерфейса управления</th><td>{{ about.macData }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<button class="dangerous-button" @click="doModemReboot()">Перезагрузить модем <span class="submit-spinner" v-show="submitStatus.modemReboot !== null"></span></button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="dangerous-button" onclick="fetch('/api/resetSettings', { method: 'POST' }).then((r) => { window.location.reload(); })">Сбросить модем до заводских настроек</button>
|
||||
</div>
|
||||
|
||||
<h3>Обновление ПО</h3>
|
||||
<label>
|
||||
<span>Файл {{ this.uploadFw.progress !== null ? `(${this.uploadFw.progress}%)` : '' }}</span>
|
||||
<input type="file" accept="application/zip" @change="(e) => { this.uploadFw.filename = e.target.files[0] }">
|
||||
<span v-if="uploadFw.sha256 !== null">SHA256: {{ uploadFw.sha256 }}</span>
|
||||
</label>
|
||||
<button class="action-button" @click="settingsUploadUpdate()">Загрузить<span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button>
|
||||
<button class="dangerous-button" v-show="uploadFw.sha256 !== null" @click="settingsPerformFirmwareUpgrade()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpgrade"></span></button>
|
||||
</div> </div>
|
||||
<p>Последнее обновление статистики: {{ lastUpdateTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/vue.js"></script>
|
||||
<script>
|
||||
const availableTabs = ['monitoring', 'setup', 'qos']
|
||||
const availableTabs = ['monitoring', 'setup', 'qos', 'admin']
|
||||
|
||||
// для обновления высоты хидера
|
||||
function updateHeaderHeight() { const header = document.querySelector('header'); document.body.style.setProperty('--header-height', `${header.offsetHeight}px`); }
|
||||
@ -477,6 +548,7 @@
|
||||
cinc: false,
|
||||
buclnb: false,
|
||||
tcpaccel: false,
|
||||
network: false,
|
||||
firmwareUpload: false,
|
||||
firmwareUpgrade: false,
|
||||
// когда модем перезагружается, тут должен быть счетчик. Направление счета - к нулю
|
||||
@ -502,6 +574,7 @@
|
||||
rxAgcEn: false,
|
||||
rxBaudrate: 0,
|
||||
rxCentralFreq: 900000,
|
||||
rxGoldan: 0,
|
||||
rxManualGain: -40,
|
||||
rxRolloff: 2,
|
||||
rxSpectrumInversion: false,
|
||||
@ -511,12 +584,18 @@
|
||||
txCentralFreq: 900000,
|
||||
txEn: false,
|
||||
txFrameSizeNormal: true,
|
||||
txGoldan: 0,
|
||||
txIsTestInput: false,
|
||||
txModulatorIsTest: false,
|
||||
txRolloff: 2,
|
||||
},
|
||||
paramCinc: {
|
||||
cincDelayMax: 0,
|
||||
cincDelayMin: 0,
|
||||
cincIsPositional: true,
|
||||
cincPositionSatelliteLongitude: -180,
|
||||
cincPositionStationLatitude: -180,
|
||||
cincPositionStationLongitude: -180,
|
||||
cincSearchBandwidth: 0,
|
||||
},
|
||||
paramBuclnb: {
|
||||
@ -531,6 +610,12 @@
|
||||
accelEn: false,
|
||||
accelMaxConnections: 0,
|
||||
},
|
||||
paramNetwork: {
|
||||
netDataIp: null,
|
||||
netDataMtu: 1500,
|
||||
netIsL2: false,
|
||||
netManagementIp: null,
|
||||
},
|
||||
// ========== include end from 'common/all-params-data.js.j2'
|
||||
|
||||
// ========== include from 'common/monitoring-data.js.j2'
|
||||
@ -589,6 +674,9 @@
|
||||
cd: [],
|
||||
}, // ========== include end from 'common/qos-data.js.j2'
|
||||
|
||||
// ========== include from 'common/admin-data.js.j2'
|
||||
// ========== include end from 'common/admin-data.js.j2'
|
||||
|
||||
uploadFw: {
|
||||
progress: null,
|
||||
filename: null,
|
||||
@ -666,6 +754,7 @@
|
||||
"rxAgcEn": this.paramRxtx.rxAgcEn,
|
||||
"rxBaudrate": this.paramRxtx.rxBaudrate,
|
||||
"rxCentralFreq": this.paramRxtx.rxCentralFreq,
|
||||
"rxGoldan": this.paramRxtx.rxGoldan,
|
||||
"rxManualGain": this.paramRxtx.rxManualGain,
|
||||
"rxRolloff": this.paramRxtx.rxRolloff,
|
||||
"rxSpectrumInversion": this.paramRxtx.rxSpectrumInversion,
|
||||
@ -675,6 +764,7 @@
|
||||
"txCentralFreq": this.paramRxtx.txCentralFreq,
|
||||
"txEn": this.paramRxtx.txEn,
|
||||
"txFrameSizeNormal": this.paramRxtx.txFrameSizeNormal,
|
||||
"txGoldan": this.paramRxtx.txGoldan,
|
||||
"txIsTestInput": this.paramRxtx.txIsTestInput,
|
||||
"txModulatorIsTest": this.paramRxtx.txModulatorIsTest,
|
||||
"txRolloff": this.paramRxtx.txRolloff,
|
||||
@ -690,7 +780,12 @@
|
||||
if (this.submitStatus.cinc) { return }
|
||||
|
||||
let query = {
|
||||
"cincDelayMax": this.paramCinc.cincDelayMax,
|
||||
"cincDelayMin": this.paramCinc.cincDelayMin,
|
||||
"cincIsPositional": this.paramCinc.cincIsPositional,
|
||||
"cincPositionSatelliteLongitude": this.paramCinc.cincPositionSatelliteLongitude,
|
||||
"cincPositionStationLatitude": this.paramCinc.cincPositionStationLatitude,
|
||||
"cincPositionStationLongitude": this.paramCinc.cincPositionStationLongitude,
|
||||
"cincSearchBandwidth": this.paramCinc.cincSearchBandwidth,
|
||||
}
|
||||
|
||||
@ -702,6 +797,7 @@
|
||||
},
|
||||
settingsSubmitBuclnb() {
|
||||
if (this.submitStatus.buclnb) { return }
|
||||
{ if (!confirm("Применение неправильных настроек может вывести из строя оборудование! Продолжить?")) return }
|
||||
|
||||
let query = {
|
||||
"bucLnbAutoStart": this.paramBuclnb.bucLnbAutoStart,
|
||||
@ -732,6 +828,23 @@
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.tcpaccel = false })
|
||||
},
|
||||
settingsSubmitNetwork() {
|
||||
if (this.submitStatus.network) { return }
|
||||
{ if (!confirm("Применение этих настроек может сделать модем недоступным! Продолжить?")) return }
|
||||
|
||||
let query = {
|
||||
"netDataIp": this.paramNetwork.netDataIp,
|
||||
"netDataMtu": this.paramNetwork.netDataMtu,
|
||||
"netIsL2": this.paramNetwork.netIsL2,
|
||||
"netManagementIp": this.paramNetwork.netManagementIp,
|
||||
}
|
||||
|
||||
this.submitStatus.network = true
|
||||
fetch('/api/set/network', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(query) })
|
||||
.then(async (resp) => { this.updateNetworkSettings(await resp.json()) })
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.network = false })
|
||||
},
|
||||
|
||||
updateRxtxSettings(vals) {
|
||||
this.submitStatus.rxtx = false
|
||||
@ -752,6 +865,7 @@
|
||||
this.paramRxtx.rxAgcEn = vals["settings"]["rxAgcEn"]
|
||||
this.paramRxtx.rxBaudrate = vals["settings"]["rxBaudrate"]
|
||||
this.paramRxtx.rxCentralFreq = vals["settings"]["rxCentralFreq"]
|
||||
this.paramRxtx.rxGoldan = vals["settings"]["rxGoldan"]
|
||||
this.paramRxtx.rxManualGain = vals["settings"]["rxManualGain"]
|
||||
this.paramRxtx.rxRolloff = vals["settings"]["rxRolloff"]
|
||||
this.paramRxtx.rxSpectrumInversion = vals["settings"]["rxSpectrumInversion"]
|
||||
@ -761,13 +875,19 @@
|
||||
this.paramRxtx.txCentralFreq = vals["settings"]["txCentralFreq"]
|
||||
this.paramRxtx.txEn = vals["settings"]["txEn"]
|
||||
this.paramRxtx.txFrameSizeNormal = vals["settings"]["txFrameSizeNormal"]
|
||||
this.paramRxtx.txGoldan = vals["settings"]["txGoldan"]
|
||||
this.paramRxtx.txIsTestInput = vals["settings"]["txIsTestInput"]
|
||||
this.paramRxtx.txModulatorIsTest = vals["settings"]["txModulatorIsTest"]
|
||||
this.paramRxtx.txRolloff = vals["settings"]["txRolloff"]
|
||||
},
|
||||
updateCincSettings(vals) {
|
||||
this.submitStatus.cinc = false
|
||||
this.paramCinc.cincDelayMax = vals["settings"]["cincDelayMax"]
|
||||
this.paramCinc.cincDelayMin = vals["settings"]["cincDelayMin"]
|
||||
this.paramCinc.cincIsPositional = vals["settings"]["cincIsPositional"]
|
||||
this.paramCinc.cincPositionSatelliteLongitude = vals["settings"]["cincPositionSatelliteLongitude"]
|
||||
this.paramCinc.cincPositionStationLatitude = vals["settings"]["cincPositionStationLatitude"]
|
||||
this.paramCinc.cincPositionStationLongitude = vals["settings"]["cincPositionStationLongitude"]
|
||||
this.paramCinc.cincSearchBandwidth = vals["settings"]["cincSearchBandwidth"]
|
||||
},
|
||||
updateBuclnbSettings(vals) {
|
||||
@ -784,6 +904,13 @@
|
||||
this.paramTcpaccel.accelEn = vals["settings"]["accelEn"]
|
||||
this.paramTcpaccel.accelMaxConnections = vals["settings"]["accelMaxConnections"]
|
||||
},
|
||||
updateNetworkSettings(vals) {
|
||||
this.submitStatus.network = false
|
||||
this.paramNetwork.netDataIp = vals["settings"]["netDataIp"]
|
||||
this.paramNetwork.netDataMtu = vals["settings"]["netDataMtu"]
|
||||
this.paramNetwork.netIsL2 = vals["settings"]["netIsL2"]
|
||||
this.paramNetwork.netManagementIp = vals["settings"]["netManagementIp"]
|
||||
},
|
||||
// ========== include end from 'common/all-params-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/monitoring-methods.js.j2'
|
||||
@ -1085,6 +1212,70 @@
|
||||
},
|
||||
// ========== include end from 'common/qos-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/admin-methods.js.j2'
|
||||
async settingsUploadUpdate() {
|
||||
if (!this.uploadFw.filename) {
|
||||
alert('Выберите файл для загрузки');
|
||||
return;
|
||||
}
|
||||
|
||||
async function readFileAsArrayBuffer(fileName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!fileName) { reject(`Файл не выбран`); return }
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => { resolve(reader.result) }
|
||||
reader.onerror = (e) => { reject(e) }
|
||||
reader.readAsArrayBuffer(fileName)
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
this.submitStatus.firmwareUpload = true
|
||||
this.uploadFw.progress = 0
|
||||
const blob = await readFileAsArrayBuffer(this.uploadFw.filename)
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
await new Promise((resolve) => {
|
||||
xhr.upload.addEventListener("progress", (event) => {
|
||||
if (event.lengthComputable) {
|
||||
this.uploadFw.progress = Math.round((event.loaded / event.total) * 1000) / 10;
|
||||
}
|
||||
});
|
||||
xhr.addEventListener("loadend", () => {
|
||||
this.uploadFw.progress = 100
|
||||
const rep = JSON.parse(xhr.responseText);
|
||||
this.uploadFw.sha256 = rep['sha256']
|
||||
resolve(xhr.readyState === 4 && xhr.status === 200);
|
||||
});
|
||||
xhr.open("PUT", "/api/firmwareUpdate", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/octet-stream");
|
||||
xhr.send(blob);
|
||||
});
|
||||
} catch (e) {
|
||||
alert(`Ошибка загрузки файла: ${e}`);
|
||||
}
|
||||
this.submitStatus.firmwareUpload = false
|
||||
},
|
||||
|
||||
async settingsPerformFirmwareUpgrade() {
|
||||
if (this.submitStatus.firmwareUpgrade) { return }
|
||||
this.submitStatus.firmwareUpgrade = true
|
||||
try {
|
||||
await fetch('/api/doFirmwareUpgrade', { method: 'POST' })
|
||||
} catch (e) {
|
||||
console.log("failed to perform upgrade firmware: ", e)
|
||||
}
|
||||
this.submitStatus.firmwareUpgrade = false
|
||||
},
|
||||
|
||||
doModemReboot() {
|
||||
if (this.submitStatus.modemReboot !== null) {
|
||||
return
|
||||
}
|
||||
this.submitStatus.modemReboot = 30
|
||||
fetch('/api/reboot', { method: 'POST' }).then((r) => {})
|
||||
}, // ========== include end from 'common/admin-methods.js.j2'
|
||||
|
||||
|
||||
performUpdateSettings() {
|
||||
const doFetchSettings = async () => {
|
||||
@ -1095,6 +1286,7 @@
|
||||
this.updateCincSettings(vals)
|
||||
this.updateBuclnbSettings(vals)
|
||||
this.updateTcpaccelSettings(vals)
|
||||
this.updateNetworkSettings(vals)
|
||||
this.updateQosSettings(vals)
|
||||
}
|
||||
|
||||
|
@ -204,66 +204,31 @@
|
||||
</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">
|
||||
</div> <div class="tabs-body-item" v-if="activeTab === 'admin' && settingFetchComplete">
|
||||
<h2>Настройки сети</h2>
|
||||
<div class="settings-set-container">
|
||||
<h3>Интерфейс управления</h3>
|
||||
<h3>Настройки интерфейса управления</h3>
|
||||
<label>
|
||||
<span>IP адрес/маска</span>
|
||||
<input v-model="param.network.managementIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
<span>Интерфейс управления (/24)</span>
|
||||
<input v-model="paramNetwork.netManagementIp" required type="text" pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
|
||||
</label>
|
||||
<label>
|
||||
<span>Шлюз интерфейса управления</span>
|
||||
<input v-model="param.network.managementGateway" type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
</label>
|
||||
<label>
|
||||
<span>Режим модема</span>
|
||||
<select v-model="param.network.mode">
|
||||
<option value="l2">Коммутатор</option>
|
||||
<option value="l3">Маршрутизатор</option>
|
||||
<span>Режим сети</span>
|
||||
<select v-model="paramNetwork.netIsL2">
|
||||
<option :value="false">Маршрутизатор</option>
|
||||
<option :value="true">Коммутатор</option>
|
||||
</select>
|
||||
</label>
|
||||
<h3>Интерфейс данных</h3>
|
||||
<label v-if="param.network.mode === 'l3'">
|
||||
<span>IP адрес/маска</span>
|
||||
<input v-model="param.network.dataIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$">
|
||||
<label v-show="paramNetwork.netIsL2 === false">
|
||||
<span>Интерфейс данных (/24)</span>
|
||||
<input v-model="paramNetwork.netDataIp" required type="text" pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
|
||||
</label>
|
||||
<label>
|
||||
<span>MTU</span>
|
||||
<input v-model="param.network.dataMtu" required type="number" min="1500" max="9000">
|
||||
</label>
|
||||
<button class="action-button" @click="settingsSubmitNetwork()">Применить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
<label><span>MTU интерфейса данных</span><input type="number" v-model="paramNetwork.netDataMtu" min="1500" max="2000" step="1"/></label>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitNetwork()">Сохранить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
|
||||
<h2>Система</h2>
|
||||
<div class="settings-set-container">
|
||||
<h3>Отладка</h3>
|
||||
<label>
|
||||
<span>Передача отладочной информации</span>
|
||||
<span class="toggle-input">
|
||||
<input type="checkbox" v-model="param.debugSend.en" />
|
||||
<span class="slider"></span>
|
||||
</span>
|
||||
</label>
|
||||
<label v-if="param.debugSend.en">
|
||||
<span>IP адрес получателя</span>
|
||||
<input v-model="param.debugSend.receiverIp" required type="text" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}">
|
||||
</label>
|
||||
<label>
|
||||
<span>Порт для данных</span>
|
||||
<input v-model="param.debugSend.portCinC" type="number" min="0" max="65535">
|
||||
</label>
|
||||
<label>
|
||||
<span>Порт для CinC</span>
|
||||
<input v-model="param.debugSend.portData" type="number" min="0" max="65535">
|
||||
</label>
|
||||
<label>
|
||||
<span>Таймаут</span>
|
||||
<input v-model="param.debugSend.timeout" type="number" pattern="^[0-9]+$">
|
||||
</label>
|
||||
<button class="action-button" @click="settingsSubmitDebugSend()">Применить <span class="submit-spinner" v-show="submitStatus.network"></span></button>
|
||||
</div>
|
||||
<div class="settings-set-container">
|
||||
<h3>Управление ПО</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Версия ПО</th><td>{{ about.firmwareVersion }}</td></tr>
|
||||
@ -288,9 +253,7 @@
|
||||
</label>
|
||||
<button class="action-button" @click="settingsUploadUpdate()">Загрузить<span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button>
|
||||
<button class="dangerous-button" v-show="uploadFw.sha256 !== null" @click="settingsPerformFirmwareUpgrade()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpgrade"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> </div>
|
||||
<p>Последнее обновление статистики: {{ lastUpdateTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -317,6 +280,7 @@
|
||||
submitStatus: {
|
||||
rxtx: false,
|
||||
buclnb: false,
|
||||
network: false,
|
||||
firmwareUpload: false,
|
||||
firmwareUpgrade: false,
|
||||
// когда модем перезагружается, тут должен быть счетчик. Направление счета - к нулю
|
||||
@ -345,6 +309,12 @@
|
||||
lnbRefClk10M: false,
|
||||
srvRefClk10M: false,
|
||||
},
|
||||
paramNetwork: {
|
||||
netDataIp: null,
|
||||
netDataMtu: 1500,
|
||||
netIsL2: false,
|
||||
netManagementIp: null,
|
||||
},
|
||||
// ========== include end from 'common/all-params-data.js.j2'
|
||||
|
||||
// ========== include from 'common/monitoring-data.js.j2'
|
||||
@ -487,6 +457,23 @@
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.buclnb = false })
|
||||
},
|
||||
settingsSubmitNetwork() {
|
||||
if (this.submitStatus.network) { return }
|
||||
{ if (!confirm("Применение этих настроек может сделать модем недоступным! Продолжить?")) return }
|
||||
|
||||
let query = {
|
||||
"netDataIp": this.paramNetwork.netDataIp,
|
||||
"netDataMtu": this.paramNetwork.netDataMtu,
|
||||
"netIsL2": this.paramNetwork.netIsL2,
|
||||
"netManagementIp": this.paramNetwork.netManagementIp,
|
||||
}
|
||||
|
||||
this.submitStatus.network = true
|
||||
fetch('/api/set/network', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(query) })
|
||||
.then(async (resp) => { this.updateNetworkSettings(await resp.json()) })
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.network = false })
|
||||
},
|
||||
|
||||
updateRxtxSettings(vals) {
|
||||
this.submitStatus.rxtx = false
|
||||
@ -511,6 +498,13 @@
|
||||
this.paramBuclnb.lnbRefClk10M = vals["settings"]["lnbRefClk10M"]
|
||||
this.paramBuclnb.srvRefClk10M = vals["settings"]["srvRefClk10M"]
|
||||
},
|
||||
updateNetworkSettings(vals) {
|
||||
this.submitStatus.network = false
|
||||
this.paramNetwork.netDataIp = vals["settings"]["netDataIp"]
|
||||
this.paramNetwork.netDataMtu = vals["settings"]["netDataMtu"]
|
||||
this.paramNetwork.netIsL2 = vals["settings"]["netIsL2"]
|
||||
this.paramNetwork.netManagementIp = vals["settings"]["netManagementIp"]
|
||||
},
|
||||
// ========== include end from 'common/all-params-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/monitoring-methods.js.j2'
|
||||
@ -581,58 +575,6 @@
|
||||
// ========== include end from 'common/setup-methods.js.j2'
|
||||
|
||||
// ========== include from 'common/admin-methods.js.j2'
|
||||
settingsSubmitNetwork() {
|
||||
if (this.submitStatus.network) { return }
|
||||
let query = {
|
||||
"network.managementIp": this.param.network.managementIp,
|
||||
"network.managementGateway": this.param.network.managementGateway,
|
||||
"network.mode": this.param.network.mode,
|
||||
"network.dataIp": this.param.network.dataIp,
|
||||
"network.dataMtu": this.param.network.dataMtu
|
||||
}
|
||||
if (confirm('Вы уверены, что хотите сохранить настройки сети? После этого модем может стать недоступным.')) {
|
||||
this.submitStatus.network = true
|
||||
fetch('/api/set/network', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.network = false
|
||||
this.updateNetworkSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.network = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
settingsSubmitDebugSend() {
|
||||
if (this.submitStatus.debugSend) { return }
|
||||
let query = {
|
||||
"debugSend.en": this.param.debugSend.en,
|
||||
"debugSend.receiverIp": this.param.debugSend.receiverIp,
|
||||
"debugSend.portCinC": this.param.debugSend.portCinC,
|
||||
"debugSend.portData": this.param.debugSend.portData,
|
||||
"debugSend.timeout": this.param.debugSend.timeout
|
||||
}
|
||||
this.submitStatus.debugSend = true
|
||||
fetch('/api/set/debugSend', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatus.debugSend = false
|
||||
this.updateNetworkSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatus.debugSend = false
|
||||
alert(`Ошибка при применении настроек: ${reason}`)
|
||||
})
|
||||
},
|
||||
|
||||
async settingsUploadUpdate() {
|
||||
if (!this.uploadFw.filename) {
|
||||
alert('Выберите файл для загрузки');
|
||||
@ -688,24 +630,6 @@
|
||||
this.submitStatus.firmwareUpgrade = false
|
||||
},
|
||||
|
||||
updateNetworkSettings(vals) {
|
||||
this.submitStatus.network = false
|
||||
this.param.network.managementIp = vals["settings"]["network.managementIp"]
|
||||
this.param.network.managementGateway = vals["settings"]["network.managementGateway"]
|
||||
this.param.network.mode = vals["settings"]["network.mode"]
|
||||
this.param.network.dataIp = vals["settings"]["network.dataIp"]
|
||||
this.param.network.dataMtu = vals["settings"]["network.dataMtu"]
|
||||
},
|
||||
|
||||
updateDebugSendSettings(vals) {
|
||||
this.submitStatus.debugSend = false
|
||||
this.param.debugSend.en = vals["settings"]["debugSend.en"]
|
||||
this.param.debugSend.receiverIp = vals["settings"]["debugSend.receiverIp"]
|
||||
this.param.debugSend.portCinC = vals["settings"]["debugSend.portCinC"]
|
||||
this.param.debugSend.portData = vals["settings"]["debugSend.portData"]
|
||||
this.param.debugSend.timeout = vals["settings"]["debugSend.timeout"]
|
||||
},
|
||||
|
||||
doModemReboot() {
|
||||
if (this.submitStatus.modemReboot !== null) {
|
||||
return
|
||||
@ -722,6 +646,7 @@
|
||||
this.settingFetchComplete = true
|
||||
this.updateRxtxSettings(vals)
|
||||
this.updateBuclnbSettings(vals)
|
||||
this.updateNetworkSettings(vals)
|
||||
}
|
||||
|
||||
doFetchSettings().then(() => {})
|
||||
|
Loading…
x
Reference in New Issue
Block a user