Coder Social home page Coder Social logo

Comments (7)

aabadie avatar aabadie commented on September 23, 2024

Your idea sounds interesting but I'm wondering how it can work with the actual state of the vuejs application.

Each resource (endpoint) is linked to only one specific widget via a global data model in the web interface. If we want to have the same widget type for different endpoints in the same node, the vuejs data model and the view will have to be updated. I see this workflow:

  • when receiving an update message, split the endpoint based on _ (as you suggested) and get a data type (led, temperature, etc) and a data name/id (could be numbers or strings)
  • then instead of storing the data value directly in the model (see this line, we could use a more complex structure containing the type (led, temperature) and the value.
  • on the view, wrap the whole body container in a HTML element with a v-for loop attribute, (around here).

It's not very nice, but it should work.

Maybe @bformet has good advices for this.

from pyaiot.

bergzand avatar bergzand commented on September 23, 2024

I was afraid it would be somewhat more complicated than simply splitting and iterating. Thats why I opened an issue for this :)
Thanks for the pointers, I'm going to play around a bit, see if I can get something working.

from pyaiot.

aabadie avatar aabadie commented on September 23, 2024

I'm going to play around a bit, see if I can get something working.

Keep us posted of any progress or problem.

By the way, there's also a need for a major refactoring of the dashboard html page: it would be great to take profit of vuejs components mecanism and webpack for generating smaller js code (among other things for the developper).

from pyaiot.

bformet avatar bformet commented on September 23, 2024

Interesting feature and the proposed workflow looks good to me, can't see why it wouldn't work.

from pyaiot.

astralien3000 avatar astralien3000 commented on September 23, 2024

Maybe it's not the main topic here, but I would rather do:

/outside/temp
/inside/temp

than:

/temp_inside
/temp_outside

At least it's what the URLs are for, in my opinion.

from pyaiot.

aabadie avatar aabadie commented on September 23, 2024

Maybe it's not the main topic here, but I would rather do

+1 for the sub-url but then I would use them the other way around:

/temperature/outside
/temperature/inside

It should be easier for parsing them on the application side.

What do you think ?

from pyaiot.

bergzand avatar bergzand commented on September 23, 2024

I'll make sure to build a separate function for the path/identifier parsing, should be easy to adapt to different use cases if necessary :)

from pyaiot.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.