Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Modifying/Adding to GUI

Hybrid View

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    10

    Modifying/Adding to GUI

    I've added MySQL to the image, and I've been working on adding it to the GUI.

    I've successfully added it to the 'tree' on the left, but I've not been successful in getting it under the tab on the right.

    Can anyone offer some pointers?

    Thanks!


  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    10
    Nervermind!



  3. #3
    Senior Moderator ProtoSD's Avatar
    Join Date
    Jul 2011
    Location
    San Diego, California
    Posts
    3,361
    Nice work Agehring! Maybe you can post a HowTo when you get it all figured out. Don't forget to back up your changes so you don't lose them in an upgrade.

    ZFS, vdevs, zpools, configuring & adding disks for DUMMIES

    SEARCHING FORUMS using Google:

    your keywords blah blah site:forums.freenas.org

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    10
    I'm not making changes on a running instance, this is a build from modified source...

    I'll put together some HowTo notes once I finish it up...

  5. #5
    Senior Member joeschmuck's Avatar
    Join Date
    May 2011
    Location
    Dark Side of the Moon
    Posts
    1,347
    @agehring
    I need to add some buttons to the GUI and after reading your postings here I realized I could (with your help) make it look very good.

    Here is my goal: I need to setup under services 'minidlna' on/off and instead of a configuration wrench maybe a 'rebuild database' button. The commands are simple to start, stop, and rebuild but getting the button on in the GUI is beyond my minds power at this time.

    In all all I really need are three buttons to perform those actions and they can be just to the right of the 'System' icon but what you have done looks much cleaner.

    Any help would be appreciated.

    -Mark

  6. #6
    Senior Member joeschmuck's Avatar
    Join Date
    May 2011
    Location
    Dark Side of the Moon
    Posts
    1,347

    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.
    Last edited by joeschmuck; 11-06-2011 at 01:40 PM.
    FreeNAS 8.3.1-Release-p1 w/MiniDLNA Plugin + MiniDLNA Automatic Scan Fix
    Gigabyte P45T-ES3G | Intel E8500 (3.2GHz) CPU | 16GB DDR3 1066 RAM
    Six WD Red WD20EFRX NAS Hard Drives (RAIDZ2, 7.3TB usable space)
    Adata PD7 USB Flash Drive (4GB) for OS | 1GB Patriot Xporter USB Flash Drive for Scripts & Plugins
    APC Back-UPS Pro BR1000G

  7. #7
    Senior Moderator ProtoSD's Avatar
    Join Date
    Jul 2011
    Location
    San Diego, California
    Posts
    3,361
    Why don't you just have the Rebuild icon do the whole process of stopping, rebuilding, restarting? You could just add another ?? what's the word?? ugggh... into the RC script and call it rebuild.

  8. #8
    Senior Member joeschmuck's Avatar
    Join Date
    May 2011
    Location
    Dark Side of the Moon
    Posts
    1,347
    Quote Originally Posted by protosd View Post
    Why don't you just have the Rebuild icon do the whole process of stopping, rebuilding, restarting? You could just add another ?? what's the word?? ugggh... into the RC script and call it rebuild.
    Actually it would. The second line (with the -R) would start up minidlna and force a rebuild. I put the stop up there so I could check to see if I actually stopped the service, kind of proof I was doing something which did fail many many times before I asked for help. I could get all fancy and add it to the Services tab but this is a temporary adjustment and should just be easy, functional, and look nice until the FreeNAS product includes minidlna (hoping it does).

    I think I understand where you are going with adding to the RC script, I could call the function with a single command. But the answer I still am in need of is how to call that command from the web interface. I've tried the stop and start commands in the OnClick= section of the buttons which proved that didn't work. I know I'm missing something.
    FreeNAS 8.3.1-Release-p1 w/MiniDLNA Plugin + MiniDLNA Automatic Scan Fix
    Gigabyte P45T-ES3G | Intel E8500 (3.2GHz) CPU | 16GB DDR3 1066 RAM
    Six WD Red WD20EFRX NAS Hard Drives (RAIDZ2, 7.3TB usable space)
    Adata PD7 USB Flash Drive (4GB) for OS | 1GB Patriot Xporter USB Flash Drive for Scripts & Plugins
    APC Back-UPS Pro BR1000G

  9. #9
    Senior Moderator ProtoSD's Avatar
    Join Date
    Jul 2011
    Location
    San Diego, California
    Posts
    3,361
    I've almost got it figured out. It's not trivial for certain. A lot of the GUI is built from values in the database and buttons don't work if those tables and values aren't there. I'm adding a service for the jail, but after I get that finished I should be able to add the stuff for Minidlna. The code is actually written in Python with a sprinkle of javascript. Most of the stuff gets done in notifier.py, the rest is database tweaking, lots of it. I'm working with 8.02, I could zip up the modified files, or write a script to merge the changes into a running system, or look at adding it to the source, but that probably isn't a good idea if you're using nightlies. I think the easiest is zipping it all up for people using 8.02 and having a script backup the existing stuff and replace it with the modified stuff. I've still got a bit more to do because jails don't have pid's and the notifier code uses pgrep which doesn't find jails unless you use -lj, but I've almost got it.

    A lot of stuff is pre-configured for a webserver, unison, bittorrent, and a couple other things to be added in later on.

  10. #10
    Senior Member joeschmuck's Avatar
    Join Date
    May 2011
    Location
    Dark Side of the Moon
    Posts
    1,347
    Thanks for all the help. For the database, is that something that is easily adjusted prior to compiling FreeNAS? I new notifier.py was involved but couldn't figure out how to execute any code in there (button commanded that is).
    FreeNAS 8.3.1-Release-p1 w/MiniDLNA Plugin + MiniDLNA Automatic Scan Fix
    Gigabyte P45T-ES3G | Intel E8500 (3.2GHz) CPU | 16GB DDR3 1066 RAM
    Six WD Red WD20EFRX NAS Hard Drives (RAIDZ2, 7.3TB usable space)
    Adata PD7 USB Flash Drive (4GB) for OS | 1GB Patriot Xporter USB Flash Drive for Scripts & Plugins
    APC Back-UPS Pro BR1000G

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •