Skip to content

Commit

Permalink
bsserver-demo: show path to delete in Config column of bootstrap view.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Nov 30, 2021
1 parent 609ffbf commit 6ff40bb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default {
security: null,
dm: { mode: "no_sec" },
bs: null,
toDelete: ["/0", "/1"],
};
this.currentStep = 1;
for (let i = 1; i <= this.nbSteps; i++) {
Expand Down
7 changes: 4 additions & 3 deletions leshan-bsserver-demo/webapp/src/js/bsconfigutil.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2021 Sierra Wireless and others.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v20.html
* and the Eclipse Distribution License is available at
Expand Down Expand Up @@ -34,6 +34,7 @@ var configFromRestToUI = function(config) {
}
}
}
newConfig.toDelete = config.toDelete;
return newConfig;
};
var configsFromRestToUI = function(configs) {
Expand Down Expand Up @@ -62,7 +63,7 @@ var configFromUIToRest = function(c) {
delete dm.security;
newConfig.servers[j] = dm;
}
newConfig.toDelete = ["/0", "/1"];
newConfig.toDelete = config.toDelete;
return newConfig;
};

Expand Down
14 changes: 14 additions & 0 deletions leshan-bsserver-demo/webapp/src/views/Bootstrap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
<!--custom display for "config" column-->
<template v-slot:item.config="{ item }">
<div class="pa-2">
<!-- Path to delete -->
<span v-if="item.toDelete && item.toDelete.length > 0">
Delete :
<span v-for="path in item.toDelete" :key="path">
<code>{{ path }}</code
>,
</span>
<br />
</span>
<!-- LWM2M Server to add -->
<span v-for="server in item.dm" :key="server.shortid">
Add Server: <code>{{ server.security.uri }}</code>
<span v-if="server.security.securityMode.toLowerCase() != 'no_sec'">
Expand All @@ -77,6 +87,7 @@
</span>
<br />
</span>
<!-- LWM2M Bootstrap Server to add -->
<span v-for="server in item.bs" :key="server.security.uri">
Add Bootstrap Server: <code>{{ server.security.uri }}</code>
<span v-if="server.security.securityMode.toLowerCase() != 'no_sec'">
Expand Down Expand Up @@ -276,6 +287,9 @@ export default {
if (config.security) {
c.security = config.security;
}
if (config.toDelete) {
c.toDelete = config.toDelete;
}
this.axios
.post(
Expand Down

0 comments on commit 6ff40bb

Please sign in to comment.