Comments (7)
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.
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.
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.
Interesting feature and the proposed workflow looks good to me, can't see why it wouldn't work.
from pyaiot.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyaiot.