November 26, 20205 yr Thank you everyone for reading. To the plugin gurus like @Squid, @dlandon, @bonienl, and more, this is probably the easiest Unraid dev question you've ever been asked. TL;DR: How do I inject a simple line of JavaScript into the entire WebGUI? I'm making a simple plugin to change the href of the WebGUI Unraid logo. I'd prefer it link to my server IP rather than the Unraid website. Also, I'd like to learn Unraid development and fill some holes in the plugin documentation for aspiring plugin developers. My plugin page in settings currently reads and writes to a configuration file stored on the boot flash drive. I'd like to take values from the configuration file and include those values in some JavaScript across the whole WebGUI. My plugin structure is: /boot/config/plugins/[plugin name] .cfg file: stores user values usr/local/emhttp/plugins/[plugin name] .page file: retrieves values from config and HTTP posts them to save-settings.php save-settings.php: gets the HTTP post data and writes those values to the config file Any help would be greatly appreciated! I've tried to do this all independently based on existing resources, but I figured it's time to ask. Thank you!
November 26, 20205 yr If you have a "settings" .page file, then you need to create another .page that'll inject the code Menu='Buttons' Link='nav-user' --- <? . . . ?> <script> . . . </script>
November 26, 20205 yr Oh, and forgot to mention. Ensure that any and all variables, elements etc are 100% unique and not a generic naming so as to not interfere with any thing else now or in the future, or with any random plugin installed
November 26, 20205 yr Author Thank you so much! Great point about the variable names -- mine are very generic. Thank you for all that you do for the community, @Squid. If I can ask one last question, does anyone know how get a plugin to appear under Tools > Web GUI? I believe I've tried Menu="WebGUI" on my settings .page, but I didn't see it there. However, it could've been any number of other issues in my early code.
November 27, 20205 yr Author 21 hours ago, Squid said: That's how you want it. Just following up in case someone else has this question: Menu="WebGui" works, but Menu="WebGUI" does not.
Archived
This topic is now archived and is closed to further replies.