support different server ports

This commit is contained in:
DJ2LS 2024-03-04 15:50:08 +01:00
parent 2b21aab26b
commit 90790bd8e0
4 changed files with 14 additions and 1 deletions

View file

@ -126,6 +126,7 @@ function testHamlib() {
max="65534" max="65534"
min="1025" min="1025"
v-model="settings.local.port" v-model="settings.local.port"
@change="onChange"
/> />
</div> </div>
@ -137,6 +138,7 @@ function testHamlib() {
placeholder="modem host (default 127.0.0.1)" placeholder="modem host (default 127.0.0.1)"
id="modem_port" id="modem_port"
v-model="settings.local.host" v-model="settings.local.host"
@change="onChange"
/> />
</div> </div>
</div> </div>

View file

@ -1,4 +1,5 @@
[NETWORK] [NETWORK]
modemaddress = 127.0.0.1
modemport = 5000 modemport = 5000
[STATION] [STATION]

View file

@ -10,6 +10,7 @@ class CONFIG:
config_types = { config_types = {
'NETWORK': { 'NETWORK': {
'modemaddress': str,
'modemport': int, 'modemport': int,
}, },
'STATION': { 'STATION': {

View file

@ -344,4 +344,13 @@ if __name__ == "__main__":
# initialize database default values # initialize database default values
DatabaseManager(app.event_manager).initialize_default_values() DatabaseManager(app.event_manager).initialize_default_values()
wsm.startThreads(app) wsm.startThreads(app)
app.run()
conf = app.config_manager.read()
modemaddress = conf['NETWORK']['modemaddress']
modemport = conf['NETWORK']['modemport']
if not modemaddress:
modemaddress = '127.0.0.1'
if not modemport:
modemport = 5000
app.run(modemaddress, modemport)