Don't know how to link in command from Web interface
Problem: Cannot figure out how to get an icon on the GUI to perform the function I need.
Well getting the icons on the screen is easy and will be simple for others to do as well and we all know that these modifications would need to be done with each build so simple is good. My problem is getting the GUI to do what I want and I'm sure it's easy in someones mind but Dojo is quite honestly beyond me. Searching the internet left me more baffled than when I started.
So I know I need to call two functions but where do I put them and how would they be formatted?
I placed the following lines into the /trunk/gui/templates/menubar.html file:
Code:
<div dojoType="dijit.MenuBarItem" onClick="minidlna_stop();" class="menu_icon">
<img src="{{ STATIC_URL }}images/ui/menu/minidlna_stop.png" width="24" height="24" align="center">
<span>{% trans "Stop" %}<br>{% trans "Minidlna" %}</span>
</div>
<div dojoType="dijit.MenuBarItem" onClick="minidlna_rebuild();" class="menu_icon">
<img src="{{ STATIC_URL }}images/ui/menu/minidlna_run.png" width="24" height="24" align="center">
<span>{% trans "Rebuild" %}<br>{% trans "Minidlna" %}</span>
</div>
And I added the two icons as well.
The two functions I need are:
1) stop_minidlna() : would run the command '/usr/local/etc/rc.d/minidlna stop'.
2) rebuild_minidlna() : which would run the commands:
'/usr/local/etc/rc.d/minidlna stop'
'minidlna -f /usr/local/etc/minidlna.conf -R'
No parameters need be passed as they are simple commands.
Of course knowing how one works means I'd easily figure out any others needed.
Here is a screenshot of the GUI with those above lines incorporated:
The GUI can be made to look a little nicer but the gist is there. I need some help, a point in the right direction in order to finish this little project up.
Thanks.