I have successfully got uibuilder up and running. I am running the following setup:
I have figured out a way to parse the msg payload in index.js. I am not sure it's the best way but I can at least pull out the payload and topic. I add this to the computed section of index.js
computed: {
hLastTopic: function(){
var msgTopic = this.msgTopic
if (typeof msgTopic === 'string') return 'Last Topic Received = ' + msgTopic
else return 'Last Topic Received = ' + this.syntaxHighlight(msgTopic)
},
hLastPayload: function(){
var msgPayload = this.msgPayload
return msgPayload
},
I added the following code to index.html try and parse out the payload and topic.
<b-button id="tune_status" pill variant="primary">Tune {{msgPayload}}</b-button>
<b-card class="mt-3" header="Normal Messages" border-variant="primary" header-bg-variant="primary" header-text-variant="white" align="left" >
<p>
Messages: Received=<b>{{msgsReceived}}</b>, Sent=<b>{{msgsSent}}</b>
</p>
<pre v-html="hLastRcvd" class="syntax-highlight"></pre>
<pre v-html="hLastTopic" class="syntax-highlight"></pre>
<pre v-html="hLastSent" class="syntax-highlight"></pre>
<p slot="footer" class="mb-0">
The received message is from the input to the uibuilder node.
The send message will appear out of port #1 of the node.
</p>
</b-card>
I get this output
I want to be able to do an if then else and depending on the payload result set attributes like background color, etc. I have been tweaking the above computed functions but unless I have them set as shown I blow up the web page (blank page). Since I am running vu.js I did a quick search for if then esle and I see a directive called v-if.
At this point I am confused on how to apply if then else statements for uibuilder. Should I be doing that in the computed section? Or should I be doing that in the index.html with vu.js directives. I suspect the computed functions are not for general if then else type statements to define css styles.
Regards