FAQ  •  Register  •  Login

Web UI in PHP

<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Mon Oct 03, 2011 9:49 pm

Re: Web UI in PHP

I'll take a look. I haven't really got my head around the REST stuff yet. I've fixed another annoyance, which was that when paths or feed names were too long they made a mess of the page (super-wide). I have made it cut them off with "..." at 80 characters and added the full title as a title tag so you can see it when you mouse over, which mimics the behaviour of the full Serviio Console.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

mpemberton5

DLNA master

Posts: 120

Joined: Sun Aug 28, 2011 9:01 pm

Location: North Carolina, USA

Post Wed Oct 05, 2011 4:37 am

Re: Web UI in PHP

Here's an updated version of Web UI in PHP. This will work with 0.6.0.1 and has an updated library section that displays the sources in tabs.

http://dl.dropbox.com/u/42061/serviio-0.6.0.1.zip

Please let me know if you have any issues.

I do know of the known issue with the QNAP users where the presentation section is still broken. I'm working on a possible solution.

Thanks all,
Mark
<<

cburbs

Serviio newbie

Posts: 10

Joined: Sun Jun 05, 2011 3:11 pm

Post Wed Oct 05, 2011 5:59 pm

Re: Web UI in PHP

Mine still won't save any paths I add. All other pages save any changes ok. Whenever I click the save button it ends up going to a blank page. The other ones seem to work OK.
I am running this on Vortexbox and the old version worked fine with the library.

I also just updated to your newest web ui.
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Thu Oct 06, 2011 3:28 pm

Re: Web UI in PHP

mpemberton5 wrote:Here's an updated version of Web UI in PHP. This will work with 0.6.0.1 and has an updated library section that displays the sources in tabs.

http://dl.dropbox.com/u/42061/serviio-0.6.0.1.zip

Please let me know if you have any issues.

I do know of the known issue with the QNAP users where the presentation section is still broken. I'm working on a possible solution.

Thanks all,
Mark


I probably should have posted my work earlier to avoid unnecessary duplication of effort, but I had wanted to kind of finish it first. Anyway, here is where I got to:
http://dl.dropbox.com/u/1188556/serviio ... -v1.tar.gz

changes:
. updated the version check to 0.6.0.1 - is this really necessary?
. added the Online sources as a tab rather than lower down on the Library page
. moved the selectable tabs from align=center to align=left. On the Serviio Console they're obvious but since they're not so well highlighted in the Web UI it seems clearer to have them on the left.
. Library Status is not shown for Online Sources since it only relates to Shared Folders, like the proper Serviio Console. Feeds are cached at Serviio startup, or at expiry time, but not by user control
. fixed the tables display (why the red dot in the top left?), added padding in the stylesheet rather than static 20px column sizes
. added the mouse-over text for the coloured blobs in Status view (with i18n) which the proper Serviio Console has
. ensured only the selected tab is bolded, even when first landing on a page with several tabs
. added bolding of the selected main tab across the top
. edited the css to stop the links from being coloured purple once followed
. fixed the displaying of long feed names in Online Sources (showing the full name on mouse-over, which more closely mimics the real Serviio Console - Gametrailers.com ones are huge)
. I have tried to add i18n support to all the new 0.6 features (some of yours were guesses which aren't the actual names Zip used for 0.6's new items)
. fixed a few missing i18n fields from earlier versions of the webui
. freshened the messages_{lang-name} files with the ones from Serviio 0.6.0.1 - very few are up to date though (use my bundled Italian one from the forum for testing which has all new fields for 0.6)
. included my edited style sheet to mimic the Synology Control Panel UI - I think it looks way nicer than the standard one
. got rid of the horizontal rules which were cluttering the presentation

still remaining to do:
. i18n support for dialog boxes (like Add sources) and dropdowns
. possibly remove the 'Are you sure' message on save, since the real Serviio UI does not have this and there are no translations for it
. testing :) - I noticed that it mangled one of my feeds when I edited a different one. Definitely needs more work...
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

cburbs

Serviio newbie

Posts: 10

