frangoteam / FUXA

Web-based Process Visualization (SCADA/HMI/Dashboard) software
https://frangoteam.org
MIT License
2.49k stars 740 forks source link

Templating #1158

Open bogdanvaduva opened 2 months ago

bogdanvaduva commented 2 months ago

I will start to say what a great project it is! Describe the feature Being a SCADA application it would be great to have some way of building templates. Let's say we have one item (IoT or something similar) that is replicated for 200 times (as an example). At this point the only way of doing it it is to create 200 identical Views which is not great.

Describe the solution you'd like The way I did it was to branch your project and change a few things.

  1. I allowed page query parameters to become View variables by default, that means that any query parameter will become a variable with the same name
  2. I created a generic a convention called tagName which can be use throughout the Views as variable/tag
  3. The tagName convention is replace at runtime with the query param value of tagName which means that the View is getting an actual tag at runtime
  4. I created a repeater for allowing me to have 200 inputs if I want.

Additional context

image

image

image

image

MatthewReed303 commented 2 months ago

@bogdanvaduva did you see https://github.com/frangoteam/FUXA/wiki/HowTo-use-same-view you can use the same view as a pop up etc

bogdanvaduva commented 2 months ago

Yes @MatthewReed303, I did see it (Thanks). The multiview container required me to define the 200 views and assign each view an actual tag which would be quite a task. I wanted something easier like a data source (for the 200 tags) and a way of assigning that data source to a View. Thats the way I did it and I don't say it's perfect, I just wanted to share.

Jue07 commented 2 months ago

Hi, @bogdanvaduva. Thanks for this interesting sharing. Can you share the details of the steps in a video on how this feature works? I'm still not clear on this. Thank you so much in advance.

bogdanvaduva commented 2 months ago

Hi @Jue07 , I've made a short video. Hope it helps!

FUXA-repeater (1)

Jue07 commented 2 months ago

Thank you so much @bogdanvaduva. May I know which version of Fuxa you are using? because I am using Fuxa 1.1.18 there is no Repeater Data Settings feature.

bogdanvaduva commented 2 months ago

@Jue07 it was built by me. The code is in my repository, feel free to check it, but like I said before it's far from production standards (not to be used in any production environment without the proper warning). The repeater also needs the proper server side settings!

MatthewReed303 commented 2 months ago

@bogdanvaduva why not create a custom Fuxa Branch for your features and then create a pull request and then @unocelli can look at them and merge them into the master branch?