create-adapter
create-adapter copied to clipboard
Add all (most) possible config elements
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.
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.
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.
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.
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.
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?
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.
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