Joined: Sun Jun 05, 2011 3:11 pm

Post Thu Oct 06, 2011 9:35 pm

Re: Web UI in PHP

Anyone have any ideas why my library won't hold the correct info I put in? I can't save any changes on the library page but the rest of them work fine.
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Oct 06, 2011 9:49 pm

Re: Web UI in PHP

did you upgrade from 0.5 to 0.6? How are you entering the information into your library?
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

cburbs

Serviio newbie

Posts: 10

Joined: Sun Jun 05, 2011 3:11 pm

Post Thu Oct 06, 2011 10:10 pm

Re: Web UI in PHP

Yes I was running 5.2 and now running 6.0.1.
Downloaded newest 6.0.1 and newest web ui.

I run this on a vortexbox which is based off of fedora14 right now.

Storage is shared like the following /storage/movies

But like I said even if I uncheck "Search for updates of currently shared files" and click save it goes to a blank page -

All other tabs seem to work fine if I make changes to them.

The Reset on that tab seems to work fine it just seems like the save button is not working correctly.
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Thu Oct 06, 2011 11:01 pm

Re: Web UI in PHP

I can add and remove paths in Shared Folders without issue on Linux on Synology NAS. Did you have this problem with the 0.5.2 Web UI or has this started with the newer versions?
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

cburbs

Serviio newbie

Posts: 10

Joined: Sun Jun 05, 2011 3:11 pm

Post Thu Oct 06, 2011 11:57 pm

Re: Web UI in PHP

This started with the newer version.

I will try and test a few things in a vmware of what I currently am running to see if it does the same thing.

I have my old test session still running 5.2 and that one works fine just like my main box was - odd that only the library tab/page is messed up and the rest of them work.
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Fri Oct 07, 2011 7:32 am

Re: Web UI in PHP

Well the library tab is the one that's been altered so that would explain it. I'll have a detailed look when I have time.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

HellesAngel

Serviio newbie

Posts: 6

Joined: Fri Oct 07, 2011 10:15 am

Post Fri Oct 07, 2011 12:13 pm

Re: Web UI in PHP

First post on this board so hello everyone, and so far thanks for some excellent software. Unfortunately I'm also having the 'Cannot put repository' problem, I found a workaround so it's not the end of the world.

The problems: I have noticed that if /usr/share/serviio/bin/serviio.sh is run from the command line as root or as a normal user (the same user given in /etc/default/serviio) then it is possible to add paths, either local or not, from the web GUI. If serviio is started as with service serviio start, then it is not possible to add paths. Also if serviio is started as a service, or running in a shell as a non-root user, then the TV can't access any media, although it does see the server. If started as root from the command line then the TV can play everything.

The server is running Ubuntu Server 10.10, has a clean install of serviio-0.6.0.1-linux.tar.gz in /usr/share/serviio and a clean install of http://dl.dropbox.com/u/42061/serviio-0.6.0.1.zip in /var/www. The only modifications to these have been correcting the path & user name in the /etc/default/serviio and the location changes in the $serviio_host in /var/www/serviio/config.php. The server & web GUI are both running, my Sony Bravia has found the server - apart from the 'add paths' problem, everything looks great.

It seems that it is also necessary that serviio/the gui has write access to the directories or the same error is generated, which I can't fathom why. I prefer to have my media libraries mounted read only on players - r/w only when necessary.

Any ideas? Permissions probably, but what? Thanks in advance.
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Fri Oct 07, 2011 5:14 pm

Re: Web UI in PHP

The user Serviio runs as should own all the files in the Serviio folder. Use chown -R user /path/to/serviio/folder

However, since the webui uses Serviio's REST API to submit changes it should not need any special permissions.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

Xmantium

User avatar

DLNA master

Posts: 1396

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sun Oct 09, 2011 4:05 am

Re: Web UI in PHP

Patters im liking the updates you've made, you should joint collaborate with mark on this project and can be offcial on AcidumIraes serviio development webpage.
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

Cantello

Serviio newbie

Posts: 6

Joined: Wed Oct 12, 2011 7:45 am

