Kodi Community Forum
MediaFrontPage - Web interface with widget type architecture to control multiple apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: MediaFrontPage - Web interface with widget type architecture to control multiple apps (/showthread.php?tid=83304)



- DejaVu - 2010-11-13

I know shutting down from MediaFrontPage -

$shortcut["Shutdown XBMC"] = array("cmd" => 'shutdown');

Is rebooting simply -

$shortcut["Reboot XBMC"] = array("cmd" => 'reboot');

--EDIT--
Nope. Can anyone enlighten me please - I mean the whole system, not just XBMC.

Also, can a Git Pull/Update for MFP be made from the interface itself?


- Zarquon - 2010-11-14

DejaVu77 Wrote:I know shutting down from MediaFrontPage -

$shortcut["Shutdown XBMC"] = array("cmd" => 'shutdown');

Is rebooting simply -

$shortcut["Reboot XBMC"] = array("cmd" => 'reboot');

--EDIT--
Nope. Can anyone enlighten me please - I mean the whole system, not just XBMC.

Also, can a Git Pull/Update for MFP be made from the interface itself?
Any item supported by the cmd index needs to be written. It is fairly easy to add items like this and it would be great if someone volunteered. ;-)

Another option is that you can call a json command directly which could be done for the reboot.

Once this project gets further then maybe we can add an easier way to do an update.


- DejaVu - 2010-11-14

I volunteer my services for any help you need with this project.
Unfortunately, I have no idea where to start, HTML and a little PHP manipulation is the best of my abilities unfortunately.

I seriously wish I could get into helping you guys out with this.
Where is the best place to start learning to do this stuff?


- Nick8888 - 2010-11-14

There are lots of guides on the net, http://www.w3schools.com/php/php_intro.asp. Just Learn the basic, stuff and then have a look at how this project works for using xbmc's json server. https://github.com/xbmcfreak/xbmc-remote-php


- gugahoi - 2010-11-14

I see you haven't implemented resume/pause in the sab widget yet. Does that code not work for you? Anything I can do to help?

I'm trying to implement speedlimit changing now but I can't get the form to run the proper url. This is what I've got, maybe someone can help me.

Code:
    echo "<form action=\"$speedurl\" method=\"get\" target=\"nothing\">
    <input name=\"speedlimit\" type=\"text\" value=\"$speed\" size=\"1\" />
    <input type=\"submit\" value=\"set speed\" />
    </form>";

target=nothing is just an invisible iframe and $speed is the variable containing the current speed limit from JSON. I can't figure out how to get the submit button to send the
Code:
"api?mode=config&name=speedlimit&value=400"
to my target frame with the inputed speed. I get sent to this url instead "http://MYIP/sabnzbd/tapi?speedlimit=400" how do I get the value to be in the proper place in the URL?


- Zarquon - 2010-11-14

DejaVu77 Wrote:I volunteer my services for any help you need with this project.
Unfortunately, I have no idea where to start, HTML and a little PHP manipulation is the best of my abilities unfortunately.

I seriously wish I could get into helping you guys out with this.
Where is the best place to start learning to do this stuff?
Any help would be great. If you take a look at the wControl.php you can see how the 'cmd' parameters works. Specifically it calls a json method. You can look at the xbmcjsonlib.php you can see which methods have support built. As such adding a "Reboot" cmd support should take less time than it took to write this email. You could then look at adding some of the other methods, specifically the "XBMC.Quit" and all the "System" methods.
pm me the work and I can merge it into the code.


- Zarquon - 2010-11-14

gugahoi Wrote:I see you haven't implemented resume/pause in the sab widget yet. Does that code not work for you? Anything I can do to help?

I'm trying to implement speedlimit changing now but I can't get the form to run the proper url. This is what I've got, maybe someone can help me.

Code:
    echo "<form action=\"$speedurl\" method=\"get\" target=\"nothing\">
    <input name=\"speedlimit\" type=\"text\" value=\"$speed\" size=\"1\" />
    <input type=\"submit\" value=\"set speed\" />
    </form>";

target=nothing is just an invisible iframe and $speed is the variable containing the current speed limit from JSON. I can't figure out how to get the submit button to send the
Code:
"api?mode=config&name=speedlimit&value=400"
to my target frame with the inputed speed. I get sent to this url instead "http://MYIP/sabnzbd/tapi?speedlimit=400" how do I get the value to be in the proper place in the URL?
pm me your code changes and I can take a look. But a quick check would be that $speedurl = $saburl."api" and then add a hidden input tag that is named apikey with a value of $sabapikey

P.S. The form submit method (although valid) is a little cumbersome. You would be better implementing it though ajax.


- Nick8888 - 2010-11-14

Here it is Zarquon http://forum.xbmc.org/showpost.php?p=641185&postcount=172 Sorry I haven't had time to look at it yet.


- Zarquon - 2010-11-14

Nick8888 Wrote:Here it is Zarquon http://forum.xbmc.org/showpost.php?p=641185&postcount=172 Sorry I haven't had time to look at it yet.
OK I'll incorporate this into the code base.


- gugahoi - 2010-11-14

Oh hey, thanks. I've been doing some reading on php and javascript and will read further in ajax later on. You can probably see it's very basic but functional as I said earlier.
I didn't mean to be imposing, I was just wondering if it didn't work for you or maybe it was all garbage? I'm very new to programming so it's always good to see how I'm doing.
I see now that maybe creating a function to handle the action URL's is better, as I'm trying now. Something like sabQuery, but instead of the JSON output, it just returns the URL value. Like sabURL(pause) would return the entire url for pausing and such. That would clean up the code quite a bit.


- Clown - 2010-11-14

Can I make a suggestion? I can't see a to-do list anywhere so I don't know what your plans are but because the middle column is always so big, I wanted to pad the two side columns with various RSS feeds. How easy would that be to do?


- Nick8888 - 2010-11-14

Feel free to add any requests on the issues page of github. I've been thinking about creating an alternate slimmed down version of the comingepisodes widget (like the mobile one). I'm afraid you will have to explain yourself a little better about the rss feeds as I'm not sure what you mean exactly.


- Clown - 2010-11-14

I'm imagining one of those movable widget boxes, but instead of Recent Movies or something it would be filled with the results of an RSS Feed. This is what it looks like in Google Reader -
Image


- Zarquon - 2010-11-14

Zarquon Wrote:OK I'll incorporate this into the code base.

Ok I have incorporated those changes. I have not added the speed limiter yet but I have laid the groundwork to make additional actions fairly easy to add.


- DejaVu - 2010-11-15

From what I've seen adding
Quote:case "reboot": // Reboot
$results = jsonmethodcall("System.Reboot");
$displayMenu = ($_GET["style"] == "m");
break;
to the wControl.php
and then

Quote:$xbmcJsonMethods['System.Reboot'] = array('call' => '{"jsonrpc": "2.0", "method": "System.Reboot", "id" : 1 }');

to the xbmcjsonlib.php file should then create the Reboot function for MFP...?

If this being the case, it's obviously just one of them mundane jobs, but if it helps you guys out to improve other things, I'll get bang on it and PM the 2 files once complete.

Sorry for the question, but thought I'd better make sure I'm correct first. Smile
Code Manipulation is OK. Writing this stuff from scratch is going to take some patience!
Obviously, I'll make sure that the correct function is called by checking with JSON's wording. Smile

--EDIT--
I feel real clever. Thanks for the advice Zarquon. I managed to get Reboot, Hibernate, Suspend and Exit working. Smile
I think all it needs now is a notification that it's happening. Smile

PM'd the bits I added. Didnt take long either! Chuffed Big Grin