create-adapter icon indicating copy to clipboard operation
create-adapter copied to clipboard

Add all (most) possible config elements

Open Jey-Cee opened this issue 6 years ago • 7 comments

The template is our reference code for the base, but at this time we do not have a real reference for often used html elements in adapter config. Especially password and tables.

All elemnts should work and commented with cross reference. This means there have to be working code in script area and main.js.

  • [ ] Button
  • [ ] Input Number
  • [ ] Input Text
  • [ ] Input Password
  • [ ] Input checkbox
  • [ ] Table with header, 2 or more columns and 2 or more rows
  • [ ] Tabs

Feel free to add more points to this list. Please mark it as enhancement.

Jey-Cee avatar Oct 09 '19 11:10 Jey-Cee

In which form would you like to add it? The easiest would be little snippets of HTML-Code, but commented out. So devs would only need to copy the snippet they need, and remove the HTML comments and rename the inputs to match the option they are intended for.

AlCalzone avatar Oct 09 '19 11:10 AlCalzone

I think snippets are not a good way. A lot of developer does not understand how the html elements, css, script and backend code are working together. So the best is to create working elements with explanation how it works together.

Jey-Cee avatar Oct 09 '19 11:10 Jey-Cee

The difficulty here is that the creator has some options (hidden on the CLI) to specify the config options. The elements would have to be generated for those depending on the type and might not be complete

Or do you mean a help document with examples rather than an actual template?

I'm not sure where that would fit best. Maybe in the iobroker.admin wiki? We could link there from inside the index_m template.

AlCalzone avatar Oct 09 '19 13:10 AlCalzone

Hm, its not ideal but an example adapter as technology demo could be a way. There we can also show how to connect to usb device.

Jey-Cee avatar Oct 09 '19 20:10 Jey-Cee

For a simple UI, I believe https://github.com/ioBroker/ioBroker.admin/pull/664 is the solution. For more complex UIs, the user has to write a lot of code anyways. And for the most complex UIs, I suggest using React.

@AlCalzone should we close this?

UncleSamSwiss avatar Mar 23 '21 12:03 UncleSamSwiss

I think that having a reference how to do these things might be helpful. But it is probably a good idea to add examples in documentation, rather than making the template creation complicated.

AlCalzone avatar Mar 23 '21 13:03 AlCalzone

I have created a example adapter to show how the code is working. Feel free to contribute code. https://github.com/Jey-Cee/ioBroker.examples

Jey-Cee avatar Mar 23 '21 16:03 Jey-Cee