Post Wed Oct 12, 2011 7:51 am

Re: Web UI in PHP

Cerberus wrote:So in short you will need to install cURL extension onto your device to make the webui work.


This would be something to put in the first post - I was wondering why it wouldn't work... :-)

Now works well here (Ubuntu 11.04, apache2).
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Wed Oct 12, 2011 8:06 am

Re: Web UI in PHP

Cantello wrote:
Cerberus wrote:So in short you will need to install cURL extension onto your device to make the webui work.


This would be something to put in the first post - I was wondering why it wouldn't work... :-)

Now works well here (Ubuntu 11.04, apache2).


i would but i dnt have ability to ;)
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Mon Oct 17, 2011 11:08 pm

Re: Web UI in PHP

Online feed URLs containing ampersands are getting chewed up by the Web UI - e.g.:

http://feeds.gametrailers.com/rssgenerate.php?s1=&favplats[xb360]=xb360&vidformat[flv]=on&type[review]=on&quality[hd]=on&agegate[no]=on&orderby=newest&limit=20

is cropped to:

http://feeds.gametrailers.com/rssgenerate.php?s1=

Despite tinkering with this I'm not a web developer so I'm not sure how this needs to be fixed. It's seems that they need translating to &amp; as the URL is read from input. Would we manually do this as a string substitution, or is there a function to do these HTML special chars automatically? I'm guessing this could be relevant:
http://www.w3.org/QA/2005/04/php-session
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

mpemberton5

DLNA master

Posts: 120

Joined: Sun Aug 28, 2011 9:01 pm

Location: North Carolina, USA

Post Tue Oct 18, 2011 1:54 am

Re: Web UI in PHP

patters wrote:Online feed URLs containing ampersands are getting chewed up by the Web UI - e.g.:

http://feeds.gametrailers.com/rssgenerate.php?s1=&favplats[xb360]=xb360&vidformat[flv]=on&type[review]=on&quality[hd]=on&agegate[no]=on&orderby=newest&limit=20

is cropped to:

http://feeds.gametrailers.com/rssgenerate.php?s1=

Despite tinkering with this I'm not a web developer so I'm not sure how this needs to be fixed. It's seems that they need translating to &amp; as the URL is read from input. Would we manually do this as a string substitution, or is there a function to do these HTML special chars automatically? I'm guessing this could be relevant:
http://www.w3.org/QA/2005/04/php-session


The encodeurl() function will encode too many things so for now let's just replace the ampersand.

Try replacing this line (approx line 535) in lib/serviio.php:
Before:
  Code:
            $Folder->appendChild($xmlDoc->createElement("contentUrl", $entry[1]));

After:
  Code:
            $Folder->appendChild($xmlDoc->createElement("contentUrl", str_replace("&", "&amp;", $entry[1])));
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Tue Oct 18, 2011 8:25 am

Re: Web UI in PHP

Thing is, then we get problems with recursive substitution if you then add another feed with the Web UI - resulting in &amp;amp; for the first feed since the data for all feeds is resubmitted via REST.

This page offers a nice regex for the job:
  Code:
&(?![A-Za-z]+;|#[0-9]+;)
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Tue Oct 18, 2011 10:13 am

Re: Web UI in PHP

I tried:
  Code:
$Folder->appendChild($xmlDoc->createElement("contentUrl", preg_replace ("&(?![A-Za-z]+;|#[0-9]+;)", "&amp;", $entry[1])));


but it isn't working (no new feeds can be added). How can I debug it, since that bit isn't outputting to the HTML, and the library page is being reloaded straight away after the submit?

I suspect that some of the characters in that regex might need escaping. Can you cast an eye over it for anything obvious?
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Tue Oct 18, 2011 10:50 am

Re: Web UI in PHP

Sweet, fixed. I just needed to delimit the regex with slashes like so:
  Code:
$Folder->appendChild($xmlDoc->createElement("contentUrl", preg_replace ("/&(?![A-Za-z]+;|#[0-9]+;)/", "&amp;", $entry[1])));
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
PreviousNext

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 10 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.