Skip to content

Commit

Permalink
GH-1673 : Fix undefined bootstrap server port in bootstrap demo UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jan 13, 2025
1 parent 70fb56e commit 8cdd24b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
v-model="server.url"
@update:model-value="$emit('update:model-value', server)"
:label="
server.mode == 'no_sec'
server.security.mode == 'no_sec'
? 'Server URL (default :' + defaultNoSecValue + ')'
: 'Server URL (default :' + defaultSecureValue + ')'
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,21 @@ export default {
},
beforeMount() {
this.axios.get("api/server/endpoint").then((response) => {
// Search bootstrap coap(s) ports.
let coapPort, coapsPort;
for (const ep of response.data) {
if (!coapPort && ep.uri.scheme == "coap") {
coapPort = ep.uri.port;
}
if (!coapsPort && ep.uri.scheme == "coaps") {
coapsPort = ep.uri.port;
}
}

this.defval.dm.url.nosec = `coap://${location.hostname}:5683`;
this.defval.dm.url.sec = `coaps://${location.hostname}:5684`;
this.defval.bs.url.nosec = `coap://${location.hostname}:${response.data.unsecuredEndpointPort}`;
this.defval.bs.url.sec = `coaps://${location.hostname}:${response.data.securedEndpointPort}`;
this.defval.bs.url.nosec = `coap://${location.hostname}:${coapPort}`;
this.defval.bs.url.sec = `coaps://${location.hostname}:${coapsPort}`;
});

this.axios.get("api/server/security").then((response) => {
Expand Down

0 comments on commit 8cdd24b

Please sign in to comment.